|
| 1 | +#!/bin/sh |
| 2 | +set -exu |
| 3 | + |
| 4 | +# Generate the rollup config. |
| 5 | + |
| 6 | +L1_URL="http://172.17.0.3:8545" |
| 7 | +L2_URL="http://172.17.0.4:9545" |
| 8 | + |
| 9 | +# Grab the L1 genesis. We can use cURL here to retry. |
| 10 | +L1_GENESIS=$(curl \ |
| 11 | + --silent \ |
| 12 | + --fail \ |
| 13 | + --retry 10 \ |
| 14 | + --retry-delay 2 \ |
| 15 | + --retry-connrefused \ |
| 16 | + -X POST \ |
| 17 | + -H "Content-Type: application/json" \ |
| 18 | + --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x0", false],"id":1}' \ |
| 19 | + $L1_URL) |
| 20 | + |
| 21 | +# Grab the L2 genesis. We can use cURL here to retry. |
| 22 | +L2_GENESIS=$(curl \ |
| 23 | + --silent \ |
| 24 | + --fail \ |
| 25 | + --retry 10 \ |
| 26 | + --retry-delay 2 \ |
| 27 | + --retry-connrefused \ |
| 28 | + -X POST \ |
| 29 | + -H "Content-Type: application/json" \ |
| 30 | + --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x0", false],"id":1}' \ |
| 31 | + $L2_URL) |
| 32 | + |
| 33 | +DEPOSIT_CONTRACT_ADDRESS=$(jq -r .address < /OptimismPortalProxy.json) |
| 34 | + |
| 35 | +jq ". | .genesis.l1.hash = \"$(echo $L1_GENESIS | jq -r '.result.hash')\"" < /rollup.json | \ |
| 36 | + jq ". | .genesis.l2.hash = \"$(echo $L2_GENESIS | jq -r '.result.hash')\"" | \ |
| 37 | + jq ". | .genesis.l2_time = $(echo $L2_GENESIS | jq -r '.result.timestamp' | xargs printf "%d")" | \ |
| 38 | + jq ". | .deposit_contract_address = \"$DEPOSIT_CONTRACT_ADDRESS\"" > /hive/rollup.json |
| 39 | + |
| 40 | +exec op-node \ |
| 41 | + --l1=ws://172.17.0.3:8546 \ |
| 42 | + --l2=ws://172.17.0.4:9546 \ |
| 43 | + --l2.jwt-secret=/config/test-jwt-secret.txt \ |
| 44 | + --sequencer.enabled \ |
| 45 | + --sequencer.l1-confs=0 \ |
| 46 | + --verifier.l1-confs=0 \ |
| 47 | + --p2p.sequencer.key=/config/p2p-sequencer-key.txt \ |
| 48 | + --rollup.config=/hive/rollup.json \ |
| 49 | + --rpc.addr=0.0.0.0 \ |
| 50 | + --rpc.port=7545 \ |
| 51 | + --p2p.listen.ip=0.0.0.0 \ |
| 52 | + --p2p.listen.tcp=9003 \ |
| 53 | + --p2p.listen.udp=9003 \ |
| 54 | + --snapshotlog.file=/snapshot.log \ |
| 55 | + --p2p.priv.path=/config/p2p-node-key.txt |
0 commit comments