-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathstart-node.sh
executable file
·57 lines (50 loc) · 1.24 KB
/
start-node.sh
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
#!/usr/bin/env bash
start_poa_network() {
echo "Starting PoA network"
# hardcoded address of first account in keystore
ETHERBASE='0x1f7402f55e142820ea3812106d0657103fc1709e'
DATADIR="$HOME/.ethdata"
# Generate and store a wallet password
if [ ! -f $DATADIR ]; then
echo "Making data directory '$HOME/.ethdata'..."
mkdir -p $DATADIR
cp -R ./keystore $DATADIR
fi
# initialize our private network
geth \
--datadir $DATADIR \
--networkid 454545 \
--etherbase $ETHERBASE \
--targetgaslimit '6500000' \
init ./genesis.json
geth \
--rpc \
--rpcaddr '0.0.0.0' \
--rpcport 8545 \
--rpccorsdomain '*' \
--datadir $DATADIR \
--networkid 454545 \
--etherbase $ETHERBASE \
--targetgaslimit '6500000' \
js ./run-poa-node.js
}
start_instantseal_network() {
echo "Starting dev chain"
# start geth network with dev chain
geth \
--rpc \
--rpcaddr '0.0.0.0' \
--rpcport 8545 \
--rpccorsdomain '*' \
--dev \
--dev.period 1 \
--targetgaslimit '6500000' \
--nodiscover \
js ./run-dev-node.js
}
echo $DEV_CHAIN_ENABLED
if [ $DEV_CHAIN_ENABLED == true ]; then
start_instantseal_network
else
start_poa_network
fi