Add Optimism Fixturenet stack (#266)

* Initial version

* Update readme

* Build op-geth container

* Add optimism go code containers

* Add optimism contracts container

* Update optimism contracts container build

* Add fixturenet-optimism-contracts service to deploy L1 contracts

* Add fixturenet-optimism op-node and op-geth

* Avoid reading addresses from a file when sending balances

* Fixes for running op-geth container

* Fix image name and command in optimism-contracts service

* Add a healthcheck to lighthouse bootnode to avoid failing eth txs

* Avoid using hardhat ethers to send balances from an account

* Update script to send balance to L1 bridge proxy contract

* Implement op-node container

* Wait for a finalized L1 block to exist

* Fix for running op-batcher

* Add a todo for restart support

* Integrate optimism-contracts service and update instructions

* Update clean-up to remove docker volumes

* Update volume access permissions

* Add a todo to replace foundry usage with web3 js

* Add known issues

* Fix README

* Fix indentation

* Update known issues

---------

Co-authored-by: David Boreham <david@bozemanpas.com>
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
Former-commit-id: fc522140ba
This commit is contained in:
prathamesh0
2023-04-03 12:33:47 +05:30
committed by GitHub
co-authored by David Boreham dboreham nabarun
parent 21d6e33dab
commit 1881554ae0
23 changed files with 599 additions and 3 deletions
@@ -24,6 +24,8 @@ services:
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
image: cerc/fixturenet-eth-geth:local
volumes:
- fixturenet-geth-accounts:/opt/testnet/build/el
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "8545"]
interval: 30s
@@ -56,6 +58,12 @@ services:
environment:
RUN_BOOTNODE: "true"
image: cerc/fixturenet-eth-lighthouse:local
healthcheck:
test: ["CMD", "/scripts/status-internal.sh"]
interval: 10s
timeout: 100s
retries: 3
start_period: 15s
fixturenet-eth-lighthouse-1:
hostname: fixturenet-eth-lighthouse-1
@@ -79,7 +87,7 @@ services:
condition: service_healthy
ports:
- "8001"
fixturenet-eth-lighthouse-2:
hostname: fixturenet-eth-lighthouse-2
healthcheck:
@@ -101,3 +109,6 @@ services:
condition: service_started
fixturenet-eth-geth-2:
condition: service_healthy
volumes:
fixturenet-geth-accounts:
@@ -0,0 +1,97 @@
version: '3.7'
services:
fixturenet-optimism-contracts:
hostname: fixturenet-optimism-contracts
image: cerc/optimism-contracts:local
depends_on:
fixturenet-eth-geth-1:
condition: service_healthy
fixturenet-eth-bootnode-lighthouse:
condition: service_healthy
environment:
CHAIN_ID: 1212
L1_RPC: "http://fixturenet-eth-geth-1:8545"
command: "./run.sh"
volumes:
- ../config/fixturenet-optimism/optimism-contracts/rekey-json.ts:/app/packages/contracts-bedrock/tasks/rekey-json.ts
- ../config/fixturenet-optimism/optimism-contracts/send-balance.ts:/app/packages/contracts-bedrock/tasks/send-balance.ts
- ../config/fixturenet-optimism/optimism-contracts/update-config.js:/app/packages/contracts-bedrock/update-config.js
- ../config/fixturenet-optimism/optimism-contracts/run.sh:/app/packages/contracts-bedrock/run.sh
- fixturenet-geth-accounts:/geth-accounts:ro
- l2-accounts:/l2-accounts
- l1-deployment:/app/packages/contracts-bedrock
op-node-l2-config-gen:
image: cerc/optimism-op-node:local
depends_on:
fixturenet-optimism-contracts:
condition: service_completed_successfully
environment:
L1_RPC: "http://fixturenet-eth-geth-1:8545"
volumes:
- ../config/fixturenet-optimism/generate-l2-config.sh:/app/generate-l2-config.sh
- l1-deployment:/contracts-bedrock:ro
- op_node_data:/app
command: ["sh", "/app/generate-l2-config.sh"]
op-geth:
image: cerc/optimism-l2geth:local
depends_on:
op-node-l2-config-gen:
condition: service_started
volumes:
- ../config/fixturenet-optimism/run-op-geth.sh:/run-op-geth.sh
- op_node_data:/op-node:ro
- l2-accounts:/l2-accounts:ro
entrypoint: "sh"
command: "/run-op-geth.sh"
ports:
- "8545"
healthcheck:
test: ["CMD", "nc", "-vz", "localhost:8545"]
interval: 30s
timeout: 10s
retries: 10
start_period: 10s
op-node:
environment:
L1_RPC: "http://fixturenet-eth-geth-1:8545"
depends_on:
op-geth:
condition: service_healthy
image: cerc/optimism-op-node:local
volumes:
- ../config/fixturenet-optimism/run-op-node.sh:/app/run-op-node.sh
- op_node_data:/app:ro
- l2-accounts:/l2-accounts:ro
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:
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
- l2-accounts:/l2-accounts:ro
entrypoint: "sh"
command: "/run-op-batcher.sh"
volumes:
op_node_data:
l2-accounts:
l1-deployment: