-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
61 lines (52 loc) · 1.53 KB
/
start.sh
File metadata and controls
61 lines (52 loc) · 1.53 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
59
60
61
#!/usr/bin/env sh
: ${NETWORK_ID:=41358}
: ${PORT:=30303}
: ${CACHE:=512}
: ${MAXPEERS:=512}
: ${ETHSTATS_NAME:=""}
: ${ETHSTATS_SECRET:=""}
: ${ETHSTATS_HOST:=""}
: ${ETHSTATS_PORT:=80}
: ${BOOTNODES:=""}
: ${LIGHTSERV:=50}
: ${LIGHTPEERS:=256}
: ${TARGETGASLIMIT:=4712388}
: ${GASPRICE:=18000000000}
: ${RPCPORT:=8545}
: ${RPCAPI:="[\"eth\", \"net\", \"web3\", \"shh\"]"}
: ${RPCCORSDOMAIN:="[\"*\"]"}
: ${ACCOUNT_FILE:=""}
nodetype=$1
case $nodetype in
boot)
TYPE_ARGS="--lightserv $LIGHTSERV --lightpeers $LIGHTPEERS --v5disc"
;;
signer)
TYPE_ARGS="--mine --targetgaslimit $TARGETGASLIMIT --gasprice $GASPRICE"
;;
api)
# TYPE_ARGS="--rpc --rpcaddr 0.0.0.0 --rpcport $RPCPORT --rpcapi $RPCAPI --rpccorsdomain $RPCCORSDOMAIN --shh"
TYPE_ARGS="--config /config.toml --shh"
;;
*)
echo "Invalid node type $nodetype"
exit 1
esac
GETH_ARGS="--networkid $NETWORK_ID --port $PORT --cache $CACHE --maxpeers $MAXPEERS $TYPE_ARGS"
if [ ! -z "$ETHSTATS_HOST" ]
then
GETH_ARGS="$GETH_ARGS --ethstats $ETHSTATS_NAME:$ETHSTATS_SECRET@$ETHSTATS_HOST:$ETHSTATS_PORT"
fi
if [ ! -z "$BOOTNODES" ]
then
GETH_ARGS="$GETH_ARGS --bootnodes $BOOTNODES"
fi
if [ ! -z "$ACCOUNT_FILE" ]
then
mkdir -p /root/.ethereum/keystore/ && cp /config/${ACCOUNT_FILE}.json /root/.ethereum/keystore/
GETH_ARGS="$GETH_ARGS --unlock 0 --password /config/${ACCOUNT_FILE}.pass"
fi
echo "NODETYPE: $nodetype"
echo "ARGS: $GETH_ARGS"
/usr/local/bin/geth init /config/genesis.json
/usr/local/bin/geth $GETH_ARGS