From 6e1899f23e011756ca21ce8b97ddcc6b293a3268 Mon Sep 17 00:00:00 2001 From: EbubeUd Date: Tue, 22 Jun 2021 05:37:14 +0000 Subject: [PATCH] deploy: 57a55071ff400607120437b87382e51f265d9bf6 --- docs/tutorial/swap.md | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 docs/tutorial/swap.md diff --git a/docs/tutorial/swap.md b/docs/tutorial/swap.md new file mode 100644 index 000000000..78fc148b5 --- /dev/null +++ b/docs/tutorial/swap.md @@ -0,0 +1,50 @@ +# Running Swap Protocol + +## How to + +Build: + +``` +# make wakunode2 is run as part of scripts2 target +make scripts2 +``` + +Run two nodes and connect them: + +``` +# Starts listening on 60000 with RPC server on 8545. +# Note the "listening on address" in logs. +./build/wakunode2 --ports-shift:0 + +# Run another node with staticnode argument +./build/wakunode2 --ports-shift:1 --staticnode:/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmF4tuht6fmna6uDqoSMgFqhUrdaVR6VQRyGr6sCpfS2jp --storenode:/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmF4tuht6fmna6uDqoSMgFqhUrdaVR6VQRyGr6sCpfS2jp --persist-messages:true + + +# Run the chat application +./build/chat2 --staticnode:/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmF4tuht6fmna6uDqoSMgFqhUrdaVR6VQRyGr6sCpfS2jp --storenode:/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmF4tuht6fmna6uDqoSMgFqhUrdaVR6VQRyGr6sCpfS2jp + +``` + You should be prompted to provide a nickname for the chat session. + +``` +Choose a nickname >> +``` + +After entering a nickname, the app will be connected to peer `16Uiu2HAmF4tuht6fmna6uDqoSMgFqhUrdaVR6VQRyGr6sCpfS2jp` + +``` + +# Run another chat application +./build/chat2 --staticnode:/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmF4tuht6fmna6uDqoSMgFqhUrdaVR6VQRyGr6sCpfS2jp --storenode:/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmF4tuht6fmna6uDqoSMgFqhUrdaVR6VQRyGr6sCpfS2jp +``` +Connect with a different nickname. +You should see a log saying: +``` +Crediting Peer: peer=16U*CpfS2jp amount=1 +``` + where amount is the number of Messages received. + + +## To View the Account Metrics: +To view the account metrics on Grafana Dashboard locally, follow the steps [here](https://github.com/status-im/nim-waku/tree/master/waku/v2#using-metrics) to set up grafana and prometheus. +The metrics on the live cluster can be accessed [here](https://grafana.infra.status.im/d/qrp_ZCTGz/nim-waku-v2?orgId=1&refresh=5m) \ No newline at end of file