test: script to test full workflow
authorAJ ONeal <coolaj86@gmail.com>
Tue, 21 Jun 2022 05:20:15 +0000 (23:20 -0600)
committerAJ ONeal <coolaj86@gmail.com>
Tue, 21 Jun 2022 05:22:09 +0000 (23:22 -0600)
test.sh [new file with mode: 0644]

diff --git a/test.sh b/test.sh
new file mode 100644 (file)
index 0000000..4688d1b
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -e
+set -u
+
+if [[ ! -e 'source-key.wif' ]]; then
+    echo "Please run 'crowdnode generate ./source-key.wif' and load it with Đ0.01 to start"
+    exit 1
+fi
+
+./bin/crowdnode.js generate ./staking-key.wif
+(
+    set -e
+    set -u
+    sleep 0.5
+    ./bin/crowdnode.js transfer source-key.wif ./staking-key.wif 0.00256000
+) &
+./bin/crowdnode.js signup ./staking-key.wif
+./bin/crowdnode.js accept ./staking-key.wif
+(
+    set -e
+    set -u
+    sleep 0.5
+    ./bin/crowdnode.js transfer source-key.wif ./staking-key.wif
+) &
+./bin/crowdnode.js deposit ./staking-key.wif
+./bin/crowdnode.js withdrawal ./staking-key.wif 100.0
+./bin/crowdnode.js balance ./staking-key.wif
+./bin/crowdnode.js transfer ./staking-key.wif ./source-key.wif