Skip to content

Commit acc4e30

Browse files
authoredJun 14, 2024
chore: add reth configuration & cleanup configs (base#271)
* Add Reth Node Configuration * Parameterize features * update images to use alpine / static versions * Restructure client files into separate directories * Allow images to work w/ devnets * bump reth commit * fix the image name to include base-org * Allow overriding via env var
1 parent b63b798 commit acc4e30

18 files changed

+204
-29832
lines changed
 

‎.env

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
GETH_HOST_DATA_DIR=./geth-data
1+
CLIENT=${CLIENT:-geth}
2+
HOST_DATA_DIR=./${CLIENT}-data

‎.env.mainnet

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
RETH_CHAIN=base
2+
RETH_SEQUENCER_HTTP=https://mainnet-sequencer.base.org
3+
14
OP_GETH_GENESIS_FILE_PATH=mainnet/genesis-l2.json
25
OP_GETH_SEQUENCER_HTTP=https://mainnet-sequencer.base.org
3-
46
# [optional] used to enable geth stats:
57
# OP_GETH_ETH_STATS=nodename:secret@host:port
68

@@ -13,9 +15,8 @@ OP_NODE_L1_BEACON=https://your.mainnet.beacon.node/endpoint-here
1315
# auth secret used by op-geth engine API:
1416
OP_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a
1517

16-
OP_NODE_BETA_EXTRA_NETWORKS=true
1718
OP_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt
18-
OP_NODE_L2_ENGINE_RPC=ws://geth:8551
19+
OP_NODE_L2_ENGINE_RPC=ws://execution:8551
1920
OP_NODE_LOG_LEVEL=info
2021
OP_NODE_METRICS_ADDR=0.0.0.0
2122
OP_NODE_METRICS_ENABLED=true
@@ -26,7 +27,6 @@ OP_NODE_P2P_BOOTNODES=enr:-J24QNz9lbrKbN4iSmmjtnr7SjUMk4zB7f1krHZcTZx-JRKZd0kA2g
2627
OP_NODE_P2P_LISTEN_IP=0.0.0.0
2728
OP_NODE_P2P_LISTEN_TCP_PORT=9222
2829
OP_NODE_P2P_LISTEN_UDP_PORT=9222
29-
OP_NODE_ROLLUP_CONFIG=mainnet/rollup.json
3030
OP_NODE_RPC_ADDR=0.0.0.0
3131
OP_NODE_RPC_PORT=8545
3232
OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log

‎.env.sepolia

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
RETH_CHAIN=base-sepolia
2+
RETH_SEQUENCER_HTTP=https://sepolia-sequencer.base.org
3+
14
OP_GETH_GENESIS_FILE_PATH=sepolia/genesis-l2.json
25
OP_GETH_SEQUENCER_HTTP=https://sepolia-sequencer.base.org
36

@@ -13,9 +16,8 @@ OP_NODE_L1_BEACON=https://your.sepolia.beacon.node/endpoint-here
1316
# auth secret used by op-geth engine API:
1417
OP_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a
1518

16-
OP_NODE_BETA_EXTRA_NETWORKS=true
1719
OP_NODE_L2_ENGINE_AUTH=/tmp/engine-auth-jwt
18-
OP_NODE_L2_ENGINE_RPC=ws://geth:8551
20+
OP_NODE_L2_ENGINE_RPC=ws://execution:8551
1921
OP_NODE_LOG_LEVEL=info
2022
OP_NODE_METRICS_ADDR=0.0.0.0
2123
OP_NODE_METRICS_ENABLED=true
@@ -26,7 +28,6 @@ OP_NODE_P2P_BOOTNODES=enr:-J64QBwRIWAco7lv6jImSOjPU_W266lHXzpAS5YOh7WmgTyBZkgLgO
2628
OP_NODE_P2P_LISTEN_IP=0.0.0.0
2729
OP_NODE_P2P_LISTEN_TCP_PORT=9222
2830
OP_NODE_P2P_LISTEN_UDP_PORT=9222
29-
OP_NODE_ROLLUP_CONFIG=sepolia/rollup.json
3031
OP_NODE_RPC_ADDR=0.0.0.0
3132
OP_NODE_RPC_PORT=8545
3233
OP_NODE_SNAPSHOT_LOG=/tmp/op-node-snapshot-log

‎.github/workflows/docker.yml

+50-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ on:
99

1010
env:
1111
REGISTRY: ghcr.io
12-
IMAGE_NAME: ${{ github.repository }}
12+
NAMESPACE: ghcr.io/base-org
13+
GETH_DEPRECATED_IMAGE_NAME: node
14+
GETH_IMAGE_NAME: node-geth
15+
RETH_IMAGE_NAME: node-reth
1316

1417
jobs:
15-
build:
18+
geth:
1619
runs-on: ubuntu-latest
1720
steps:
1821
- name: Checkout
@@ -29,7 +32,9 @@ jobs:
2932
id: meta
3033
uses: docker/metadata-action@v4
3134
with:
32-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
images: |
36+
${{ env.NAMESPACE }}/${{ env.GETH_DEPRECATED_IMAGE_NAME }}
37+
${{ env.NAMESPACE }}/${{ env.GETH_IMAGE_NAME }}
3338
3439
- name: Set up Docker Buildx
3540
uses: docker/setup-buildx-action@v3
@@ -38,7 +43,49 @@ jobs:
3843
uses: docker/build-push-action@v4
3944
with:
4045
context: .
46+
file: geth/Dockerfile
4147
push: true
4248
tags: ${{ steps.meta.outputs.tags }}
4349
labels: ${{ steps.meta.outputs.labels }}
4450
platforms: linux/amd64,linux/arm64
51+
reth:
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
include:
56+
- arch: linux/amd64
57+
features: jemalloc,asm-keccak,optimism
58+
- arch: linux/arm64
59+
features: jemalloc,optimism
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v2
63+
64+
- name: Log into the Container registry
65+
uses: docker/login-action@v3
66+
with:
67+
registry: ${{ env.REGISTRY }}
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Extract metadata for the Docker image
72+
id: meta
73+
uses: docker/metadata-action@v4
74+
with:
75+
images: |
76+
${{ env.NAMESPACE }}/${{ env.RETH_IMAGE_NAME }}
77+
78+
- name: Set up Docker Buildx
79+
uses: docker/setup-buildx-action@v3
80+
81+
- name: Build and push the Docker image
82+
uses: docker/build-push-action@v4
83+
with:
84+
context: .
85+
file: reth/Dockerfile
86+
push: true
87+
tags: ${{ steps.meta.outputs.tags }}
88+
labels: ${{ steps.meta.outputs.labels }}
89+
build-args: |
90+
FEATURES=${{ matrix.features }}
91+
platforms: ${{ matrix.arch }}

‎.github/workflows/pr.yml

+27-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55

66
jobs:
7-
build:
7+
geth:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
@@ -20,5 +20,31 @@ jobs:
2020
uses: docker/build-push-action@v4
2121
with:
2222
context: .
23+
file: geth/Dockerfile
2324
push: false
2425
platforms: ${{ matrix.arch }}
26+
reth:
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
include:
31+
- arch: linux/amd64
32+
features: jemalloc,asm-keccak,optimism
33+
- arch: linux/arm64
34+
features: jemalloc,optimism
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
with:
39+
ref: ${{ github.event.pull_request.head.sha }}
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
- name: Build the Docker image
43+
uses: docker/build-push-action@v4
44+
with:
45+
context: .
46+
file: reth/Dockerfile
47+
push: false
48+
build-args: |
49+
FEATURES=${{ matrix.features }}
50+
platforms: ${{ matrix.arch }}

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/.idea/
2-
/geth-data/
2+
/geth-data/
3+
/reth-data/

‎README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ If you encounter problems with your node, please open a [GitHub issue](https://g
4444

4545
### Supported networks
4646

47-
| Ethereum Network | Status |
48-
| ---------------- | ------ |
49-
| Sepolia testnet ||
50-
| Mainnet ||
47+
| Base Network | Status |
48+
|-------------------| ------ |
49+
| Testnet (Sepolia) ||
50+
| Mainnet ||
5151

5252
### Usage
5353

‎docker-compose.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
version: '3.8'
2-
31
services:
4-
geth: # this is Optimism's geth client
5-
build: .
2+
execution:
3+
build:
4+
context: .
5+
dockerfile: ${CLIENT}/Dockerfile
66
ports:
7-
- 8545:8545 # RPC
8-
- 8546:8546 # websocket
9-
- 30303:30303 # P2P TCP (currently unused)
10-
- 30303:30303/udp # P2P UDP (currently unused)
11-
- 7301:6060 # metrics
12-
command: [ "bash", "./geth-entrypoint" ]
7+
- "8545:8545" # RPC
8+
- "8546:8546" # websocket
9+
- "7301:6060" # metrics
10+
command: [ "bash", "./execution-entrypoint" ]
1311
volumes:
14-
- ${GETH_HOST_DATA_DIR}:/data
12+
- ${HOST_DATA_DIR}:/data
1513
env_file:
1614
# select your network here:
1715
# - .env.sepolia
1816
# - .env.mainnet
1917
node:
20-
build: .
18+
build:
19+
context: .
20+
dockerfile: ${CLIENT}/Dockerfile
2121
depends_on:
22-
- geth
22+
- execution
2323
ports:
24-
- 7545:8545 # RPC
25-
- 9222:9222 # P2P TCP
26-
- 9222:9222/udp # P2P UDP
27-
- 7300:7300 # metrics
28-
- 6060:6060 # pprof
24+
- "7545:8545" # RPC
25+
- "9222:9222" # P2P TCP
26+
- "9222:9222/udp" # P2P UDP
27+
- "7300:7300" # metrics
28+
- "6060:6060" # pprof
2929
command: [ "bash", "./op-node-entrypoint" ]
3030
env_file:
3131
# select your network here:

‎Dockerfile ‎geth/Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN git clone $REPO --branch $VERSION --single-branch . && \
3030

3131
RUN go run build/ci.go install -static ./cmd/geth
3232

33-
FROM golang:1.21
33+
FROM ubuntu:22.04
3434

3535
RUN apt-get update && \
3636
apt-get install -y jq curl supervisor && \
@@ -42,9 +42,7 @@ WORKDIR /app
4242
COPY --from=op /app/op-node/bin/op-node ./
4343
COPY --from=geth /app/build/bin/geth ./
4444
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
45-
COPY geth-entrypoint .
45+
COPY geth/geth-entrypoint ./execution-entrypoint
4646
COPY op-node-entrypoint .
47-
COPY sepolia ./sepolia
48-
COPY mainnet ./mainnet
4947

5048
CMD ["/usr/bin/supervisord"]
File renamed without changes.

0 commit comments

Comments
 (0)