Implement op-node container

This commit is contained in:
nabarun 2023-03-31 13:39:31 +05:30
parent caa0a36e48
commit 0fa42a92e9
4 changed files with 50 additions and 4 deletions

View File

@ -70,6 +70,31 @@ services:
# TODO: Integrate
- ../test/l2-accounts:/l2-accounts
command: ["sh", "/app/run-op-node.sh"]
ports:
- "8547"
healthcheck:
test: ["CMD", "nc", "-vz", "localhost:8547"]
interval: 30s
timeout: 10s
retries: 10
start_period: 10s
op-batcher:
environment:
# TODO: Integrate
L1_RPC: "http://fixturenet-eth-geth-1:8545"
depends_on:
op-node:
condition: service_healthy
op-geth:
condition: service_healthy
image: cerc/optimism-op-batcher:local
volumes:
- ../config/fixturenet-optimism/run-op-batcher.sh:/run-op-batcher.sh
# TODO: Integrate
- ../test/l2-accounts:/l2-accounts
entrypoint: "sh"
command: "/run-op-batcher.sh"
volumes:
op_node_data:

View File

@ -0,0 +1,21 @@
#!/bin/sh
set -e
# Get BACTHER_KEY from keys.json
BATCHER_KEY=$(jq -r '.Batcher.privateKey' /l2-accounts/keys.json | tr -d '"')
op-batcher \
--l2-eth-rpc=http://op-geth:8545 \
--rollup-rpc=http://op-node:8547 \
--poll-interval=1s \
--sub-safety-margin=6 \
--num-confirmations=1 \
--safe-abort-nonce-too-low-count=3 \
--resubmission-timeout=30s \
--rpc.addr=0.0.0.0 \
--rpc.port=8548 \
--rpc.enable-admin \
--max-channel-duration=1 \
--target-l1-tx-size-bytes=2048 \
--l1-eth-rpc=$L1_RPC \
--private-key=$BATCHER_KEY

View File

@ -2,15 +2,15 @@
set -e
# Get SEQUENCER KEY from keys.json
SEQUENCER_KEY=`jq '.Sequencer.privateKey' /l2-accounts/keys.json`
SEQUENCER_KEY=$(jq -r '.Sequencer.privateKey' /l2-accounts/keys.json | tr -d '"')
op-node \
--l2=http://op-geth:8551 \
--l2.jwt-secret=./jwt.txt \
--l2.jwt-secret=/app/jwt.txt \
--sequencer.enabled \
--sequencer.l1-confs=3 \
--verifier.l1-confs=3 \
--rollup.config=./rollup.json \
--rollup.config=/app/rollup.json \
--rpc.addr=0.0.0.0 \
--rpc.port=8547 \
--p2p.disable \

View File

@ -23,7 +23,7 @@ RUN make op-node VERSION="$VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH
FROM alpine:3.15
RUN apk add --no-cache openssl
RUN apk add --no-cache openssl jq
COPY --from=builder /app/op-node/bin/op-node /usr/local/bin