From 7814d622fd45d12d291780b672048ff80463cef5 Mon Sep 17 00:00:00 2001 From: axb-topos Date: Wed, 10 Aug 2022 16:53:35 +0300 Subject: [PATCH] test: put all the local testing snippets into single file --- scripts/api_curl.sh | 2 - scripts/cert1.json | 8 ---- scripts/cert2.json | 8 ---- scripts/cert3.json | 8 ---- scripts/cert_post.json | 8 ---- scripts/kad_test_launches.sh | 20 --------- scripts/local_test_launches_snippets.sh | 57 +++++++++++++++++++++++++ scripts/post_3_certs.sh | 15 ------- 8 files changed, 57 insertions(+), 69 deletions(-) delete mode 100644 scripts/api_curl.sh delete mode 100644 scripts/cert1.json delete mode 100644 scripts/cert2.json delete mode 100644 scripts/cert3.json delete mode 100644 scripts/cert_post.json delete mode 100644 scripts/kad_test_launches.sh create mode 100644 scripts/local_test_launches_snippets.sh delete mode 100755 scripts/post_3_certs.sh diff --git a/scripts/api_curl.sh b/scripts/api_curl.sh deleted file mode 100644 index 88ca37e02..000000000 --- a/scripts/api_curl.sh +++ /dev/null @@ -1,2 +0,0 @@ -# script snippets to manually test node api -curl -d @cert_post.json http://localhost:8012/certs diff --git a/scripts/cert1.json b/scripts/cert1.json deleted file mode 100644 index bb962c391..000000000 --- a/scripts/cert1.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "cert" : { - "id": 1, - "prev_cert_id": 0, - "initial_subnet_id": 100, - "calls": [] - } -} diff --git a/scripts/cert2.json b/scripts/cert2.json deleted file mode 100644 index 2b0b8c9a8..000000000 --- a/scripts/cert2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "cert" : { - "id": 2, - "prev_cert_id": 1, - "initial_subnet_id": 100, - "calls": [] - } -} diff --git a/scripts/cert3.json b/scripts/cert3.json deleted file mode 100644 index 9a0845e3d..000000000 --- a/scripts/cert3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "cert" : { - "id": 3, - "prev_cert_id": 2, - "initial_subnet_id": 100, - "calls": [] - } -} diff --git a/scripts/cert_post.json b/scripts/cert_post.json deleted file mode 100644 index bb962c391..000000000 --- a/scripts/cert_post.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "cert" : { - "id": 1, - "prev_cert_id": 0, - "initial_subnet_id": 100, - "calls": [] - } -} diff --git a/scripts/kad_test_launches.sh b/scripts/kad_test_launches.sh deleted file mode 100644 index 22267abbe..000000000 --- a/scripts/kad_test_launches.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/zsh - -export RUST_LOG="warn,topos_tce_node_app=trace,topos_tce_protocols_reliable_broadcast=trace" - -export RUST_LOG="debug,libp2p=warn" - -# 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /ip4/127.0.0.1/tcp/30001 -cargo run -- --local-key-seed 1 --tce-local-port 30001 --web-api-local-port 8011 - -# 12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3 /ip4/127.0.0.1/tcp/30002 -cargo run -- --local-key-seed 2 --tce-local-port 30002 --web-api-local-port 8012 --boot-peers "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /dns4/localhost/tcp/30001" - -# 12D3KooWQYhTNQdmr3ArTeUHRYzFg94BKyTkoWBDWez9kSCVe2Xo /ip4/127.0.0.1/tcp/30003 -cargo run -- --local-key-seed 3 --tce-local-port 30003 --web-api-local-port 8013 --boot-peers "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /ip4/127.0.0.1/tcp/30001" - -# 12D3KooWLJtG8fd2hkQzTn96MrLvThmnNQjTUFZwGEsLRz5EmSzc /ip4/127.0.0.1/tcp/30004 -cargo run -- --local-key-seed 4 --tce-local-port 30004 --web-api-local-port 8014 --boot-peers "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /ip4/127.0.0.1/tcp/30001" - -# 12D3KooWSHj3RRbBjD15g6wekV8y3mm57Pobmps2g2WJm6F67Lay /ip4/127.0.0.1/tcp/30005 -cargo run -- --local-key-seed 5 --tce-local-port 30005 --web-api-local-port 8015 --boot-peers "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /ip4/127.0.0.1/tcp/30001" diff --git a/scripts/local_test_launches_snippets.sh b/scripts/local_test_launches_snippets.sh new file mode 100644 index 000000000..79107c834 --- /dev/null +++ b/scripts/local_test_launches_snippets.sh @@ -0,0 +1,57 @@ + +# +# deep but not obtrusive logging +# +export RUST_LOG="debug,libp2p=warn" + +# +# 5 nodes - boot node + 4 peers +# + +# 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /ip4/127.0.0.1/tcp/30001 +cargo run -- --local-key-seed 1 --tce-local-port 30001 --web-api-local-port 8011 + +# 12D3KooWH3uVF6wv47WnArKHk5p6cvgCJEb74UTmxztmQDc298L3 /ip4/127.0.0.1/tcp/30002 +cargo run -- --local-key-seed 2 --tce-local-port 30002 --web-api-local-port 8012 --boot-peers "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /dns4/localhost/tcp/30001" + +# 12D3KooWQYhTNQdmr3ArTeUHRYzFg94BKyTkoWBDWez9kSCVe2Xo /ip4/127.0.0.1/tcp/30003 +cargo run -- --local-key-seed 3 --tce-local-port 30003 --web-api-local-port 8013 --boot-peers "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /ip4/127.0.0.1/tcp/30001" + +# 12D3KooWLJtG8fd2hkQzTn96MrLvThmnNQjTUFZwGEsLRz5EmSzc /ip4/127.0.0.1/tcp/30004 +cargo run -- --local-key-seed 4 --tce-local-port 30004 --web-api-local-port 8014 --boot-peers "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /ip4/127.0.0.1/tcp/30001" + +# 12D3KooWSHj3RRbBjD15g6wekV8y3mm57Pobmps2g2WJm6F67Lay /ip4/127.0.0.1/tcp/30005 +cargo run -- --local-key-seed 5 --tce-local-port 30005 --web-api-local-port 8015 --boot-peers "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X /ip4/127.0.0.1/tcp/30001" + +# +# posting 3 certificates (to the second peer) +# +curl -X POST http://localhost:8012/certs -H "Content-Type: application/json" -d '{ + "cert" : { + "id": 1, + "prev_cert_id": 0, + "initial_subnet_id": 100, + "calls": [] + } + } +' + +curl -X POST http://localhost:8012/certs -H "Content-Type: application/json" -d '{ + "cert" : { + "id": 2, + "prev_cert_id": 1, + "initial_subnet_id": 100, + "calls": [] + } + } +' + +curl -X POST http://localhost:8012/certs -H "Content-Type: application/json" -d '{ + "cert" : { + "id": 3, + "prev_cert_id": 2, + "initial_subnet_id": 100, + "calls": [] + } + } +' diff --git a/scripts/post_3_certs.sh b/scripts/post_3_certs.sh deleted file mode 100755 index cf119ba14..000000000 --- a/scripts/post_3_certs.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/zsh - -echo "1-st" -curl -d @cert1.json http://localhost:8012/certs -echo "" -sleep 5 - -echo "2-nd" -curl -d @cert2.json http://localhost:8012/certs -echo "" -sleep 5 - -echo "3-rd" -curl -d @cert3.json http://localhost:8012/certs -echo ""