From 3328a75197ec78cb86f45d2de684e4cec5b8a6c7 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 28 Aug 2024 11:01:23 +0530 Subject: [PATCH 1/3] Add step to check voucher after payment --- nitro-bridge-demo.md | 64 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/nitro-bridge-demo.md b/nitro-bridge-demo.md index 5d97017..ed4443f 100644 --- a/nitro-bridge-demo.md +++ b/nitro-bridge-demo.md @@ -530,6 +530,9 @@ ```bash laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4006 -h nitro-bridge" + + # Expected output: + # [] ``` - Set address of bridge and address of custom token on L1 in the current terminal @@ -550,7 +553,17 @@ ``` - Once direct-fund objective is complete, bridge will create mirrored channel on L2 + - Check node A' logs to see bridged-fund objective completed + + ```bash + laconic-so deployment --dir l2alice-nitro-deployment logs nitro-node -f --tail 30 + + # Expected Output: + # nitro-node-1 | 5:01AM INF INFO Objective cranked address=0x4B64e26da8279AB12bcd4cA9974eC2b4741e175e objective-id=bridgedfunding-0xfe39595894549283b4ffb4c1e3715856e766af00e18bc968d4c61c9267af528a waiting-for=WaitingForNothing + # nitro-node-1 | 5:01AM INF INFO Objective is complete & returned to API address=0x4B64e26da8279AB12bcd4cA9974eC2b4741e175e objective-id=bridgedfunding-0xfe39595894549283b4ffb4c1e3715856e766af00e18bc968d4c61c9267af528a + ``` + - Check the [Troubleshooting](#troubleshooting) section if command to create a ledger channel fails or gets stuck - Check status of L1 ledger channel between A and Bridge using channel ID in output above @@ -584,7 +597,17 @@ ``` - Once direct fund objective is complete, bridge will create mirrored channel on L2 + - Check node C' logs to see bridged-fund objective completed + + ```bash + laconic-so deployment --dir l2charlie-nitro-deployment logs nitro-node -f --tail 30 + + # Expected Output: + # nitro-node-1 | 5:06AM INF INFO Objective cranked address=0x03Eb7a84E286c671836b9897AaE24b31D36f9cA8 objective-id=bridgedfunding-0xcfa4c78ec3e8a95b7d2176ff99c7af5a56b040043894dba3962e60fc855741d3 waiting-for=WaitingForNothing + # nitro-node-1 | 5:06AM INF INFO Objective is complete & returned to API address=0x03Eb7a84E286c671836b9897AaE24b31D36f9cA8 objective-id=bridgedfunding-0xcfa4c78ec3e8a95b7d2176ff99c7af5a56b040043894dba3962e60fc855741d3 + ``` + - Check the [Troubleshooting](#troubleshooting) section if command to create a ledger channel fails or gets stuck - Check status of L1 ledger channel between C and Bridge using channel ID in output above @@ -613,8 +636,32 @@ laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4006 -h nitro-bridge" # Expected output: - # {"ID":"0x5648967ca443ea02cd50c1f5e3d58a43a96fdbf1c1d225ce436188ca33ea1753","Status":"Open","Balance":{"AssetAddress":"","Me":"0xbbb676f9cff8d242e9eac39d063848807d3d1d94","Them":"0x4b64e26da8279ab12bcd4ca9974ec2b4741e175e","MyBalance":1000000,"TheirBalance":1000000},"ChannelMode":"Open"} - #{"ID":"0x7469ab77ee580b2da6135fbf58a21ea47869651fafed5f777e520efb0d36f417","Status":"Open","Balance":{"AssetAddress":"","Me":"0xbbb676f9cff8d242e9eac39d063848807d3d1d94","Them":"0x03eb7a84e286c671836b9897aae24b31d36f9ca8","MyBalance":1000000,"TheirBalance":1000000},"ChannelMode":"Open"} + # [ + # { + # "ID": "0xcfa4c78ec3e8a95b7d2176ff99c7af5a56b040043894dba3962e60fc855741d3", + # "Status": "Open", + # "Balance": { + # "AssetAddress": "", + # "Me": "0xbbb676f9cff8d242e9eac39d063848807d3d1d94", + # "Them": "0x03eb7a84e286c671836b9897aae24b31d36f9ca8", + # "MyBalance": 1000000, + # "TheirBalance": 1000000 + # }, + # "ChannelMode": "Open" + # }, + # { + # "ID": "0xfe39595894549283b4ffb4c1e3715856e766af00e18bc968d4c61c9267af528a", + # "Status": "Open", + # "Balance": { + # "AssetAddress": "", + # "Me": "0xbbb676f9cff8d242e9eac39d063848807d3d1d94", + # "Them": "0x4b64e26da8279ab12bcd4ca9974ec2b4741e175e", + # "MyBalance": 1000000, + # "TheirBalance": 1000000 + # }, + # "ChannelMode": "Open" + # } + # ] ``` In above expected output the following are observed @@ -680,6 +727,19 @@ # } ``` +- Check largest voucher received on the payment channel + + ```bash + laconic-so deployment --dir l2charlie-nitro-deployment exec nitro-rpc-client "nitro-rpc-client get-voucher $PAYMENT_CHANNEL_ID -p 4005 -h nitro-node" + + # Expected output: + # { + # Amount: 200, + # ChannelId: '0x271aa07b32dc6c7d3b1cb9259a8dc86b82254d84a093ab695c7a4fc25fc402e3', + # Signature: '0x8fbdb9bb91932b422c30cc07bf422e4f1c3ae1be1b60e01bbfcb193ae5c8f5b0571de84667d87b5ef9b737287faa0ddf41f1f9fc159673205679622c69fd69d81b' + # } + ``` + - Check payment channel status again to view updated channel state ```bash -- 2.45.2 From 0c6efd7bb5900a588abe95d4a261a824bff13210 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Wed, 28 Aug 2024 12:21:27 +0530 Subject: [PATCH 2/3] Update l1 nodes config --- nitro-bridge-demo.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/nitro-bridge-demo.md b/nitro-bridge-demo.md index ed4443f..7b9c964 100644 --- a/nitro-bridge-demo.md +++ b/nitro-bridge-demo.md @@ -411,7 +411,6 @@ NA_ADDRESS=$NA_ADDRESS VPA_ADDRESS=$VPA_ADDRESS CA_ADDRESS=$CA_ADDRESS - BRIDGE_ADDRESS=$BRIDGE_ADDRESS NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes NITRO_EXT_MULTIADDR=/dns4/host.docker.internal/tcp/3007 EOF @@ -433,7 +432,6 @@ NA_ADDRESS=$NA_ADDRESS VPA_ADDRESS=$VPA_ADDRESS CA_ADDRESS=$CA_ADDRESS - BRIDGE_ADDRESS=$BRIDGE_ADDRESS NITRO_BOOTPEERS=/dns4/host.docker.internal/tcp/3005/p2p/16Uiu2HAmJDxLM8rSybX78FH51iZq9PdrwCoCyyHRBCndNzcAYMes NITRO_EXT_MULTIADDR=/dns4/host.docker.internal/tcp/3008 EOF -- 2.45.2 From bd832cc53dacacf0fa449199fa5980ad6b11404c Mon Sep 17 00:00:00 2001 From: Neeraj Date: Thu, 29 Aug 2024 11:05:07 +0530 Subject: [PATCH 3/3] Format get all ledger channel command --- nitro-bridge-demo.md | 58 ++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/nitro-bridge-demo.md b/nitro-bridge-demo.md index 7b9c964..d2933c5 100644 --- a/nitro-bridge-demo.md +++ b/nitro-bridge-demo.md @@ -558,8 +558,8 @@ laconic-so deployment --dir l2alice-nitro-deployment logs nitro-node -f --tail 30 # Expected Output: - # nitro-node-1 | 5:01AM INF INFO Objective cranked address=0x4B64e26da8279AB12bcd4cA9974eC2b4741e175e objective-id=bridgedfunding-0xfe39595894549283b4ffb4c1e3715856e766af00e18bc968d4c61c9267af528a waiting-for=WaitingForNothing - # nitro-node-1 | 5:01AM INF INFO Objective is complete & returned to API address=0x4B64e26da8279AB12bcd4cA9974eC2b4741e175e objective-id=bridgedfunding-0xfe39595894549283b4ffb4c1e3715856e766af00e18bc968d4c61c9267af528a + # nitro-node-1 | 5:01AM INF INFO Objective cranked address=0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce objective-id=bridgedfunding-0x6a9f5ccf1fa802525d794f4a899897f947615f6acc7141e61e056a8bfca29179 waiting-for=WaitingForNothing + # nitro-node-1 | 5:01AM INF INFO Objective is complete & returned to API address=0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce objective-id=bridgedfunding-0x6a9f5ccf1fa802525d794f4a899897f947615f6acc7141e61e056a8bfca29179 ``` - Check the [Troubleshooting](#troubleshooting) section if command to create a ledger channel fails or gets stuck @@ -602,8 +602,8 @@ laconic-so deployment --dir l2charlie-nitro-deployment logs nitro-node -f --tail 30 # Expected Output: - # nitro-node-1 | 5:06AM INF INFO Objective cranked address=0x03Eb7a84E286c671836b9897AaE24b31D36f9cA8 objective-id=bridgedfunding-0xcfa4c78ec3e8a95b7d2176ff99c7af5a56b040043894dba3962e60fc855741d3 waiting-for=WaitingForNothing - # nitro-node-1 | 5:06AM INF INFO Objective is complete & returned to API address=0x03Eb7a84E286c671836b9897AaE24b31D36f9cA8 objective-id=bridgedfunding-0xcfa4c78ec3e8a95b7d2176ff99c7af5a56b040043894dba3962e60fc855741d3 + # nitro-node-1 | 5:06AM INF INFO Objective cranked address=0xa8d2d06ace9c7ffc24ee785c2695678aecdfd7a0 objective-id=bridgedfunding-0x15dbe6b996e4e46fdd6ea3e2074cbca58014dbb07368e3e7ba286df5c7b9da0d waiting-for=WaitingForNothing + # nitro-node-1 | 5:06AM INF INFO Objective is complete & returned to API address=0xa8d2d06ace9c7ffc24ee785c2695678aecdfd7a0 objective-id=bridgedfunding-0x15dbe6b996e4e46fdd6ea3e2074cbca58014dbb07368e3e7ba286df5c7b9da0d ``` - Check the [Troubleshooting](#troubleshooting) section if command to create a ledger channel fails or gets stuck @@ -636,24 +636,24 @@ # Expected output: # [ # { - # "ID": "0xcfa4c78ec3e8a95b7d2176ff99c7af5a56b040043894dba3962e60fc855741d3", + # "ID": "0x15dbe6b996e4e46fdd6ea3e2074cbca58014dbb07368e3e7ba286df5c7b9da0d", # "Status": "Open", # "Balance": { # "AssetAddress": "", # "Me": "0xbbb676f9cff8d242e9eac39d063848807d3d1d94", - # "Them": "0x03eb7a84e286c671836b9897aae24b31d36f9ca8", + # "Them": "0xa8d2d06ace9c7ffc24ee785c2695678aecdfd7a0", # "MyBalance": 1000000, # "TheirBalance": 1000000 # }, # "ChannelMode": "Open" # }, # { - # "ID": "0xfe39595894549283b4ffb4c1e3715856e766af00e18bc968d4c61c9267af528a", + # "ID": "0x6a9f5ccf1fa802525d794f4a899897f947615f6acc7141e61e056a8bfca29179", # "Status": "Open", # "Balance": { # "AssetAddress": "", # "Me": "0xbbb676f9cff8d242e9eac39d063848807d3d1d94", - # "Them": "0x4b64e26da8279ab12bcd4ca9974ec2b4741e175e", + # "Them": "0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce", # "MyBalance": 1000000, # "TheirBalance": 1000000 # }, @@ -663,11 +663,11 @@ ``` In above expected output the following are observed - - In ledger channel with ID `0x15dbe6b996e4e46fdd6ea3e2074cbca58014dbb07368e3e7ba286df5c7b9da0d` - - Alice is a participant since `Them` address is `0xa8d2d06ace9c7ffc24ee785c2695678aecdfd7a0` - - Alice amount is `1000000` since `TheirBalance` corresponds to her amount - In ledger channel with ID `0x6a9f5ccf1fa802525d794f4a899897f947615f6acc7141e61e056a8bfca29179` - - Charlie is participant since `Them` address is `0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce` + - Alice is a participant since `Them` address is `0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce` + - Alice amount is `1000000` since `TheirBalance` corresponds to her amount + - In ledger channel with ID `0x15dbe6b996e4e46fdd6ea3e2074cbca58014dbb07368e3e7ba286df5c7b9da0d` + - Charlie is participant since `Them` address is `0xa8d2d06ace9c7ffc24ee785c2695678aecdfd7a0` - Charlie amount is `1000000` since `TheirBalance` corresponds to his amount ### Payments Demo in L2 @@ -733,7 +733,7 @@ # Expected output: # { # Amount: 200, - # ChannelId: '0x271aa07b32dc6c7d3b1cb9259a8dc86b82254d84a093ab695c7a4fc25fc402e3', + # ChannelId: '0xb29aeb32c9495a793ebf7bd116232075d1e7bfe89fc82281c7d498e3ffd3e3bf', # Signature: '0x8fbdb9bb91932b422c30cc07bf422e4f1c3ae1be1b60e01bbfcb193ae5c8f5b0571de84667d87b5ef9b737287faa0ddf41f1f9fc159673205679622c69fd69d81b' # } ``` @@ -770,8 +770,21 @@ ```bash laconic-so deployment --dir l2alice-nitro-deployment exec nitro-rpc-client "nitro-rpc-client get-all-ledger-channels -p 4005 -h nitro-node" - # Expected output: - # {"ID":"0x6a9f5ccf1fa802525d794f4a899897f947615f6acc7141e61e056a8bfca29179","Status":"Open","Balance":{"AssetAddress":"","Me":"0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce","Them":"0xbbb676f9cff8d242e9eac39d063848807d3d1d94","MyBalance":999800,"TheirBalance":1000200},"ChannelMode":"Open"} + # Expected output: + # [ + # { + # "ID": "0x6a9f5ccf1fa802525d794f4a899897f947615f6acc7141e61e056a8bfca29179", + # "Status": "Open", + # "Balance": { + # "AssetAddress": "", + # "Me": "0xaaa6628ec44a8a742987ef3a114ddfe2d4f7adce", + # "Them": "0xbbb676f9cff8d242e9eac39d063848807d3d1d94", + # "MyBalance": 999800, + # "TheirBalance": 1000200 + # }, + # "ChannelMode": "Open" + # } + # ] ``` - Note balance change in C' node: @@ -780,7 +793,20 @@ laconic-so deployment --dir l2charlie-nitro-deployment exec nitro-rpc-client "nitro-rpc-client get-all-ledger-channels -p 4005 -h nitro-node" # Expected output: - # {"ID":"0x15dbe6b996e4e46fdd6ea3e2074cbca58014dbb07368e3e7ba286df5c7b9da0d","Status":"Open","Balance":{"AssetAddress":"","Me":"0xa8d2d06ace9c7ffc24ee785c2695678aecdfd7a0","Them":"0xbbb676f9cff8d242e9eac39d063848807d3d1d94","MyBalance":1000200,"TheirBalance":999800},"ChannelMode":"Open"} + # [ + # { + # "ID": "0x15dbe6b996e4e46fdd6ea3e2074cbca58014dbb07368e3e7ba286df5c7b9da0d", + # "Status": "Open", + # "Balance": { + # "AssetAddress": "", + # "Me": "0xa8d2d06ace9c7ffc24ee785c2695678aecdfd7a0", + # "Them": "0xbbb676f9cff8d242e9eac39d063848807d3d1d94", + # "MyBalance": 1000200, + # "TheirBalance": 999800 + # }, + # "ChannelMode": "Open" + # } + # ] ``` ## Demo cleanup -- 2.45.2