diff --git a/testnet-onboarding-demo.md b/testnet-onboarding-demo.md index ccd0f0b..b4c9e56 100644 --- a/testnet-onboarding-demo.md +++ b/testnet-onboarding-demo.md @@ -358,29 +358,7 @@ laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file bridge-nitro-spec.yml --deployment-dir bridge-nitro-deployment ``` - - In `bridge-nitro-deployment/config.env` file, set the following env variable: - - ```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 - - # Private key of the account on chain that is used for funding channels in Nitro node - CERC_NITRO_CHAIN_PK=888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218 - - CERC_NITRO_SC_PK=0279651921cd800ac560c21ceea27aab0107b67daf436cdd25ce84cad30159b4 - - # Port to be used by P2P message service - CERC_NITRO_L1_MSG_PORT=3005 - CERC_NITRO_L2_MSG_PORT=3006 - - # Port to be used by RPC server - CERC_NITRO_RPC_PORT=4006 - - CERC_NITRO_PUBLIC_P2P_HOST= - ``` - -### Nitro-node Stack +#### Nitro-node Stack 1. Clone the stack repos: @@ -428,38 +406,6 @@ laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file l1alice-nitro-spec.yml --deployment-dir l1alice-nitro-deployment ``` - - In `l1alice-nitro-deployment/config.env` file, set the following env variable: - - ```bash - # URL endpoint of the chain - CERC_NITRO_CHAIN_URL=ws://host.docker.internal:8546 - - # Private key of account to be used by Nitro node (derived address is used as Nitro address) - # Note: Enter PKs without the leading `0x` - CERC_NITRO_PK="" - - # Private key of the account on chain that is used for funding channels in Nitro node - CERC_NITRO_CHAIN_PK=570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597 - - # Port to be used by P2P message service - CERC_NITRO_MSG_PORT=3007 - - # Port to be used by RPC server - CERC_NITRO_RPC_PORT=4007 - - # Optional - # Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp - # TODO: Contracts are deployed if addresses are not set - CERC_NA_ADDRESS=0xb2592723B09F42937543f199A305ea6576dCb506 - CERC_VPA_ADDRESS=0x198c6643f7750c2569C3468E16750a8E8504E2c7 - CERC_CA_ADDRESS=0x198A8F1F14ACe1662fB2E5BE63A1de2308DE4CC7 - - # Public IP of the nitro-node - CERC_PUBLIC_IP=/ip4/127.0.0.1/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes - - USE_DURABLE_STORE=true - ``` - 5. Create a deployment for Charlie's L1 nitro-node: - Create spec file for the deployment: @@ -486,39 +432,6 @@ laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file l1charlie-nitro-spec.yml --deployment-dir l1charlie-nitro-deployment ``` - - In `l1charlie-nitro-deployment/config.env` file, set the following env variable: - - ```bash - # URL endpoint of the chain - CERC_NITRO_CHAIN_URL=ws://host.docker.internal:8546 - - # Private key of account to be used by Nitro node (derived address is used as Nitro address) - # Note: Enter PKs without the leading `0x` - CERC_NITRO_PK="" - - # Private key of the account on chain that is used for funding channels in Nitro node - CERC_NITRO_CHAIN_PK=111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f - - # Port to be used by P2P message service - CERC_NITRO_MSG_PORT=3009 - # Port to be used by RPC server - CERC_NITRO_RPC_PORT=4009 - - # Optional - # Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp - # TODO: Contracts are deployed if addresses are not set - CERC_NA_ADDRESS=0xb2592723B09F42937543f199A305ea6576dCb506 - CERC_VPA_ADDRESS=0x198c6643f7750c2569C3468E16750a8E8504E2c7 - CERC_CA_ADDRESS=0x198A8F1F14ACe1662fB2E5BE63A1de2308DE4CC7 - - # Public IP of the nitro-node - CERC_PUBLIC_IP=/ip4/127.0.0.1/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes - - USE_DURABLE_STORE=true - - DURABLE_STORE_FOLDER=./data/l2-nitro-store - ``` - 6. Create a deployment for Alice's L2 nitro-node: - Create spec files for the deployment: @@ -545,38 +458,6 @@ laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file l2alice-nitro-spec.yml --deployment-dir l2alice-nitro-deployment ``` - - In `l2alice-nitro-deployment/config.env` file, set the following env variable: - - ```bash - # URL endpoint of the chain - CERC_NITRO_CHAIN_URL=ws://host.docker.internal:9546 - - # Private key of account to be used by Nitro node (derived address is used as Nitro address) - # Note: Enter PKs without the leading `0x` - CERC_NITRO_PK="" - - # Private key of the account on chain that is used for funding channels in Nitro node - CERC_NITRO_CHAIN_PK=570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597 - - # Port to be used by P2P message service - CERC_NITRO_MSG_PORT=3008 - - # Port to be used by RPC server - CERC_NITRO_RPC_PORT=4008 - - # Optional - # Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp - # TODO: Contracts are deployed if addresses are not set - CERC_NA_ADDRESS=0xb2592723B09F42937543f199A305ea6576dCb506 - CERC_VPA_ADDRESS=0x198c6643f7750c2569C3468E16750a8E8504E2c7 - CERC_CA_ADDRESS=0x198A8F1F14ACe1662fB2E5BE63A1de2308DE4CC7 - - # Public IP of the nitro-node - CERC_PUBLIC_IP=/ip4/127.0.0.1/tcp/3006/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes - - USE_DURABLE_STORE=true - ``` - 7. Create a deployment for Charlie's L2 nitro-node: - Create spec file for the deployment: @@ -603,41 +484,6 @@ laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file l2charlie-nitro-spec.yml --deployment-dir l2charlie-nitro-deployment ``` - - In `l2charlie-nitro-deployment/config.env` file, set the following env variable: - - ```bash - # URL endpoint of the chain - CERC_NITRO_CHAIN_URL=ws://host.docker.internal:9546 - - # Private key of account to be used by Nitro node (derived address is used as Nitro address) - # Note: Enter PKs without the leading `0x` - CERC_NITRO_PK="" - - # Private key of the account on chain that is used for funding channels in Nitro node - CERC_NITRO_CHAIN_PK=111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f - - # Port to be used by P2P message service - CERC_NITRO_MSG_PORT=3010 - # Port to be used by RPC server - CERC_NITRO_RPC_PORT=4010 - - # Optional - # Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp - # TODO: Contracts are deployed if addresses are not set - CERC_NA_ADDRESS=0xb2592723B09F42937543f199A305ea6576dCb506 - CERC_VPA_ADDRESS=0x198c6643f7750c2569C3468E16750a8E8504E2c7 - CERC_CA_ADDRESS=0x198A8F1F14ACe1662fB2E5BE63A1de2308DE4CC7 - - # Public IP of the nitro-node - CERC_PUBLIC_IP=/ip4/127.0.0.1/tcp/3006/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes - - USE_DURABLE_STORE=true - - L2=true - - DURABLE_STORE_FOLDER=./data/l2-nitro-store - ``` - ## Run - Start L1, L2 stacks: @@ -938,58 +784,136 @@ - Get Ethereum private keys for accounts Alice and Charlie from `laconic-wallet` (to be used as statechannel PKs) - Start nitro nodes for Alice and Charlie on L1 and L2: - - Prepare config files in go-nitro repo `cmd/test-configs` + - Prepare config files for the nodes - **Note**: Enter PKs without the leading `0x` - - `cmd/test-configs/l1alice.toml` + - In `l1alice-nitro-deployment/config.env` file, set the following env variable: ```bash - usedurablestore = true - msgport = 3007 - rpcport = 4007 - pk = "" - chainpk = "570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597" - chainurl = "ws://127.0.0.1:8546" - bootpeers = "/ip4/127.0.0.1/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes" + # URL endpoint of the chain + CERC_NITRO_CHAIN_URL=ws://host.docker.internal:8546 + + # Private key of account to be used by Nitro node (derived address is used as Nitro address) + # Note: Enter PKs without the leading `0x` + CERC_NITRO_PK="" + + # Private key of the account on chain that is used for funding channels in Nitro node + CERC_NITRO_CHAIN_PK=570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597 + + # Port to be used by P2P message service + CERC_NITRO_MSG_PORT=3007 + + # Port to be used by RPC server + CERC_NITRO_RPC_PORT=4007 + + # Optional + # Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp + # TODO: Contracts are deployed if addresses are not set + CERC_NA_ADDRESS=0xb2592723B09F42937543f199A305ea6576dCb506 + CERC_VPA_ADDRESS=0x198c6643f7750c2569C3468E16750a8E8504E2c7 + CERC_CA_ADDRESS=0x198A8F1F14ACe1662fB2E5BE63A1de2308DE4CC7 + + # Public IP of the nitro-node + CERC_PUBLIC_IP=/ip4/127.0.0.1/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + + USE_DURABLE_STORE=true ``` - - `cmd/test-configs/l2alice.toml` + - In `l2alice-nitro-deployment/config.env` file, set the following env variable: ```bash - usedurablestore = true - msgport = 3008 - rpcport = 4008 - pk = "" - chainpk = "570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597" - chainurl = "ws://127.0.0.1:9546" - bootpeers = "/ip4/127.0.0.1/tcp/3006/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes" - durablestorefolder = "./data/l2-nitro-store" - l2 = true + # URL endpoint of the chain + CERC_NITRO_CHAIN_URL=ws://host.docker.internal:9546 + + # Private key of account to be used by Nitro node (derived address is used as Nitro address) + # Note: Enter PKs without the leading `0x` + CERC_NITRO_PK="" + + # Private key of the account on chain that is used for funding channels in Nitro node + CERC_NITRO_CHAIN_PK=570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597 + + # Port to be used by P2P message service + CERC_NITRO_MSG_PORT=3008 + + # Port to be used by RPC server + CERC_NITRO_RPC_PORT=4008 + + # Optional + # Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp + # TODO: Contracts are deployed if addresses are not set + CERC_NA_ADDRESS=0xb2592723B09F42937543f199A305ea6576dCb506 + CERC_VPA_ADDRESS=0x198c6643f7750c2569C3468E16750a8E8504E2c7 + CERC_CA_ADDRESS=0x198A8F1F14ACe1662fB2E5BE63A1de2308DE4CC7 + + # Public IP of the nitro-node + CERC_PUBLIC_IP=/ip4/127.0.0.1/tcp/3006/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + + USE_DURABLE_STORE=true + + L2=true ``` - - `cmd/test-configs/l1charlie.toml` + - In `l1charlie-nitro-deployment/config.env` file, set the following env variable: ```bash - usedurablestore = true - msgport = 3009 - rpcport = 4009 - pk = "" - chainpk = "111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f" - chainurl = "ws://127.0.0.1:8546" - bootpeers = "/ip4/127.0.0.1/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes" + # URL endpoint of the chain + CERC_NITRO_CHAIN_URL=ws://host.docker.internal:8546 + + # Private key of account to be used by Nitro node (derived address is used as Nitro address) + # Note: Enter PKs without the leading `0x` + CERC_NITRO_PK="" + + # Private key of the account on chain that is used for funding channels in Nitro node + CERC_NITRO_CHAIN_PK=111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f + + # Port to be used by P2P message service + CERC_NITRO_MSG_PORT=3009 + # Port to be used by RPC server + CERC_NITRO_RPC_PORT=4009 + + # Optional + # Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp + # TODO: Contracts are deployed if addresses are not set + CERC_NA_ADDRESS=0xb2592723B09F42937543f199A305ea6576dCb506 + CERC_VPA_ADDRESS=0x198c6643f7750c2569C3468E16750a8E8504E2c7 + CERC_CA_ADDRESS=0x198A8F1F14ACe1662fB2E5BE63A1de2308DE4CC7 + + # Public IP of the nitro-node + CERC_PUBLIC_IP=/ip4/127.0.0.1/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + + USE_DURABLE_STORE=true ``` - - `cmd/test-configs/l2charlie.toml` + - In `l2charlie-nitro-deployment/config.env` file, set the following env variable: ```bash - usedurablestore = true - msgport = 3010 - rpcport = 4010 - pk = "" - chainpk = "111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f" - chainurl = "ws://127.0.0.1:9546" - bootpeers = "/ip4/127.0.0.1/tcp/3006/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes" - durablestorefolder = "./data/l2-nitro-store" - l2 = true + # URL endpoint of the chain + CERC_NITRO_CHAIN_URL=ws://host.docker.internal:9546 + + # Private key of account to be used by Nitro node (derived address is used as Nitro address) + # Note: Enter PKs without the leading `0x` + CERC_NITRO_PK="" + + # Private key of the account on chain that is used for funding channels in Nitro node + CERC_NITRO_CHAIN_PK=111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f + + # Port to be used by P2P message service + CERC_NITRO_MSG_PORT=3010 + # Port to be used by RPC server + CERC_NITRO_RPC_PORT=4010 + + # Optional + # Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp + # TODO: Contracts are deployed if addresses are not set + CERC_NA_ADDRESS=0xb2592723B09F42937543f199A305ea6576dCb506 + CERC_VPA_ADDRESS=0x198c6643f7750c2569C3468E16750a8E8504E2c7 + CERC_CA_ADDRESS=0x198A8F1F14ACe1662fB2E5BE63A1de2308DE4CC7 + + # Public IP of the nitro-node + CERC_PUBLIC_IP=/ip4/127.0.0.1/tcp/3006/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes + + USE_DURABLE_STORE=true + + L2=true ``` - In a new terminal, go to go-nitro repo root and initialize node A on L1