forked from cerc-io/stack-orchestrator
Add ability to run Optimism fixturenet with external L1 endpoint (#273)
* Remove unnecessary todos * Set option to log commands in shell scripts * Replace fixturenet-eth dependency with wait on endpoint * Skip lighthouse node dependency check * Update all services in the stack * Use debug flag to enable shell commands logging * Add bash in op-batcher container * Update mobymask-v2 instructions * Update fixturenet-optimism instructions * Add descriptions for services * Move ts files to container-build * Take L1 RPC endpoint from the env file * Add dev mode restriction for editing env file
This commit is contained in:
@@ -8,12 +8,15 @@ Clone required repositories:
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-optimism setup-repositories
|
||||
|
||||
# Exclude cerc-io/go-ethereum repository if running L1 separately
|
||||
laconic-so --stack fixturenet-optimism setup-repositories --exclude cerc-io/go-ethereum
|
||||
```
|
||||
|
||||
Checkout to the required versions and branches in repos:
|
||||
|
||||
```bash
|
||||
# optimism
|
||||
# Optimism
|
||||
cd ~/cerc/optimism
|
||||
git checkout @eth-optimism/sdk@0.0.0-20230329025055
|
||||
```
|
||||
@@ -22,6 +25,9 @@ Build the container images:
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-optimism build-containers
|
||||
|
||||
# Only build containers required for L2 if running L1 separately
|
||||
laconic-so --stack fixturenet-optimism build-containers --include cerc/foundry,cerc/optimism-contracts,cerc/optimism-op-node,cerc/optimism-l2geth,cerc/optimism-op-batcher
|
||||
```
|
||||
|
||||
This should create the required docker images in the local image registry:
|
||||
@@ -37,19 +43,36 @@ This should create the required docker images in the local image registry:
|
||||
|
||||
## Deploy
|
||||
|
||||
(Optional) Update the [l1-params.env](../../config/fixturenet-optimism/l1-params.env) file with L1 endpoint (`L1_RPC`, `L1_HOST` and `L1_PORT`) and other params if running L1 separately
|
||||
|
||||
* NOTE:
|
||||
* Stack Orchestrator needs to be run in [`dev`](/docs/CONTRIBUTING.md#install-developer-mode) mode to be able to edit the env file
|
||||
* If L1 is running on the host machine, use `host.docker.internal` as the hostname to access the host port
|
||||
|
||||
Deploy the stack:
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-optimism deploy up
|
||||
|
||||
# Only start fixturenet-optimism pod (L2) if running L1 separately
|
||||
laconic-so --stack fixturenet-optimism deploy up --include fixturenet-optimism
|
||||
```
|
||||
|
||||
To list down the running containers:
|
||||
The `fixturenet-optimism-contracts` service may take a while (`~15 mins`) to complete running as it:
|
||||
1. waits for the 'Merge' to happen on L1
|
||||
2. waits for a finalized block to exist on L1 (so that it can be taken as a starting block for roll ups)
|
||||
3. deploys the L1 contracts
|
||||
|
||||
To list down and monitor the running containers:
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-optimism deploy ps
|
||||
|
||||
# With status
|
||||
docker ps
|
||||
|
||||
# Check logs for a container
|
||||
docker logs -f <CONTAINER_ID>
|
||||
```
|
||||
|
||||
## Clean up
|
||||
@@ -58,23 +81,24 @@ Stop all services running in the background:
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-optimism deploy down
|
||||
|
||||
# If only ran fixturenet-optimism pod (L2)
|
||||
laconic-so --stack fixturenet-optimism deploy down --include fixturenet-optimism
|
||||
```
|
||||
|
||||
Remove volumes created by this stack:
|
||||
Clear volumes created by this stack:
|
||||
|
||||
```bash
|
||||
docker volume ls
|
||||
# List all relevant volumes
|
||||
docker volume ls -q --filter name=laconic*
|
||||
|
||||
docker volume rm laconic-d527651bba3cb61886b36a7400bd2a38_fixturenet-geth-accounts
|
||||
docker volume rm laconic-d527651bba3cb61886b36a7400bd2a38_l1-deployment
|
||||
docker volume rm laconic-d527651bba3cb61886b36a7400bd2a38_l2-accounts
|
||||
docker volume rm laconic-d527651bba3cb61886b36a7400bd2a38_op_node_data
|
||||
# Remove all the listed volumes
|
||||
docker volume rm $(docker volume ls -q --filter name=laconic*)
|
||||
```
|
||||
|
||||
## Known Issues
|
||||
|
||||
* Currently not supported:
|
||||
* Stopping and restarting the stack from where it left off; currently starts fresh on a restart
|
||||
* Pointing Optimism (L2) to external L1 endpoint to allow running only L2 services
|
||||
* Resource requirements (memory + time) for building `cerc/foundry` image are on the higher side
|
||||
* `cerc/optimism-contracts` image is currently based on `cerc/foundry` (Optimism requires foundry installation)
|
||||
|
||||
@@ -13,9 +13,9 @@ containers:
|
||||
- cerc/fixturenet-eth-lighthouse
|
||||
- cerc/foundry
|
||||
- cerc/optimism-contracts
|
||||
- cerc/optimism-op-node
|
||||
- cerc/optimism-l2geth
|
||||
- cerc/optimism-op-batcher
|
||||
- cerc/optimism-op-node
|
||||
pods:
|
||||
- fixturenet-eth
|
||||
- fixturenet-optimism
|
||||
|
||||
Reference in New Issue
Block a user