Fixes for running op-geth container
This commit is contained in:
parent
abb868eaf0
commit
5bf01a587e
@ -27,11 +27,11 @@ services:
|
||||
L1_RPC: "http://fixturenet-eth-geth-1:8545"
|
||||
image: cerc/optimism-op-node:local
|
||||
volumes:
|
||||
- ../config/fixturenet-optimism/generate-l2-config.sh:/app/op-node/generate-l2-config.sh
|
||||
- ../config/fixturenet-optimism/generate-l2-config.sh:/app/generate-l2-config.sh
|
||||
# TODO: Integrate
|
||||
- ../test/contracts-bedrock:/app/packages/contracts-bedrock
|
||||
- op_node_data:/app/op-node
|
||||
command: ["sh", "generate-l2-config.sh"]
|
||||
- ../test/contracts-bedrock:/contracts-bedrock
|
||||
- op_node_data:/app
|
||||
command: ["sh", "/app/generate-l2-config.sh"]
|
||||
|
||||
op-geth:
|
||||
image: cerc/optimism-l2geth:local
|
||||
@ -48,11 +48,11 @@ services:
|
||||
ports:
|
||||
- "8545"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-v", "http://localhost:8545"]
|
||||
test: ["CMD", "nc", "-vz", "localhost:8545"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
start_period: 10s
|
||||
|
||||
op-node:
|
||||
environment:
|
||||
@ -63,11 +63,11 @@ services:
|
||||
condition: service_healthy
|
||||
image: cerc/optimism-op-node:local
|
||||
volumes:
|
||||
- ../config/fixturenet-optimism/run-op-node.sh:/app/op-node/run-op-node.sh
|
||||
- op_node_data:/app/op-node
|
||||
- ../config/fixturenet-optimism/run-op-node.sh:/app/run-op-node.sh
|
||||
- op_node_data:/app
|
||||
# TODO: Integrate
|
||||
- ../test/l2-accounts:/l2-accounts
|
||||
command: ["sh", "run-op-node.sh"]
|
||||
command: ["sh", "/app/run-op-node.sh"]
|
||||
|
||||
volumes:
|
||||
op_node_data:
|
||||
|
@ -1,14 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
go run cmd/main.go genesis l2 \
|
||||
--deploy-config ../packages/contracts-bedrock/deploy-config/getting-started.json \
|
||||
--deployment-dir ../packages/contracts-bedrock/deployments/getting-started/ \
|
||||
--outfile.l2 genesis.json \
|
||||
--outfile.rollup rollup.json \
|
||||
op-node genesis l2 \
|
||||
--deploy-config /contracts-bedrock/deploy-config/getting-started.json \
|
||||
--deployment-dir /contracts-bedrock/deployments/getting-started/ \
|
||||
--outfile.l2 /app/genesis.json \
|
||||
--outfile.rollup /app/rollup.json \
|
||||
--l1-rpc $L1_RPC
|
||||
|
||||
openssl rand -hex 32 > jwt.txt
|
||||
|
||||
cat genesis.json
|
||||
cat jwt.txt
|
||||
openssl rand -hex 32 > /app/jwt.txt
|
||||
|
@ -5,13 +5,17 @@ mkdir datadir
|
||||
|
||||
echo "pwd" > datadir/password
|
||||
|
||||
# TODO: Add in container build or use other tool
|
||||
echo "installing jq"
|
||||
apk update && apk add jq
|
||||
|
||||
# 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 '"')
|
||||
echo $SEQUENCER_KEY > datadir/block-signer-key
|
||||
|
||||
geth account import --datadir=datadir --password=datadir/password datadir/block-signer-key
|
||||
|
||||
while [ ! -f "/op-node/jwt.tx" ]
|
||||
while [ ! -f "/op-node/jwt.txt" ]
|
||||
do
|
||||
echo "Config files not created. Checking after 5 seconds."
|
||||
sleep 5
|
||||
@ -22,7 +26,7 @@ echo "Config files created by op-node, proceeding with script..."
|
||||
cp /op-node/genesis.json ./
|
||||
geth init --datadir=datadir genesis.json
|
||||
|
||||
SEQUENCER_ADDRESS=`jq '.Sequencer.address' /l2-accounts/keys.json`
|
||||
SEQUENCER_ADDRESS=$(jq -r '.Sequencer.address' /l2-accounts/keys.json | tr -d '"')
|
||||
echo "SEQUENCER_ADDRESS: ${SEQUENCER_ADDRESS}"
|
||||
cp /op-node/jwt.txt ./
|
||||
geth \
|
||||
|
@ -23,6 +23,8 @@ RUN make op-node VERSION="$VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH
|
||||
|
||||
FROM alpine:3.15
|
||||
|
||||
RUN apk add --no-cache openssl
|
||||
|
||||
COPY --from=builder /app/op-node/bin/op-node /usr/local/bin
|
||||
|
||||
CMD ["op-node"]
|
||||
|
Loading…
Reference in New Issue
Block a user