Compare commits
13 Commits
f4dec3520f
...
c1b72e9054
Author | SHA1 | Date | |
---|---|---|---|
c1b72e9054 | |||
f6cc95cd34 | |||
c7ca93417c | |||
4b01f3de72 | |||
b545868a97 | |||
d66b2b0d71 | |||
bf594011fb | |||
e7baf0bf08 | |||
133e9d5da2 | |||
14e4a725d6 | |||
c38c01ef6f | |||
789ca9d7a9 | |||
d7329cae04 |
@ -10,16 +10,14 @@ services:
|
||||
- ../config/fixturenet-optimism/l1-params.env
|
||||
- ../config/fixturenet-optimism/l2-params.env
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_L1_CHAIN_ID: ${CERC_L1_CHAIN_ID}
|
||||
CERC_L1_RPC: ${CERC_L1_RPC}
|
||||
CERC_L1_ACCOUNTS_CSV_URL: ${CERC_L1_ACCOUNTS_CSV_URL}
|
||||
CERC_L1_ADDRESS: ${CERC_L1_ADDRESS}
|
||||
CERC_L1_PRIV_KEY: ${CERC_L1_PRIV_KEY}
|
||||
CERC_L1_BLOCK_TIME: ${CERC_L1_BLOCK_TIME}
|
||||
CERC_L2_BLOCK_TIME: ${CERC_L2_BLOCK_TIME}
|
||||
CERC_PROPOSER_AMOUNT: ${CERC_PROPOSER_AMOUNT}
|
||||
CERC_BATCHER_AMOUNT: ${CERC_BATCHER_AMOUNT}
|
||||
- CERC_SCRIPT_DEBUG
|
||||
- CERC_L1_CHAIN_ID
|
||||
- CERC_L1_RPC
|
||||
- CERC_L1_ACCOUNTS_CSV_URL
|
||||
- CERC_L1_ADDRESS
|
||||
- CERC_L1_PRIV_KEY
|
||||
- CERC_L1_BLOCK_TIME
|
||||
- CERC_L2_BLOCK_TIME
|
||||
volumes:
|
||||
- ../config/network/wait-for-it.sh:/wait-for-it.sh
|
||||
- ../config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh:/deploy-contracts.sh
|
||||
@ -51,8 +49,6 @@ services:
|
||||
- l2_config:/l2-config
|
||||
entrypoint: "bash"
|
||||
command: "/generate-l2-config.sh"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
# Initializes and runs the L2 execution client (outputs to volume l2_geth_data)
|
||||
op-geth:
|
||||
@ -93,11 +89,10 @@ services:
|
||||
env_file:
|
||||
- ../config/fixturenet-optimism/l1-params.env
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_L1_RPC: ${CERC_L1_RPC}
|
||||
CERC_L1_RPC_KIND: ${CERC_L1_RPC_KIND}
|
||||
CERC_L1_BLOCK_TIME: ${CERC_L1_BLOCK_TIME}
|
||||
CERC_L1_BEACON: ${CERC_L1_BEACON}
|
||||
- CERC_SCRIPT_DEBUG
|
||||
- CERC_L1_RPC
|
||||
- CERC_L1_RPC_KIND
|
||||
- CERC_L1_BLOCK_TIME
|
||||
volumes:
|
||||
- ../config/fixturenet-optimism/run-op-node.sh:/run-op-node.sh
|
||||
- l1_deployment:/l1-deployment:ro
|
||||
@ -157,10 +152,10 @@ services:
|
||||
env_file:
|
||||
- ../config/fixturenet-optimism/l1-params.env
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_L1_RPC: ${CERC_L1_RPC}
|
||||
CERC_L1_CHAIN_ID: ${CERC_L1_CHAIN_ID}
|
||||
CERC_L1_BLOCK_TIME: ${CERC_L1_BLOCK_TIME}
|
||||
- CERC_SCRIPT_DEBUG
|
||||
- CERC_L1_RPC
|
||||
- CERC_L1_CHAIN_ID
|
||||
- CERC_L1_BLOCK_TIME
|
||||
volumes:
|
||||
- ../config/network/wait-for-it.sh:/wait-for-it.sh
|
||||
- ../config/fixturenet-optimism/run-op-proposer.sh:/run-op-proposer.sh
|
||||
|
@ -14,13 +14,6 @@ l1_deployment_file="/l1-deployment/$DEPLOYMENT_CONTEXT-deploy.json"
|
||||
l2_allocs_file="/l2-config/allocs-l2.json"
|
||||
genesis_outfile="/l2-config/genesis.json"
|
||||
rollup_outfile="/l2-config/rollup.json"
|
||||
jwt_file="/l2-config/l2-jwt.txt"
|
||||
|
||||
# Create a JWT secret at shared path if not found
|
||||
if [ ! -f "$jwt_file" ]; then
|
||||
openssl rand -hex 32 > $jwt_file
|
||||
echo "Generated JWT secret at $jwt_file"
|
||||
fi
|
||||
|
||||
# Check if genesis.json and rollup.json already exist
|
||||
if [ -f "$genesis_outfile" ] && [ -f "$rollup_outfile" ]; then
|
||||
|
@ -16,6 +16,3 @@ DEFAULT_CERC_L1_RPC_KIND=standard
|
||||
# that are used to send balance to Optimism Proxy contract
|
||||
# (enables them to do transactions on L2)
|
||||
DEFAULT_CERC_L1_ACCOUNTS_CSV_URL="http://fixturenet-eth-bootnode-geth:9898/accounts.csv"
|
||||
DEFAULT_CERC_PROPOSER_AMOUNT="0.2ether"
|
||||
DEFAULT_CERC_BATCHER_AMOUNT="0.1ether"
|
||||
DEFAULT_CERC_L1_BEACON=http://fixturenet-eth-lighthouse-1:8001
|
@ -9,9 +9,6 @@ CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}"
|
||||
|
||||
CERC_L1_ACCOUNTS_CSV_URL="${CERC_L1_ACCOUNTS_CSV_URL:-${DEFAULT_CERC_L1_ACCOUNTS_CSV_URL}}"
|
||||
|
||||
CERC_PROPOSER_AMOUNT="${CERC_PROPOSER_AMOUNT:-${DEFAULT_CERC_PROPOSER_AMOUNT}}"
|
||||
CERC_BATCHER_AMOUNT="${CERC_BATCHER_AMOUNT:-${DEFAULT_CERC_BATCHER_AMOUNT}}"
|
||||
|
||||
export DEPLOYMENT_CONTEXT="$CERC_L1_CHAIN_ID"
|
||||
# Optional create2 salt for deterministic deployment of contract implementations
|
||||
export IMPL_SALT=$(openssl rand -hex 32)
|
||||
@ -19,7 +16,7 @@ export IMPL_SALT=$(openssl rand -hex 32)
|
||||
echo "Using L1 RPC endpoint ${CERC_L1_RPC}"
|
||||
|
||||
# Exit if a deployment already exists (on restarts)
|
||||
if [ -f "/l1-deployment/$DEPLOYMENT_CONTEXT-deploy.json" ]; then
|
||||
if [ -d "/l1-deployment/$DEPLOYMENT_CONTEXT-deploy.json" ]; then
|
||||
echo "Deployment directory /l1-deployment/$DEPLOYMENT_CONTEXT-deploy.json, checking OptimismPortal deployment"
|
||||
|
||||
OPTIMISM_PORTAL_ADDRESS=$(cat /l1-deployment/$DEPLOYMENT_CONTEXT-deploy.json | jq -r .OptimismPortal)
|
||||
@ -71,8 +68,9 @@ if [ -n "$CERC_L1_ADDRESS" ] && [ -n "$CERC_L1_PRIV_KEY" ]; then
|
||||
|
||||
echo "Funding accounts."
|
||||
wait_for_block 1 300
|
||||
cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value $CERC_PROPOSER_AMOUNT $PROPOSER --private-key $ADMIN_KEY
|
||||
cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value $CERC_BATCHER_AMOUNT $BATCHER --private-key $ADMIN_KEY
|
||||
cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value 5ether $PROPOSER --private-key $ADMIN_KEY
|
||||
cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value 10ether $BATCHER --private-key $ADMIN_KEY
|
||||
cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value 2ether $SEQ --private-key $ADMIN_KEY
|
||||
else
|
||||
curl -o accounts.csv $CERC_L1_ACCOUNTS_CSV_URL
|
||||
# Admin
|
||||
@ -178,5 +176,6 @@ echo "Copying deployment artifacts volume l1_deployment and deploy-config to vol
|
||||
cp /opt/optimism/packages/contracts-bedrock/deployments/$DEPLOYMENT_CONTEXT-deploy.json /l1-deployment
|
||||
cp /opt/optimism/packages/contracts-bedrock/deploy-config/$DEPLOYMENT_CONTEXT.json /l2-config
|
||||
cp allocs-l2.json /l2-config
|
||||
openssl rand -hex 32 > /l2-config/l2-jwt.txt
|
||||
|
||||
echo "Deployment successful, exiting."
|
||||
|
@ -7,7 +7,6 @@ fi
|
||||
CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}"
|
||||
CERC_L1_RPC_KIND="${CERC_L1_RPC_KIND:-${DEFAULT_CERC_L1_RPC_KIND}}"
|
||||
CERC_L1_BLOCK_TIME="${CERC_L1_BLOCK_TIME:-$DEFAULT_CERC_L1_BLOCK_TIME}"
|
||||
CERC_L1_BEACON="${CERC_L1_BEACON:-${DEFAULT_CERC_L1_BEACON}}"
|
||||
|
||||
log_level=INFO
|
||||
if [ -n "$CERC_LOG_LEVEL" ]; then
|
||||
@ -34,7 +33,7 @@ exec op-node \
|
||||
--p2p.sequencer.key="${SEQ_KEY#0x}" \
|
||||
--l1=$CERC_L1_RPC \
|
||||
--l1.rpckind=$CERC_L1_RPC_KIND \
|
||||
--l1.beacon=$CERC_L1_BEACON \
|
||||
--l1.beacon=http://fixturenet-eth-lighthouse-1:8001 \
|
||||
--l1.http-poll-interval="${CERC_L1_BLOCK_TIME}s" \
|
||||
--l1.epoch-poll-interval="$((CERC_L1_BLOCK_TIME * 32))s" \
|
||||
--log.level="$log_level"
|
||||
|
@ -112,15 +112,6 @@ Inside the `fixturenet-eth-deployment` deployment directory, open `config.env` f
|
||||
CERC_ALLOW_UNPROTECTED_TXS=true
|
||||
```
|
||||
|
||||
Inside the `fixturenet-optimism-deployment` deployment directory, open `config.env` file and set following env variables:
|
||||
|
||||
```bash
|
||||
# Optional
|
||||
# Funding amounts for proposer and batcher accounts on L1
|
||||
CERC_PROPOSER_AMOUNT= # Default 0.2ether
|
||||
CERC_BATCHER_AMOUNT= # Default 0.1ether
|
||||
```
|
||||
|
||||
## Start the stack
|
||||
|
||||
Start the deployment:
|
||||
|
@ -64,9 +64,6 @@ Inside the deployment directory, open the file `config.env` and add the followin
|
||||
CERC_L1_HOST=
|
||||
CERC_L1_PORT=
|
||||
|
||||
# External L1 Beacon node endpoint
|
||||
CERC_L1_BEACON=
|
||||
|
||||
# URL to get CSV with credentials for accounts on L1
|
||||
# that are used to send balance to Optimism Proxy contract
|
||||
# (enables them to do transactions on L2)
|
||||
@ -77,13 +74,6 @@ Inside the deployment directory, open the file `config.env` and add the followin
|
||||
# Other generated accounts will be funded from this account, so it should contain ~20 Eth
|
||||
CERC_L1_ADDRESS=
|
||||
CERC_L1_PRIV_KEY=
|
||||
|
||||
# Optional
|
||||
|
||||
# Funding amounts for proposer and batcher accounts on L1
|
||||
# (Accounts funded using the Admin account)
|
||||
CERC_PROPOSER_AMOUNT=
|
||||
CERC_BATCHER_AMOUNT=
|
||||
```
|
||||
|
||||
* NOTE: If L1 is running on the host machine, use `host.docker.internal` as the hostname to access the host port, or use the `ip a` command to find the IP address of the `docker0` interface (this will usually be something like `172.17.0.1` or `172.18.0.1`)
|
||||
|
Loading…
Reference in New Issue
Block a user