-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_node.sh
More file actions
executable file
·58 lines (51 loc) · 1.69 KB
/
start_node.sh
File metadata and controls
executable file
·58 lines (51 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
BOOTNODE_IP=$(getent hosts ${bootnode_name} | awk '{print $1;}')
CHAIN_DATA_DIR=$geth_home/chain_dir/
GETH_BIN=${geth_home}/geth/geth
CHAIN_KEYSTORE=$CHAIN_DATA_DIR/keystore/
NODE_IP=$(awk 'END{print $1}' /etc/hosts)
mkdir -p $CHAIN_KEYSTORE
case $eth_acc in
acc1)
ACC=92f4f00f2f5355f5ec1c55512118f1fa537b1864
;;
acc2)
ACC=f27292834a6b7129e5ad00e264062c978c48d705
;;
acc3)
ACC=830de593b42d3a007e19553c68f0f4c95e0e6e8f
;;
esac
if [[ ! -z $ACC ]]; then
echo "Using account $ACC"
cp $geth_home/keystore/$ACC $CHAIN_KEYSTORE/
ACC_UNLOCK="--unlock 0x$ACC --password $geth_home/password"
fi
echo "running: $GETH_BIN init $geth_home/genesis.json --datadir $CHAIN_DATA_DIR"
$GETH_BIN init $geth_home/genesis.json --datadir $CHAIN_DATA_DIR
echo "$GETH_BIN
--datadir $CHAIN_DATA_DIR
--networkid 12345
--bootnodes enode://$(cat $geth_home/bootnode_id)@$BOOTNODE_IP:30301
--syncmode full
--rpc
--rpcaddr ${NODE_IP}
$ACC_UNLOCK
--mine
--etherbase 0x$ACC
--preload $geth_home/package_delivery_contract.js,$geth_home/package_delivery.js
console
"
$GETH_BIN \
--datadir $CHAIN_DATA_DIR \
--networkid 12345 \
--bootnodes enode://$(cat $geth_home/bootnode_id)@$BOOTNODE_IP:30301 \
--syncmode full \
--rpc \
--rpcaddr ${NODE_IP} \
$ACC_UNLOCK \
--mine \
--etherbase 0x$ACC \
--preload $geth_home/package_delivery_contract.js,$geth_home/package_delivery.js \
console
# --ethash.dagdir $geth_home/.ethash \