From 7123c554508b449b46f13852b73a9c68c2aac254 Mon Sep 17 00:00:00 2001 From: arocha Date: Mon, 18 Dec 2017 12:08:10 +0100 Subject: [PATCH] In progress IBFT scripts --- data/config.toml | 2 ++ data/genesis.json | 39 ++++++++++++++++++++++++--------------- scripts/init.sh | 15 +++++++++++++-- 3 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 data/config.toml diff --git a/data/config.toml b/data/config.toml new file mode 100644 index 0000000..da8d05e --- /dev/null +++ b/data/config.toml @@ -0,0 +1,2 @@ +vanity = "0x00" +validators = ["0xb87dC349944CC47474775DDe627A8a171fC94532"] \ No newline at end of file diff --git a/data/genesis.json b/data/genesis.json index 0c03c42..58e5aec 100644 --- a/data/genesis.json +++ b/data/genesis.json @@ -1,16 +1,25 @@ { - "alloc": { - "0x58b8527743f89389b754c63489262fdfc9ba9db6" : {"balance" : "1000000000000000000000000000"} - }, - "coinbase": "0x0000000000000000000000000000000000000000", - "config": { - "homesteadBlock": 0 - }, - "difficulty": "0x0", - "extraData": "0x", - "gasLimit": "0x2FEFD800", - "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578", - "nonce": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": "0x00" -} \ No newline at end of file +   "alloc": { +   "0x58b8527743f89389b754c63489262fdfc9ba9db6" : {"balance" : "1000000000000000000000000000"} +   }, +   "coinbase": "0x0000000000000000000000000000000000000000", +   "config": { +   "homesteadBlock": 1, +   "eip150Block": 2, +   "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", +   "eip155Block": 3, +   "eip158Block": 3, +   "istanbul": { +   "epoch": 30000, +   "policy": 0 +   }, +   "isQuorum": true +   }, +   "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000f85ad5943c7694292b0327595500746b5f7707843a4a4a8cb8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0", +   "gasLimit": "0x2FEFD800", +   "difficulty": "0x1", +   "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", +   "nonce": "0x0", +   "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", +   "timestamp": "0x00" + } \ No newline at end of file diff --git a/scripts/init.sh b/scripts/init.sh index 380e27b..3927990 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -2,13 +2,18 @@ set -u set -e -MESSAGE="Usage: init CURRENT_HOST_IP | auto | backup" -if ( [ $# -ne 1 ] ); then +MESSAGE='Usage: init + mode: CURRENT_HOST_IP | auto | backup + node-type: validator | general + node-name: NODE_NAME (example: Alastria)' + +if ( [ $# -ne 4 ] ); then echo "$MESSAGE" exit fi CURRENT_HOST_IP="$1" +NODE_NAME="$3" if ( [ "auto" == "$1" -o "backup" == "$1" ]); then echo "Autodiscovering public host IP ..." @@ -31,6 +36,12 @@ if ( [ "backup" == "$1" ]); then cp ~/alastria/data/geth/nodekey ~/alastria-keysBackup/data/geth/nodekey fi +if ( [ "validator" == "$2" ]); then + echo "Selected node type validator..." +elif ( [ "general" == "$2" ]); then + echo "Selected node type validator..." +fi + PWD="$(pwd)" CONSTELLATION_NODES=$(cat ../data/constellation-nodes.json) STATIC_NODES=$(cat ../data/static-nodes.json)