diff --git a/testnet-onboarding-demo.md b/testnet-onboarding-demo.md index cf6f7d3..1b68421 100644 --- a/testnet-onboarding-demo.md +++ b/testnet-onboarding-demo.md @@ -367,7 +367,7 @@ laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers --force-rebuild ``` -4. Create a deployment for Alice's L1 nitro-node: +4. Create a deployment spec-file for Alice's L1 nitro-node: - Create spec files for the deployment: ```bash @@ -386,7 +386,7 @@ - 4007:4005 ``` -5. Create a deployment for Charlie's L1 nitro-node: +5. Create a deployment spec-file for Charlie's L1 nitro-node: - Create spec file for the deployment: ```bash @@ -405,7 +405,7 @@ - 4008:4005 ``` -6. Create a deployment for Alice's L2 nitro-node: +6. Create a deployment spec-file for Alice's L2 nitro-node: - Create spec files for the deployment: ```bash @@ -424,7 +424,7 @@ - 4009:4005 ``` -7. Create a deployment for Charlie's L2 nitro-node: +7. Create a deployment spec-file for Charlie's L2 nitro-node: - Create spec file for the deployment: ```bash @@ -593,25 +593,27 @@ yarn hardhat transfer --contract $L1_ASSET_ADDRESS --to $C_CHAIN_ADDRESS --amount 1000 --network geth ``` -- In `bridge-nitro-deployment/config.env` file, set the following env variable: +- Create a deployment for the bridge: + - Create spec files for the deployment, map container ports to host ports and set env variables: ```bash - # URL endpoint of the L2 and L2 chains - CERC_NITRO_L1_CHAIN_URL=ws://host.docker.internal:8546 - CERC_NITRO_L2_CHAIN_URL=ws://host.docker.internal:9546 + laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge deploy init --map-ports-to-host any-same --output bridge-nitro-spec.yml --config CERC_NITRO_L1_CHAIN_URL=ws://host.docker.internal:8546, \ + CERC_NITRO_L2_CHAIN_URL=ws://host.docker.internal:9546, \ + CERC_NITRO_CHAIN_PK=888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218, \ + CERC_NITRO_SC_PK=0279651921cd800ac560c21ceea27aab0107b67daf436cdd25ce84cad30159b4, \ + CERC_GETH_URL=http://host.docker.internal:8545, \ + CERC_OPTIMISM_URL=http://host.docker.internal:9545, \ + CERC_GETH_DEPLOYER_PK=888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218, \ + CERC_OPTIMISM_DEPLOYER_PK=888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218, \ + CERC_TOKEN_NAME=LaconicNetworkToken, \ + CERC_TOKEN_SYMBOL=LNT, \ + CERC_INITIAL_TOKEN_SUPPLY=10000000, \ + ``` - # Private key of the account on chain that is used for funding channels in Nitro node - CERC_NITRO_CHAIN_PK=888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218 + - Create a deployment from the spec file: - CERC_NITRO_SC_PK=0279651921cd800ac560c21ceea27aab0107b67daf436cdd25ce84cad30159b4 - - CERC_GETH_URL=http://host.docker.internal:8545 - CERC_OPTIMISM_URL=http://host.docker.internal:9545 - CERC_GETH_DEPLOYER_PK=888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218 - CERC_OPTIMISM_DEPLOYER_PK=888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218 - CERC_TOKEN_NAME=LaconicNetworkToken - CERC_TOKEN_SYMBOL=LNT - CERC_INITIAL_TOKEN_SUPPLY=10000000 + ```bash + laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge deploy create --spec-file bridge-nitro-spec.yml --deployment-dir bridge-nitro-deployment ``` - Start testnet-onboarding-app (run command in testnet-onboarding-app repo) @@ -729,19 +731,19 @@ - Get Ethereum private keys for accounts Alice and Charlie from `laconic-wallet` (to be used as statechannel PKs) - Prepare deployments for the nodes - - **Note**: Enter PKs without the leading `0x` - Set the env variables for L1 Alice's nitro-node: ```bash - laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy \ - --config CERC_NITRO_CHAIN_URL=ws://host.docker.internal:8546, \ - CERC_NITRO_SC_PK=, \ - CERC_NITRO_CHAIN_PK=570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597, \ - CERC_NA_ADDRESS=$CERC_NA_ADDRESS, \ - CERC_VPA_ADDRESS=$CERC_VPA_ADDRESS, \ - CERC_CA_ADDRESS=$CERC_CA_ADDRESS, \ - CERC_BRIDGE_ADDRESS=$CERC_BRIDGE_ADDRESS, \ - CERC_NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + cat <> lialice-nitro-deployment/config.env + CERC_NITRO_CHAIN_URL=ws://host.docker.internal:8546 + CERC_NITRO_SC_PK= + CERC_NITRO_CHAIN_PK=570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597 + CERC_NA_ADDRESS=$CERC_NA_ADDRESS + CERC_VPA_ADDRESS=$CERC_VPA_ADDRESS + CERC_CA_ADDRESS=$CERC_CA_ADDRESS + CERC_BRIDGE_ADDRESS=$CERC_BRIDGE_ADDRESS + CERC_NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + EOF ``` - Create a deployment from the spec file @@ -753,15 +755,16 @@ - Set the env variables for L1 Charlie's nitro-node: ```bash - laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy \ - --config CERC_NITRO_CHAIN_URL=ws://host.docker.internal:8546, \ - CERC_NITRO_SC_PK=, \ - CERC_NITRO_CHAIN_PK=570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597, \ - CERC_NA_ADDRESS=$CERC_NA_ADDRESS, \ - CERC_VPA_ADDRESS=$CERC_VPA_ADDRESS, \ - CERC_CA_ADDRESS=$CERC_CA_ADDRESS, \ - CERC_BRIDGE_ADDRESS=$CERC_BRIDGE_ADDRESS, \ - CERC_NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + cat <> l1charlie-nitro-deployment/config.env + CERC_NITRO_CHAIN_URL=ws://host.docker.internal:8546 + CERC_NITRO_SC_PK= + CERC_NITRO_CHAIN_PK=570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597 + CERC_NA_ADDRESS=$CERC_NA_ADDRESS + CERC_VPA_ADDRESS=$CERC_VPA_ADDRESS + CERC_CA_ADDRESS=$CERC_CA_ADDRESS + CERC_BRIDGE_ADDRESS=$CERC_BRIDGE_ADDRESS + CERC_NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + EOF ``` - Create a deployment `l1charlie-nitro-deployment` from the spec file @@ -773,18 +776,19 @@ - Set the env variables for L2 Alice's nitro-node: ```bash - laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy \ - --config CERC_NITRO_CHAIN_URL=ws://host.docker.internal:9546, \ - CERC_NITRO_SC_PK=, \ - CERC_NITRO_CHAIN_PK=111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f, \ - CERC_NITRO_MSG_PORT=3008, \ - CERC_NITRO_RPC_PORT=4008, \ - CERC_NA_ADDRESS=$CERC_NA_ADDRESS, \ - CERC_VPA_ADDRESS=$CERC_VPA_ADDRESS, \ - CERC_CA_ADDRESS=$CERC_CA_ADDRESS, \ - CERC_BRIDGE_ADDRESS=$CERC_BRIDGE_ADDRESS, \ - CERC_NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes, \ - CERC_NITRO_L2=true + cat <> l2alice-nitro-deployment/config.env + CERC_NITRO_CHAIN_URL=ws://host.docker.internal:9546 + CERC_NITRO_SC_PK= + CERC_NITRO_CHAIN_PK=111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f + CERC_NITRO_MSG_PORT=3008 + CERC_NITRO_RPC_PORT=4008 + CERC_NA_ADDRESS=$CERC_NA_ADDRESS + CERC_VPA_ADDRESS=$CERC_VPA_ADDRESS + CERC_CA_ADDRESS=$CERC_CA_ADDRESS + CERC_BRIDGE_ADDRESS=$CERC_BRIDGE_ADDRESS + CERC_NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + CERC_NITRO_L2=true + EOF ``` - Create a deployment from the spec file: @@ -794,20 +798,21 @@ ``` - Set the env variables for L2 Charlie's nitro-node: - + ```bash - laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy \ - --config CERC_NITRO_CHAIN_URL=ws://host.docker.internal:9546, \ - CERC_NITRO_SC_PK=, \ - CERC_NITRO_CHAIN_PK=111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f, \ - CERC_NITRO_MSG_PORT=3010, \ - CERC_NITRO_RPC_PORT=4010, \ - CERC_NA_ADDRESS=$CERC_NA_ADDRESS, \ - CERC_VPA_ADDRESS=$CERC_VPA_ADDRESS, \ - CERC_CA_ADDRESS=$CERC_CA_ADDRESS, \ - CERC_BRIDGE_ADDRESS=$CERC_BRIDGE_ADDRESS, \ - CERC_NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes, \ - CERC_NITRO_L2=true + cat <> l2charlie-nitro-deployment/config.env + CERC_NITRO_CHAIN_URL=ws://host.docker.internal:9546 + CERC_NITRO_SC_PK= + CERC_NITRO_CHAIN_PK=111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f + CERC_NITRO_MSG_PORT=3010 + CERC_NITRO_RPC_PORT=4010 + CERC_NA_ADDRESS=$CERC_NA_ADDRESS + CERC_VPA_ADDRESS=$CERC_VPA_ADDRESS + CERC_CA_ADDRESS=$CERC_CA_ADDRESS + CERC_BRIDGE_ADDRESS=$CERC_BRIDGE_ADDRESS + CERC_NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + CERC_NITRO_L2=true + EOF ``` - Create deployment from the spec files: