aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-17 09:12:50 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:58 +0800
commit2818ad97f5b302f76e3296195bf8daae1868c435 (patch)
tree0e055a8dc82f8a473f877400074dffe7b811090c /test
parent9c9073db149d89eb31dc7c68d440b359f42fe8e9 (diff)
downloaddexon-2818ad97f5b302f76e3296195bf8daae1868c435.tar
dexon-2818ad97f5b302f76e3296195bf8daae1868c435.tar.gz
dexon-2818ad97f5b302f76e3296195bf8daae1868c435.tar.bz2
dexon-2818ad97f5b302f76e3296195bf8daae1868c435.tar.lz
dexon-2818ad97f5b302f76e3296195bf8daae1868c435.tar.xz
dexon-2818ad97f5b302f76e3296195bf8daae1868c435.tar.zst
dexon-2818ad97f5b302f76e3296195bf8daae1868c435.zip
dex: implement recovery mechanism (#258)
* dex: implement recovery mechanism The DEXON recovery protocol allows us to use the Ethereum blockchain as a fallback consensus chain to coordinate recovery. * fix
Diffstat (limited to 'test')
-rw-r--r--test/genesis.json9
-rwxr-xr-xtest/run_test.sh20
2 files changed, 20 insertions, 9 deletions
diff --git a/test/genesis.json b/test/genesis.json
index fc6cd7fe4..8be5a844d 100644
--- a/test/genesis.json
+++ b/test/genesis.json
@@ -19,6 +19,7 @@
"miningVelocity": 0.1875,
"nextHalvingSupply": "0x813f3978f89409844000000",
"lastHalvedAmount": "0x4d8c55aefb8c05b5c000000",
+ "minGasPrice": "0x3b9aca00",
"blockGasLimit": 40000000,
"lambdaBA": 250,
"lambdaDKG": 1500,
@@ -30,8 +31,12 @@
"0x21e19e0c9bab2400000",
"0x21e19e0c9bab2400000",
"0x152d02c7e14af6800000"
- ],
- "minGasPrice": "0x3b9aca00"
+ ]
+ },
+ "recovery": {
+ "contract": "0xf675c0e9bf4b949f50dcec5b224a70f0361d4680",
+ "timeout": 30,
+ "confirmation": 1
}
},
"nonce": "0x42",
diff --git a/test/run_test.sh b/test/run_test.sh
index 48934ab7c..b6db1ba09 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-NETWORK="--bootnodes enode://0478aa13c91aa0db8e93b668313b7eb0532fbdb24f64772375373b14dbe326c238ad09ab4469f6442c9a9753f1275aeec2e531912c14a958ed1feb4ae7e227ef@127.0.0.1:30301"
+BOOTNODE_FLAGS="--bootnodes enode://0478aa13c91aa0db8e93b668313b7eb0532fbdb24f64772375373b14dbe326c238ad09ab4469f6442c9a9753f1275aeec2e531912c14a958ed1feb4ae7e227ef@127.0.0.1:30301"
GENESIS="genesis.json"
GDEX="../build/bin/gdex"
@@ -42,10 +42,12 @@ __FILE__
# A standalone RPC server for accepting RPC requests.
datadir=$PWD/Dexon.rpc
-rm -rf $datadir
-$GDEX --datadir=$datadir init ${GENESIS}
+if [ "$1" != "--continue" ]; then
+ rm -rf $datadir
+ $GDEX --datadir=$datadir init ${GENESIS}
+fi
$GDEX \
- ${NETWORK} \
+ ${BOOTNODE_FLAGS} \
--verbosity=3 \
--gcmode=archive \
--datadir=$datadir --nodekey=keystore/rpc.key \
@@ -61,15 +63,19 @@ NUM_NODES=$(cat ${GENESIS} | grep 'DEXON Test Node' | wc -l)
# Nodes
for i in $(seq 0 $(($NUM_NODES - 1))); do
datadir=$PWD/Dexon.$i
- rm -rf $datadir
- $GDEX --datadir=$datadir init ${GENESIS}
+
+ if [ "$1" != "--continue" ]; then
+ rm -rf $datadir
+ $GDEX --datadir=$datadir init ${GENESIS}
+ fi
$GDEX \
- ${NETWORK} \
+ ${BOOTNODE_FLAGS} \
--bp \
--verbosity=4 \
--gcmode=archive \
--datadir=$datadir --nodekey=keystore/test$i.key \
--port=$((30305 + $i)) \
+ --recovery.network-rpc="https://rinkeby.infura.io" \
--rpc --rpcapi=eth,net,web3,debug \
--rpcaddr=0.0.0.0 --rpcport=$((8547 + $i * 2)) \
--ws --wsapi=eth,net,web3,debug \