|
| 1 | +volumes: |
| 2 | + op_geth_data: |
| 3 | + op_node_data: |
| 4 | + jwt_shared: |
| 5 | + config_data: |
| 6 | + |
| 7 | +services: |
| 8 | + |
| 9 | + # ======================================== |
| 10 | + # OPTIMISM NODE SERVICES |
| 11 | + # ======================================== |
| 12 | + op-init: |
| 13 | + image: alpine:latest |
| 14 | + command: |
| 15 | + - sh |
| 16 | + - -c |
| 17 | + - | |
| 18 | + set -e |
| 19 | +
|
| 20 | + # Create config directory |
| 21 | + mkdir -p /config |
| 22 | +
|
| 23 | + # Download genesis.json for op-geth if it doesn't exist |
| 24 | + echo 'Checking for genesis file' |
| 25 | + if [ ! -f '/config/genesis.json' ]; then |
| 26 | + echo 'Downloading genesis file' |
| 27 | + if ! wget -O '/config/genesis.json' 'https://fsn1.your-objectstorage.com/golem-base/altda/genesis.json'; then |
| 28 | + echo 'ERROR: Failed to download genesis file' |
| 29 | + exit 1 |
| 30 | + fi |
| 31 | + echo 'Genesis file downloaded successfully' |
| 32 | + else |
| 33 | + echo 'Genesis file already exists, skipping download' |
| 34 | + fi |
| 35 | +
|
| 36 | + # Download rollup.json for op-node if it doesn't exist |
| 37 | + echo 'Checking for rollup config' |
| 38 | + mkdir -p /op-node/rollup |
| 39 | + if [ ! -f '/op-node/rollup/rollup.json' ]; then |
| 40 | + echo 'Downloading op-node rollup config' |
| 41 | + if ! wget -O '/op-node/rollup/rollup.json' 'https://fsn1.your-objectstorage.com/golem-base/altda/rollup.json'; then |
| 42 | + echo 'ERROR: Failed to download rollup config' |
| 43 | + exit 1 |
| 44 | + fi |
| 45 | + echo 'Rollup config downloaded successfully' |
| 46 | +
|
| 47 | + # Set proper permissions only if we downloaded new files |
| 48 | + chmod -R 777 /op-node |
| 49 | + chmod -R 777 /config |
| 50 | + else |
| 51 | + echo 'Rollup config already exists, skipping download' |
| 52 | + fi |
| 53 | +
|
| 54 | + # Generate JWT secret if it doesn't exist |
| 55 | + if [ ! -f '/jwt/jwt' ]; then |
| 56 | + echo 'Generating JWT secret' |
| 57 | + mkdir -p /jwt |
| 58 | + # Generate a 32-byte random hex string for JWT secret |
| 59 | + apk add --no-cache openssl |
| 60 | + openssl rand -hex 32 > /jwt/jwt |
| 61 | + chmod 666 /jwt/jwt |
| 62 | + echo 'JWT secret generated successfully' |
| 63 | + else |
| 64 | + echo 'JWT secret already exists, skipping generation' |
| 65 | + fi |
| 66 | + volumes: |
| 67 | + - op_node_data:/op-node |
| 68 | + - config_data:/config |
| 69 | + - jwt_shared:/jwt |
| 70 | + |
| 71 | + op-geth-init: |
| 72 | + image: quay.io/golemnetwork/gb-op-geth:v1.101503.1-kaolin |
| 73 | + depends_on: |
| 74 | + op-init: |
| 75 | + condition: service_completed_successfully |
| 76 | + entrypoint: [] |
| 77 | + command: |
| 78 | + - /bin/sh |
| 79 | + - -c |
| 80 | + - | |
| 81 | + set -e |
| 82 | + if [ ! -f '/geth/geth' ]; then |
| 83 | + echo 'Initializing geth data directory with genesis block...' |
| 84 | +
|
| 85 | + # Use genesis file from op-init |
| 86 | + if ! geth init --state.scheme=hash --datadir='/geth' '/config/genesis.json'; then |
| 87 | + echo 'ERROR: Failed to initialize geth with genesis block' |
| 88 | + exit 1 |
| 89 | + fi |
| 90 | + echo 'Geth initialized successfully with genesis block' |
| 91 | + else |
| 92 | + echo 'Geth data directory already initialized, skipping initialization' |
| 93 | + fi |
| 94 | + volumes: |
| 95 | + - op_geth_data:/geth |
| 96 | + - config_data:/config |
| 97 | + |
| 98 | + op-geth: |
| 99 | + image: quay.io/golemnetwork/gb-op-geth:v1.101503.1-kaolin |
| 100 | + restart: unless-stopped |
| 101 | + stop_grace_period: 5m |
| 102 | + depends_on: |
| 103 | + op-geth-init: |
| 104 | + condition: service_completed_successfully |
| 105 | + command: |
| 106 | + - --networkid=500003 |
| 107 | + - --datadir=/geth |
| 108 | + - --nodiscover=true |
| 109 | + - --http |
| 110 | + - --http.corsdomain=* |
| 111 | + - --http.vhosts=* |
| 112 | + - --http.addr=0.0.0.0 |
| 113 | + - --http.port=8545 |
| 114 | + - --http.api=debug,eth,txpool,net,engine,web3,golembase,txpool |
| 115 | + - --ws |
| 116 | + - --ws.addr=0.0.0.0 |
| 117 | + - --ws.port=8546 |
| 118 | + - --ws.origins=* |
| 119 | + - --ws.api=debug,eth,txpool,net,engine,web3,golembase,txpool |
| 120 | + - --syncmode=snap |
| 121 | + - --authrpc.vhosts=* |
| 122 | + - --authrpc.addr=0.0.0.0 |
| 123 | + - --authrpc.port=8551 |
| 124 | + - --authrpc.jwtsecret=/jwt/jwt |
| 125 | + - --usb=false |
| 126 | + - --state.scheme=hash |
| 127 | + - --nat=none |
| 128 | + ports: |
| 129 | + - 8545:8545 |
| 130 | + - 8546:8546 |
| 131 | + volumes: |
| 132 | + - op_geth_data:/geth |
| 133 | + - jwt_shared:/jwt |
| 134 | + |
| 135 | + op-node: |
| 136 | + image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.13.0 |
| 137 | + restart: unless-stopped |
| 138 | + stop_grace_period: 5m |
| 139 | + depends_on: |
| 140 | + op-init: |
| 141 | + condition: service_completed_successfully |
| 142 | + op-geth: |
| 143 | + condition: service_started |
| 144 | + command: |
| 145 | + - op-node |
| 146 | + - --altda.enabled=true |
| 147 | + - --altda.da-server=https://altai.altda.l3.holesky.golem-base.io |
| 148 | + - --altda.da-service=false |
| 149 | + - --p2p.bootnodes= |
| 150 | + - --p2p.no-discovery=true |
| 151 | + - --l1=https://rpc.l2.holesky.golem-base.io |
| 152 | + - --l1.beacon.ignore=true |
| 153 | + - --l1.rpckind=standard |
| 154 | + - --l1.trustrpc |
| 155 | + - --l2=http://op-geth:8551 |
| 156 | + - --l2.enginekind=geth |
| 157 | + - --l2.jwt-secret=/jwt/jwt |
| 158 | + - --rpc.addr=0.0.0.0 |
| 159 | + - --rpc.port=9545 |
| 160 | + - --metrics.enabled |
| 161 | + - --metrics.addr=0.0.0.0 |
| 162 | + - --metrics.port=7300 |
| 163 | + - --syncmode=execution-layer |
| 164 | + - --rollup.config=/op-node/rollup/rollup.json |
| 165 | + - --log.level=info |
| 166 | + ports: |
| 167 | + - 9545:9545 |
| 168 | + volumes: |
| 169 | + - jwt_shared:/jwt |
| 170 | + - op_node_data:/op-node |
0 commit comments