Add configuration for L1 beacon endpoint and funding amounts for Optimism accounts #4

Merged
nabarun merged 5 commits from deep-stack/fixturenet-optimism-stack:ag-configure-funding-amount into main 2024-09-03 09:42:09 +00:00
5 changed files with 15 additions and 14 deletions
Showing only changes of commit aebf4709db - Show all commits

View File

@ -17,8 +17,8 @@ services:
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_L2_PROPOSER_AMOUNT: ${CERC_L2_PROPOSER_AMOUNT}
CERC_L2_BATCHER_AMOUNT: ${CERC_L2_BATCHER_AMOUNT}
CERC_PROPOSER_AMOUNT: ${CERC_PROPOSER_AMOUNT}
CERC_BATCHER_AMOUNT: ${CERC_BATCHER_AMOUNT}
volumes:
- ../config/network/wait-for-it.sh:/app/packages/contracts-bedrock/wait-for-it.sh
- ../config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh:/app/packages/contracts-bedrock/deploy-contracts.sh

View File

@ -10,6 +10,6 @@ DEFAULT_CERC_L1_PORT=8545
# 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_L2_PROPOSER_AMOUNT="0.2ether"
DEFAULT_CERC_L2_BATCHER_AMOUNT="0.1ether"
DEFAULT_CERC_PROPOSER_AMOUNT="0.2ether"
DEFAULT_CERC_BATCHER_AMOUNT="0.1ether"
DEFAULT_CERC_L1_BEACON=http://fixturenet-eth-lighthouse-1:8001

View File

@ -9,8 +9,8 @@ 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_L2_PROPOSER_AMOUNT="${CERC_L2_PROPOSER_AMOUNT:-${DEFAULT_CERC_L2_PROPOSER_AMOUNT}}"
CERC_L2_BATCHER_AMOUNT="${CERC_L2_BATCHER_AMOUNT:-${DEFAULT_CERC_L2_BATCHER_AMOUNT}}"
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
@ -71,8 +71,8 @@ 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_L2_PROPOSER_AMOUNT $PROPOSER --private-key $ADMIN_KEY
cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value $CERC_L2_BATCHER_AMOUNT $BATCHER --private-key $ADMIN_KEY
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
else
curl -o accounts.csv $CERC_L1_ACCOUNTS_CSV_URL
# Admin

View File

@ -116,9 +116,9 @@ Inside the `fixturenet-optimism-deployment` deployment directory, open `config.e
```bash
# Optional
# Funding amounts for proposer and batcher accounts
CERC_L2_PROPOSER_AMOUNT= # Default 0.2ether
CERC_L2_BATCHER_AMOUNT= # Default 0.1ether
# Funding amounts for proposer and batcher accounts on L1
CERC_PROPOSER_AMOUNT= # Default 0.2ether
CERC_BATCHER_AMOUNT= # Default 0.1ether
```
## Start the stack

View File

@ -80,9 +80,10 @@ Inside the deployment directory, open the file `config.env` and add the followin
# Optional
# Funding amounts for proposer and batcher accounts
CERC_L2_PROPOSER_AMOUNT=
CERC_L2_BATCHER_AMOUNT=
# 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`)