Skip to content

feat: add l2geth to docker-compose test setup #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
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
22 changes: 22 additions & 0 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@ services:
- ./volumes/l2reth:/l2reth
networks:
- scroll-network
restart: unless-stopped

l2geth:
image: scrolltech/l2geth:scroll-v5.8.64
platform: linux/amd64
container_name: l2geth
entrypoint: ["bash", "/launch_l2geth.bash"]
env_file:
- .env
ports:
- "8547:8545" # JSON-RPC
- "8548:8546" # WebSocket
- "6061:6060" # Metrics
volumes:
- ./resource/genesis-dev.json:/genesis-dev.json:ro
- ./launch_l2geth.bash:/launch_l2geth.bash:ro
- ./volumes/l2geth:/l2geth
networks:
- scroll-network
restart: unless-stopped

prometheus:
image: prom/prometheus:v3.3.1
Expand All @@ -58,6 +78,7 @@ services:
- scroll-network
depends_on:
- rollup-node
restart: unless-stopped

grafana:
image: grafana/grafana:12.0.2
Expand All @@ -79,6 +100,7 @@ services:
- scroll-network
depends_on:
- prometheus
restart: unless-stopped

networks:
scroll-network:
Expand Down
48 changes: 48 additions & 0 deletions docker-compose/launch_l2geth.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -e

wait_for_l1_devnet() {
while ! curl -s http://l1-devnet:8545 > /dev/null; do
echo "l1-devnet not ready, retrying in 2s..."
sleep 2
done
}

# Dev network follower node.
if [ "${ENV:-}" = "dev" ]; then
geth init --datadir=/l2geth /genesis-dev.json
echo "l2geth dev mode not configured yet"
exit 1

# Scroll Sepolia follower node.
elif [ "${ENV:-}" = "sepolia" ]; then
if [ "${SHADOW_FORK}" = "true" ]; then
wait_for_l1_devnet
L1_ENDPOINT="http://l1-devnet:8545"
else
L1_ENDPOINT="http://l1reth-rpc.sepolia.scroll.tech:8545"
fi
exec geth --scroll-sepolia --scroll-mpt --datadir=/l2geth \
--port 30303 --syncmode full \
--http --http.addr 0.0.0.0 --http.port 8545 --http.vhosts "*" --http.corsdomain "*" --http.api "eth,scroll,net,web3,debug" \
--ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.api "eth,scroll,net,web3,debug" \
--pprof --pprof.addr 0.0.0.0 --pprof.port 6060 --metrics \
--gcmode archive --cache.noprefetch --cache.snapshot=0 --snapshot=false \
--l1.endpoint "$L1_ENDPOINT" --l1.confirmations finalized --l1.sync.startblock 4038000

# Scroll Mainnet follower node.
elif [ "${ENV:-}" = "mainnet" ]; then
if [ "${SHADOW_FORK}" = "true" ]; then
wait_for_l1_devnet
L1_ENDPOINT="http://l1-devnet:8545"
else
L1_ENDPOINT="http://l1reth-rpc.mainnet.scroll.tech:8545"
fi
exec geth --scroll --scroll-mpt --datadir=/l2geth \
--port 30303 --syncmode full \
--http --http.addr 0.0.0.0 --http.port 8545 --http.vhosts "*" --http.corsdomain "*" --http.api "eth,scroll,net,web3,debug" \
--ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.api "eth,scroll,net,web3,debug" \
--pprof --pprof.addr 0.0.0.0 --pprof.port 6060 --metrics \
--gcmode archive --cache.noprefetch --cache.snapshot=0 --snapshot=false \
--l1.endpoint "$L1_ENDPOINT" --l1.confirmations finalized --l1.sync.startblock 18306000
fi
131 changes: 131 additions & 0 deletions docker-compose/resource/genesis-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"config": {
"chainId": 1337,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"londonBlock": 0,
"archimedesBlock": 0,
"shanghaiBlock": 0,
"bernoulliBlock": 0,
"curieBlock": 0,
"darwinTime": 0,
"darwinV2Time": 0,
"euclidTime": 0,
"euclidV2Time": 0,
"feynmanTime": 0,
"systemContract": {
"period": 1,
"system_contract_address": "0x55B150d210356452e4E79cCb6B778b4e1B167091",
"system_contract_slot": "0x0000000000000000000000000000000000000000000000000000000000000067"
},
"scroll": {
"useZktrie": false,
"maxTxPerBlock": 100,
"maxTxPayloadBytesPerBlock": 122880,
"feeVaultAddress": "0x5300000000000000000000000000000000000005",
"l1Config": {
"l1ChainId": "22222222",
"l1MessageQueueAddress": "0x0000000000000000000000000000000000000001",
"l1MessageQueueV2Address": "0x160dd98613ba6C6E0a14086a87cf36244558422E",
"l1MessageQueueV2DeploymentBlock": 0,
"scrollChainAddress": "0x84044d3a645843bAF0752eA591E1EAB643beD904",
"l2SystemConfigAddress": "0x2E48aC0df81f1fa57722e115e807C9dB1819bA13",
"numL1MessagesPerBlock": "10"
},
"genesisStateRoot": "0x08d535cc60f40af5dd3b31e0998d7567c2d568b224bed2ba26070aeb078d1339",
"missingHeaderFieldsSHA256": "0x9062e2fa1200dca63bee1d18d429572f134f5f0c98cb4852f62fc394e33cf6e6"
}
},
"nonce": "0x0",
"timestamp": "0x6490fdd2",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"difficulty": "0x0",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x90F79bf6EB2c4f870365E785982E1f101E93b906": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x976EA74026E726554dB657fA54763abd0C3a0aa9": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x14dC79964da2C08b23698B3D3cc7Ca32193d9955": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0xa0Ee7A142d267C1f36714E4a8F75612F20a79720": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0xBcd4042DE499D14e55001CcbB24a551F3b954096": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0xFABB0ac9d68B0B445fB7357272Ff202C5651694a": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0xcd3B766CCDd6AE721141F452C550Ca635964ce71": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x2546BcD3c84621e976D8185a91A922aE77ECEc30": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0xbDA5747bFD65F08deb54cb465eB87D40e51B197E": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0xdD2FD4581271e230360230F9337D5c0430Bf44C0": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199": {
"balance": "0xD3C21BCECCEDA1000000"
},
"0x5300000000000000000000000000000000000002": {
"balance": "0xd3c21bcecceda1000000",
"storage": {
"0x01": "0x000000000000000000000000000000000000000000000000000000003758e6b0",
"0x02": "0x0000000000000000000000000000000000000000000000000000000000000038",
"0x03": "0x000000000000000000000000000000000000000000000000000000003e95ba80",
"0x04": "0x0000000000000000000000005300000000000000000000000000000000000003",
"0x05": "0x000000000000000000000000000000000000000000000000000000008390c2c1",
"0x06": "0x00000000000000000000000000000000000000000000000000000069cf265bfe",
"0x07": "0x00000000000000000000000000000000000000000000000000000000168b9aa3"
}
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}