From 4b01f3de72ea5f48554550d15e9997d0bba1bc19 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Fri, 30 Aug 2024 19:00:38 +0800 Subject: [PATCH] Update readme --- stack/fixturenet-optimism/README.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/stack/fixturenet-optimism/README.md b/stack/fixturenet-optimism/README.md index b0447a5..b59367e 100644 --- a/stack/fixturenet-optimism/README.md +++ b/stack/fixturenet-optimism/README.md @@ -145,7 +145,7 @@ docker logs -f Send some ETH from the desired account to the `L1StandardBridgeProxy` contract on L1 to test bridging to L2. -We can use the testing account `0xe6CE22afe802CAf5fF7d3845cec8c736ecc8d61F` which is pre-funded and unlocked, and the `cerc/foundry:local` container to make use of the `cast` cli. +We can use the testing account `0xe6CE22afe802CAf5fF7d3845cec8c736ecc8d61F` which is pre-funded and unlocked, and the `cerc/optimism-contracts:local` container to make use of the `cast` cli. 1. Note the docker network the stack is running on: @@ -164,16 +164,22 @@ We can use the testing account `0xe6CE22afe802CAf5fF7d3845cec8c736ecc8d61F` whic ACCOUNT=0xe6CE22afe802CAf5fF7d3845cec8c736ecc8d61F ``` + You can create an alias for running `cast` on the network: + + ```bash + alias op-cast="docker run --rm --network $NETWORK --entrypoint cast cerc/optimism-contracts:local" + ``` + If you need to check the L1 chain-id, you can use: ```bash - docker run --rm --network $NETWORK cerc/optimism-contracts:local "cast chain-id --rpc-url $L1_RPC" + op-cast chain-id --rpc-url $L1_RPC ``` 3. Check the account starting balance on L2 (it should be 0): ```bash - docker run --rm --network $NETWORK cerc/optimism-contracts:local "cast balance $ACCOUNT --rpc-url $L2_RPC" + op-cast balance $ACCOUNT --rpc-url $L2_RPC # 0 ``` @@ -182,8 +188,8 @@ We can use the testing account `0xe6CE22afe802CAf5fF7d3845cec8c736ecc8d61F` whic ```bash # get the container id for op-node NODE_CONTAINER=$(docker ps --filter "name=op-node" -q) + # get the bridge contract address BRIDGE=$(docker exec $NODE_CONTAINER cat /l1-deployment/$DEPLOYMENT_CONTEXT-deploy.json | jq -r .L1StandardBridgeProxy) - # get the funded account's pk ACCOUNT_PK=$(docker exec $NODE_CONTAINER jq -r '.AdminKey' /l2-accounts/accounts.json) ``` @@ -191,15 +197,15 @@ We can use the testing account `0xe6CE22afe802CAf5fF7d3845cec8c736ecc8d61F` whic 5. Use cast to send some ETH to the bridge contract: ```bash - docker run --rm --network $NETWORK cerc/optimism-contracts:local "cast send --from $ACCOUNT --value 1ether $BRIDGE --rpc-url $L1_RPC --private-key $ACCOUNT_PK" + op-cast send --from $ACCOUNT --value 1ether $BRIDGE --rpc-url $L1_RPC --private-key $ACCOUNT_PK ``` -6. Allow a couple minutes for the bridge to complete +6. Allow a couple minutes for the bridge to complete. 7. Check the L2 balance again (it should show the bridged funds): ```bash - docker run --rm --network $NETWORK cerc/optimism-contracts:local "cast balance $ACCOUNT --rpc-url $L2_RPC" + op-cast balance $ACCOUNT --rpc-url $L2_RPC # 1000000000000000000 ```