Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docker/recipes/kona-node-dev/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
datadirs/
jwttoken/
op-rs-box1.env

86 changes: 86 additions & 0 deletions docker/recipes/kona-node-dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Requirements

This is intended to run on x86-64 architecture.

# Purpose

This recipe, `kona-node-dev`, is different from the `kona-node` recipe in that
it builds a local container image of `kona-node` instead of pulling a nightly
image of `main`. This is useful, because it allows developers to checkout a
development branch and see how it behaves on a network.

# Set up

Assuming you are on Ubuntu and your user is member of the group `docker`, first time run

git clone 'https://github.com/op-rs/kona.git'
git -C kona-node/kona checkout einar/kona-node-dev-recipe ### TODO(einar-oplabs) only for testing pre-merge
cd kona/docker/recipes/kona-node-dev/
just init

If the last step fails due to missing packages, you can run `just setup-ubuntu`
and then run `just init` again. This will install the required packages for
Ubuntu. `just init` will also set up a virtual network, and finally spin up
`kona-node`, `op-reth`, `prometheus` and `grafana`.

# Normal usage

For future invocation it suffices to spin the system up and down with:

just up
just down

You can also run `just upd` if you want to detach from the docker logs.
If you want to update the `kona` submodule, you can run `just update`.

A typical workflow after init could look like this:

# remove existing images causing them to be rebuild
just rmi
# pull latest commits
just update
# checkout dev branch
just checkout <my-branch>
# build images and start containers
just upd
# visit Grafana
just stop

For more info on the commands please refer to `justfile`.

# Environment

This setup uses `publicnode.com` as default L1, and the environment is configured in `publicnode.env`.
To use different RPC servers or ports, you can copy the file and make modifications. Then run:

just up myenv.env
just down myenv.env

or change the default in the `justfile.

# Services and observability

The following services are provided:

http://localhost:3000

Default credentials are `admin:admin` and you should change that if you plan to
use this instance over longer time.

# Storage

The data is stored in current directory `./datadirs`, but you can modify the
`volume` mapping in `docker-compose.yml` to use a different volume.


# Caveats

The port numbers are fixed, so it would not be possible to run more than one
instance on a machine at the same time. Please bear this in mind when running
an instance for longer time. You can check if ports are in use with `docker
ps`.


# Bugs and development

Everything is orchestrated from `justfile`. Feel free to edit and submit PRs.
121 changes: 121 additions & 0 deletions docker/recipes/kona-node-dev/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Use the shared network across all stacks
networks:
stf-net:
external: true

services:
prometheus:
restart: unless-stopped
image: prom/prometheus:latest
volumes:
- "prometheus_data:/prometheus"
- "./prometheus:/etc/prometheus"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
networks:
- stf-net

grafana:
restart: unless-stopped
image: grafana/grafana:latest
depends_on:
- prometheus
ports:
- "${GRAFANA_PORT:-3000}:3000"
environment:
PROMETHEUS_URL: ${PROMETHEUS_URL:-http://prometheus:9090}
volumes:
- "grafana_data:/var/lib/grafana"
- "./grafana/datasources:/etc/grafana/provisioning/datasources"
- "./grafana/dashboards:/etc/grafana/provisioning_temp/dashboards"
entrypoint: >
sh -c "cp -r /etc/grafana/provisioning_temp/dashboards/. /etc/grafana/provisioning/dashboards &&
find /etc/grafana/provisioning/dashboards/ -name '*.json' -exec sed -i 's/$${DS_PROMETHEUS}/Prometheus/g' {} \+ &&
/run.sh"
networks:
- stf-net


op-rs-op-sepolia-reth:
container_name: reth
build:
context: .
dockerfile: op-reth/op-reth.dockerfile
ports:
- "${OP_RETH_METRICS_PORT:-9001}:${OP_RETH_METRICS_PORT:-9001}"
- "${OP_RETH_DISCOVERY_PORT:-30303}:${OP_RETH_DISCOVERY_PORT:-30303}/udp"
- "${OP_RETH_DISCOVERY_PORT:-30303}:${OP_RETH_DISCOVERY_PORT:-30303}/tcp"
- "${OP_RETH_RPC_PORT:-8545}:${OP_RETH_RPC_PORT:-8545}"
- "${OP_RETH_ENGINE_PORT:-8551}:${OP_RETH_ENGINE_PORT:-8551}"
volumes:
- "./datadirs/reth-2:/db"
networks:
- stf-net
command: >
node
-vvv
--datadir /db
--chain optimism-sepolia
--metrics 0.0.0.0:${OP_RETH_METRICS_PORT:-9001}
--rollup.sequencer-http https://sepolia-sequencer.optimism.io/
--http
--http.port ${OP_RETH_RPC_PORT:-8545}
--http.addr 0.0.0.0
--http.api all
--authrpc.jwtsecret jwt.hex
--authrpc.addr 0.0.0.0
--authrpc.port ${OP_RETH_ENGINE_PORT:-8551}
--port ${OP_RETH_DISCOVERY_PORT:-30303}
--rpc.eth-proof-window 4096

op-rs-op-sepolia-kona-node:
container_name: kona
depends_on:
- prometheus
- op-rs-op-sepolia-reth
build:
context: .
dockerfile: kona-node/kona-node.dockerfile
ports:
- "${KONA_NODE_DISCOVERY_PORT:-9223}:${KONA_NODE_DISCOVERY_PORT:-9223}/tcp"
- "${KONA_NODE_DISCOVERY_PORT:-9223}:${KONA_NODE_DISCOVERY_PORT:-9223}/udp"
- "${KONA_NODE_METRICS_PORT:-9002}:${KONA_NODE_METRICS_PORT:-9002}"
- "${KONA_NODE_RPC_PORT:-5060}:${KONA_NODE_RPC_PORT:-5090}"

volumes:
- "./datadirs/kona-node:/db"
networks:
- stf-net
command: >
-vvv
--chain optimism-sepolia
--metrics.enabled
--metrics.port ${KONA_NODE_METRICS_PORT:-9002}
node
--l1 ${L1_PROVIDER_RPC:?}
--l1-beacon ${L1_BEACON_API:?}
--l2 "http://op-rs-op-sepolia-reth:${OP_RETH_ENGINE_PORT:-8551}"
--l2-engine-jwt-secret /jwt.hex
--rpc.port ${KONA_NODE_RPC_PORT:-5060}
--p2p.listen.tcp ${KONA_NODE_DISCOVERY_PORT:-9223}
--p2p.listen.udp ${KONA_NODE_DISCOVERY_PORT:-9223}
--p2p.scoring light
--p2p.bootstore /db




volumes:
prometheus_data:
driver: local
grafana_data:
driver: local
logs:
driver: local




1 change: 1 addition & 0 deletions docker/recipes/kona-node-dev/default.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RUST_LOG="batch_queue=error,derivation=trace,engine=info,engine_builder=debug,runtime=debug"
11 changes: 11 additions & 0 deletions docker/recipes/kona-node-dev/generate-jwt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
mkdir -p ${SCRIPT_DIR}/jwttoken
if [[ ! -f ${SCRIPT_DIR}/jwttoken/jwt.hex ]]
then
openssl rand -hex 32 | tr -d "\n" | tee > ${SCRIPT_DIR}/jwttoken/jwt.hex
echo "Generated a JWT secret at ${SCRIPT_DIR}/jwttoken/jwt.hex"
else
echo "${SCRIPT_DIR}/jwttoken/jwt.hex already exists!"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: 1

providers:
- name: 'Folder'
allowUiUpdates: true
options:
path: /etc/grafana/provisioning/dashboards
Loading
Loading