Skip to content
Draft
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
5 changes: 5 additions & 0 deletions test/4-op-start-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ if [ "$CONDUCTOR_ENABLED" = "true" ]; then
fi

if [ "$LAUNCH_RPC_NODE" = "true" ]; then
if [ "$USE_RETH" = "true" ]; then
docker compose up -d op-reth-rpc
else
docker compose up -d op-geth-rpc
fi
docker compose up -d op-rpc
fi

Expand Down
75 changes: 23 additions & 52 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,37 +211,29 @@ services:
op-geth-rpc:
image: "${OP_GETH_IMAGE_TAG}"
container_name: op-geth-rpc
entrypoint: geth
entrypoint: /entrypoint/geth-rpc.sh
env_file:
- .env
volumes:
- ./data/op-geth-rpc:/datadir
- ./config-op/jwt.txt:/jwt.txt
- ./entrypoint:/entrypoint
ports:
- "9123:8545"

op-reth-rpc:
image: "${OP_RETH_IMAGE_TAG}"
container_name: op-reth-rpc
entrypoint: /entrypoint/reth-rpc.sh
env_file:
- .env
volumes:
- ./data/op-reth-rpc:/datadir
- ./config-op/jwt.txt:/jwt.txt
- ./config-op/genesis.json:/genesis.json
- ./entrypoint:/entrypoint
ports:
- "9123:8545"
command:
- --datadir=/datadir
- --db.engine=${DB_ENGINE}
- --http
- --http.corsdomain=*
- --http.vhosts=*
- --http.port=8545
- --http.addr=0.0.0.0
- --http.api=web3,debug,eth,txpool,net,engine,miner
- --ws
- --ws.addr=0.0.0.0
- --ws.port=7546
- --ws.origins=*
- --ws.api=debug,eth,txpool,net,engine
- --syncmode=full
- --gcmode=archive
- --nodiscover
- --maxpeers=0
- --networkid=901
- --authrpc.vhosts=*
- --authrpc.addr=0.0.0.0
- --authrpc.port=8552
- --authrpc.jwtsecret=/jwt.txt
- --rollup.sequencerhttp=http://op-geth-seq:8545
- --rollup.enabletxpooladmission

op-seq:
image: "${OP_STACK_IMAGE_TAG}"
Expand Down Expand Up @@ -277,45 +269,24 @@ services:
- --l1.beacon=${L1_BEACON_URL_IN_DOCKER}
- --l1.rpckind=standard
- --safedb.path=/data/safedb
- --conductor.enabled=${CONDUCTOR_ENABLED:-false} # 默认关闭
- --conductor.enabled=${CONDUCTOR_ENABLED:-false}
- --conductor.rpc=http://op-conductor:8547
depends_on:
- op-geth-seq

op-rpc:
image: "${OP_STACK_IMAGE_TAG}"
container_name: op-rpc
entrypoint: /entrypoint/node-rpc.sh
env_file:
- .env
volumes:
- ./data/op-rpc:/data
- ./config-op/rollup.json:/rollup.json
- ./config-op/jwt.txt:/jwt.txt
- ./config-op/oprpc_p2p_priv.txt:/opnode_p2p_priv.txt
- ./entrypoint:/entrypoint
ports:
- "9555:9545"
command:
- /app/op-node/bin/op-node
- --log.level=debug
- --l2=http://op-geth-rpc:8552
- --l2.jwt-secret=/jwt.txt
- --sequencer.enabled=false
- --verifier.l1-confs=1
- --rollup.config=/rollup.json
- --rpc.addr=0.0.0.0
- --rpc.port=9545
- --p2p.listen.tcp=9223
- --p2p.listen.udp=9223
- --p2p.priv.raw=604557d042fbea9ed42f46c0c95c346a932b6a5ef0c0dd07a00dbf95801a2510
- --p2p.peerstore.path=/data/p2p/opnode_peerstore_db
- --p2p.discovery.path=/data/p2p/opnode_discovery_db
- --p2p.static=/dns4/op-seq/tcp/9223/p2p/16Uiu2HAkzHdkbmS2VrCsccLibsu7MvGHpmFUMJnMTkKifrtS5m65
- --p2p.no-discovery
- --rpc.enable-admin=true
- --l1=${L1_RPC_URL_IN_DOCKER}
- --l1.beacon=${L1_BEACON_URL_IN_DOCKER}
- --l1.rpckind=standard
- --safedb.path=/data/safedb
depends_on:
- op-geth-rpc

op-conductor:
image: "${OP_STACK_IMAGE_TAG}"
Expand Down
33 changes: 33 additions & 0 deletions test/entrypoint/geth-rpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

set -e

DB_ENGINE="${DB_ENGINE:-pebble}"
L2_RPC_URL_IN_DOCKER="${L2_RPC_URL_IN_DOCKER:-http://op-geth-seq:8545}"

# 启动geth
exec geth \
--datadir=/datadir \
--db.engine="$DB_ENGINE" \
--http \
--http.corsdomain=* \
--http.vhosts=* \
--http.port=8545 \
--http.addr=0.0.0.0 \
--http.api=web3,debug,eth,txpool,net,engine,miner \
--ws \
--ws.addr=0.0.0.0 \
--ws.port=7546 \
--ws.origins=* \
--ws.api=debug,eth,txpool,net,engine \
--syncmode=full \
--gcmode=archive \
--nodiscover \
--maxpeers=0 \
--networkid=901 \
--authrpc.vhosts=* \
--authrpc.addr=0.0.0.0 \
--authrpc.port=8552 \
--authrpc.jwtsecret=/jwt.txt \
--rollup.sequencerhttp="$L2_RPC_URL_IN_DOCKER" \
--rollup.enabletxpooladmission
41 changes: 41 additions & 0 deletions test/entrypoint/node-rpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh


set -e

USE_RETH="${USE_RETH:-false}"
L1_RPC_URL_IN_DOCKER="${L1_RPC_URL_IN_DOCKER:-http://l1-geth:8545}"
L1_BEACON_URL_IN_DOCKER="${L1_BEACON_URL_IN_DOCKER:-http://l1-beacon-chain:3500}"

echo "Starting op-node RPC..."
echo "USE_RETH: $USE_RETH"

if [ "$USE_RETH" = "true" ]; then
L2_URL="http://op-reth-rpc:8552"
echo "Connecting to Reth: $L2_URL"
else
L2_URL="http://op-geth-rpc:8552"
echo "Connecting to Geth: $L2_URL"
fi

exec /app/op-node/bin/op-node \
--log.level=debug \
--l2="$L2_URL" \
--l2.jwt-secret=/jwt.txt \
--sequencer.enabled=false \
--verifier.l1-confs=1 \
--rollup.config=/rollup.json \
--rpc.addr=0.0.0.0 \
--rpc.port=9545 \
--p2p.listen.tcp=9223 \
--p2p.listen.udp=9223 \
--p2p.priv.raw=604557d042fbea9ed42f46c0c95c346a932b6a5ef0c0dd07a00dbf95801a2510 \
--p2p.peerstore.path=/data/p2p/opnode_peerstore_db \
--p2p.discovery.path=/data/p2p/opnode_discovery_db \
--p2p.static=/dns4/op-seq/tcp/9223/p2p/16Uiu2HAkzHdkbmS2VrCsccLibsu7MvGHpmFUMJnMTkKifrtS5m65 \
--p2p.no-discovery \
--rpc.enable-admin=true \
--l1="$L1_RPC_URL_IN_DOCKER" \
--l1.beacon="$L1_BEACON_URL_IN_DOCKER" \
--l1.rpckind=standard \
--safedb.path=/data/safedb
21 changes: 21 additions & 0 deletions test/entrypoint/reth-rpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

L2_RPC_URL_IN_DOCKER="${L2_RPC_URL_IN_DOCKER:-http://op-geth-seq:8545}"

exec op-reth node -vvvvv \
--datadir=/datadir \
--chain=/genesis.json \
--http \
--http.port=8545 \
--http.addr=0.0.0.0 \
--http.api=admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev \
--ws \
--ws.addr=0.0.0.0 \
--ws.port=7546 \
--ws.api=admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev \
--authrpc.addr=0.0.0.0 \
--authrpc.port=8552 \
--authrpc.jwtsecret=/jwt.txt \
--rollup.sequencer-http="$L2_RPC_URL_IN_DOCKER"
9 changes: 7 additions & 2 deletions test/example.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
OP_GETH_IMAGE_TAG=op-geth:v1.101511.0-patch
OP_RETH_IMAGE_TAG=op-reth:v1.7.0.3
OP_STACK_IMAGE_TAG=op-stack:v1.13.4
OP_CONTRACTS_IMAGE_TAG=op-contracts:v1.13.4

Expand Down Expand Up @@ -52,9 +53,13 @@ WITHDRAWAL_DELAY_SECONDS=$MAX_CLOCK_DURATION

# TODO: use real fork block and parent hash in xlayer erigon
FORK_BLOCK=8593920
# 0x6912fea590fd46ca6a63ec02c6733f6ffb942b84cdf86f7894c21e1757a1f68a
# 0x0000000000000000000000000000000000000000000000000000000000000000
PARENT_HASH="0x6912fea590fd46ca6a63ec02c6733f6ffb942b84cdf86f7894c21e1757a1f68a"

DB_ENGINE="pebble"

CONDUCTOR_ENABLED=true
LAUNCH_RPC_NODE=false
CONDUCTOR_ENABLED=false
LAUNCH_RPC_NODE=true

USE_RETH=true