From a60850aa36bb0d1c277ba34fd71c842c664fdf96 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Fri, 23 Aug 2024 11:11:17 +0530 Subject: [PATCH] Check payment channel after making payment --- nitro-bridge-demo.md | 4 ++-- nitro-node-demo.md | 51 ++++++++++++++++++++++++++++++-------------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/nitro-bridge-demo.md b/nitro-bridge-demo.md index d5aaea2..4e09343 100644 --- a/nitro-bridge-demo.md +++ b/nitro-bridge-demo.md @@ -731,7 +731,7 @@ - Reset nitro-node deployments: - - Stop nitro-node deployments and remove volumes: + - Stop nitro-node, bridge, nitro-contracts deployments and remove volumes: ```bash # Run where deployments are created @@ -743,7 +743,7 @@ laconic-so deployment --dir nitro-contracts-deployment stop --delete-volumes ``` - - Clear nitro-node and bridge deployments: + - Clear nitro-node, nitro-contracts and bridge deployments: ```bash # Run where deployments are created diff --git a/nitro-node-demo.md b/nitro-node-demo.md index b545a72..bc8e6f2 100644 --- a/nitro-node-demo.md +++ b/nitro-node-demo.md @@ -316,7 +316,19 @@ - Create virtual channel from Alice to Charlie ```bash - laconic-so deployment --dir alice-nitro-deployment exec nitro-rpc-client "nitro-rpc-client virtual-fund 0x03Eb7a84E286c671836b9897AaE24b31D36f9cA8 --amount 1000 -p 4005 -h nitro-node" + laconic-so deployment --dir alice-nitro-deployment exec nitro-rpc-client "nitro-rpc-client virtual-fund 0x03Eb7a84E286c671836b9897AaE24b31D36f9cA8 --amount 1000 -p 4005 -h nitro-node" + ``` + +- Set the payment channel id in a variable + + ```bash + PAYMENT_CHANNEL_ID= + ``` + +- Check payment channel between Alice and Charlie + + ```bash + laconic-so deployment --dir alice-nitro-deployment exec nitro-rpc-client "nitro-rpc-client get-payment-channel $PAYMENT_CHANNEL_ID -p 4005 -h nitro-node" # Expected output: # { @@ -332,18 +344,6 @@ # } ``` -- Set the payment channel id in a variable - - ```bash - PAYMENT_CHANNEL_ID= - ``` - -- Check payment channel between Alice and Charlie - - ```bash - laconic-so deployment --dir alice-nitro-deployment exec nitro-rpc-client "nitro-rpc-client get-payment-channel $PAYMENT_CHANNEL_ID -p 4005 -h nitro-node" - ``` - - After virtual fund objective is complete, make payments ```bash @@ -356,7 +356,26 @@ # } ``` -- Close payment channel after payments +- Check payment channel between Alice and Charlie after payment + + ```bash + laconic-so deployment --dir alice-nitro-deployment exec nitro-rpc-client "nitro-rpc-client get-payment-channel $PAYMENT_CHANNEL_ID -p 4005 -h nitro-node" + + # Expected output: + # { + # ID: '0xf982de03e17fd8ff30b138f142bc17c3deb24a48ec38b41c13e621fa65172f3c', + # Status: 'Open', + # Balance: { + # AssetAddress: '0x0000000000000000000000000000000000000000', + # Payee: '0x03eb7a84e286c671836b9897aae24b31d36f9ca8', + # Payer: '0x4b64e26da8279ab12bcd4ca9974ec2b4741e175e', + # PaidSoFar: 200n, + # RemainingFunds: 800n + # } + # } + ``` + +- Close payment channel ```bash laconic-so deployment --dir alice-nitro-deployment exec nitro-rpc-client "nitro-rpc-client virtual-defund $PAYMENT_CHANNEL_ID -p 4005 -h nitro-node" @@ -393,7 +412,7 @@ - Reset nitro-node deployments: - - Stop nitro-node deployments and remove volumes: + - Stop nitro-node, nitro-contracts deployments and remove volumes: ```bash # Run where deployments are created @@ -402,7 +421,7 @@ laconic-so deployment --dir nitro-contracts-deployment stop --delete-volumes ``` - - Clear nitro-node and bridge deployments: + - Clear nitro-node and nitro-contracts deployments: ```bash # Run where deployments are created