Take L1 RPC endpoint from the env file

This commit is contained in:
Prathamesh Musale 2023-04-04 12:49:58 +05:30
parent 110e0eee4d
commit 68eb8482cc
10 changed files with 16 additions and 26 deletions

View File

@ -8,12 +8,12 @@ services:
hostname: fixturenet-optimism-contracts
image: cerc/optimism-contracts:local
env_file:
- ../config/fixturenet-optimism/.env
- ../config/fixturenet-optimism/l1-params.env
# Waits for L1 endpoint to be up before running the script
command: |
"./wait-for-it.sh -h $${L1_HOST} -p $${L1_PORT} -s -t 60 -- ./run.sh"
volumes:
- ../config/fixturenet-optimism/wait-for-it.sh:/app/packages/contracts-bedrock/wait-for-it.sh
- ../config/wait-for-it.sh:/app/packages/contracts-bedrock/wait-for-it.sh
- ../container-build/cerc-optimism-contracts/hardhat-tasks/rekey-json.ts:/app/packages/contracts-bedrock/tasks/rekey-json.ts
- ../container-build/cerc-optimism-contracts/hardhat-tasks/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
@ -31,7 +31,7 @@ services:
fixturenet-optimism-contracts:
condition: service_completed_successfully
env_file:
- ../config/fixturenet-optimism/.env
- ../config/fixturenet-optimism/l1-params.env
volumes:
- ../config/fixturenet-optimism/generate-l2-config.sh:/app/generate-l2-config.sh
- l1_deployment:/contracts-bedrock:ro
@ -64,7 +64,7 @@ services:
# Runs the L2 consensus client (Sequencer node)
op-node:
env_file:
- ../config/fixturenet-optimism/.env
- ../config/fixturenet-optimism/l1-params.env
depends_on:
op-geth:
condition: service_healthy
@ -88,7 +88,7 @@ services:
# Runs the batcher (takes transactions from the Sequencer and publishes them to L1)
op-batcher:
env_file:
- ../config/fixturenet-optimism/.env
- ../config/fixturenet-optimism/l1-params.env
depends_on:
op-node:
condition: service_healthy
@ -96,7 +96,7 @@ services:
condition: service_healthy
image: cerc/optimism-op-batcher:local
volumes:
- ../config/fixturenet-optimism/wait-for-it.sh:/wait-for-it.sh
- ../config/wait-for-it.sh:/wait-for-it.sh
- ../config/fixturenet-optimism/run-op-batcher.sh:/run-op-batcher.sh
- l2_accounts:/l2-accounts:ro
entrypoint: ["sh", "-c"]

View File

@ -4,8 +4,6 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
export L1_RPC="http://${L1_HOST}:${L1_PORT}"
op-node genesis l2 \
--deploy-config /contracts-bedrock/deploy-config/getting-started.json \
--deployment-dir /contracts-bedrock/deployments/getting-started/ \

View File

@ -1,4 +1,5 @@
# Change if pointing to an external L1 endpoint
L1_RPC="http://fixturenet-eth-geth-1:8545"
L1_CHAIN_ID=1212
L1_HOST="fixturenet-eth-geth-1"
L1_PORT=8545

View File

@ -11,7 +11,6 @@ fi
# exit 0
# fi
export L1_RPC="http://${L1_HOST}:${L1_PORT}"
echo "Using L1 RPC endpoint ${L1_RPC}"
# Append tasks/index.ts file

View File

@ -4,8 +4,6 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
export L1_RPC="http://${L1_HOST}:${L1_PORT}"
# Get BACTHER_KEY from keys.json
BATCHER_KEY=$(jq -r '.Batcher.privateKey' /l2-accounts/keys.json | tr -d '"')

View File

@ -4,8 +4,6 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
export L1_RPC="http://${L1_HOST}:${L1_PORT}"
# Get SEQUENCER KEY from keys.json
SEQUENCER_KEY=$(jq -r '.Sequencer.privateKey' /l2-accounts/keys.json | tr -d '"')

View File

@ -43,8 +43,8 @@ This should create the required docker images in the local image registry:
## Deploy
(Optional) Update the [.env](../../config/fixturenet-optimism/.env) file with L1 endpoint (`L1_HOST` and `L1_PORT`) and other params if running L1 separately
* NOTE: If L1 is running on the host machine, use `host.docker.internal` as `L1_HOST` to access the host port
(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: If L1 is running on the host machine, use `host.docker.internal` as the hostname to access the host port
Deploy the stack:

View File

@ -65,13 +65,15 @@ Deploy the stack:
## Tests
Find the watcher container's id:
Find the watcher container's id and export it for later use:
```bash
laconic-so --stack mobymask-v2 deploy-system ps | grep "mobymask-watcher-server"
export CONTAINER_ID=<CONTAINER_ID>
```
Example output
Example output:
```
id: 5d3aae4b22039fcd1c9b18feeb91318ede1100581e75bb5ac54f9e436066b02c, name: laconic-bfb01caf98b1b8f7c8db4d33f11b905a-mobymask-watcher-server-1, ports: 0.0.0.0:3001->3001/tcp, 0.0.0.0:9001->9001/tcp, 0.0.0.0:9090->9090/tcp
@ -79,12 +81,6 @@ id: 5d3aae4b22039fcd1c9b18feeb91318ede1100581e75bb5ac54f9e436066b02c, name: laco
In above output the container ID is `5d3aae4b22039fcd1c9b18feeb91318ede1100581e75bb5ac54f9e436066b02c`
Export it for later use:
```bash
export CONTAINER_ID=<CONTAINER_ID>
```
Run the peer tests:
```bash

View File

@ -12,11 +12,11 @@
laconic-bfb01caf98b1b8f7c8db4d33f11b905a-mobymask-1 | http://127.0.0.1:3002/#/members?invitation=%7B%22v%22%3A1%2C%22signedDelegations%22%3A%5B%7B%22signature%22%3A%220x7559bd412f02677d60820e38243acf61547f79339395a34f7d4e1630e645aeb30535fc219f79b6fbd3af0ce3bd05132ad46d2b274a9fbc4c36bc71edd09850891b%22%2C%22delegation%22%3A%7B%22delegate%22%3A%220xc0838c92B2b71756E0eAD5B3C1e1F186baeEAAac%22%2C%22authority%22%3A%220x0000000000000000000000000000000000000000000000000000000000000000%22%2C%22caveats%22%3A%5B%7B%22enforcer%22%3A%220x558024C7d593B840E1BfD83E9B287a5CDad4db15%22%2C%22terms%22%3A%220x0000000000000000000000000000000000000000000000000000000000000000%22%7D%5D%7D%7D%5D%2C%22key%22%3A%220x98da9805821f1802196443e578fd32af567bababa0a249c07c82df01ecaa7d8d%22%7D
```
* Open the invite link in browser to use the mobymask-app.
* Open the invite link in a browser to use the mobymask-app.
NOTE: Before opening the invite link, clear the browser cache (local storage) for http://127.0.0.1:3002 to remove old invitations
* In the debug panel, check if it is connected to the p2p network (it should be connected to atleast one other peer for pubsub to work).
* In the debug panel, check if it is connected to the p2p network (it should be connected to at least one other peer for pubsub to work).
* Create an invite link in the app by clicking on `Create new invite link` button.
@ -94,7 +94,7 @@
}
```
It should return true for reported phisher names.
It should return `true` for reported phisher names.
* Watcher internally is using L2 chain `eth_getStorageAt` method.