-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-geth
executable file
·64 lines (54 loc) · 1.48 KB
/
setup-geth
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
62
63
64
#!/bin/bash
# Initalize GETH on either the computer or the pi-pucks
# Header
cd $(dirname $0)
source globalconfig
# If data directory is not found
if [ ! -d "$MAIN_DIR" ]
then
mkdir $MAIN_DIR
echo "Created new data directory: $MAIN_DIR"
fi
cd $MAIN_DIR
# If the GETH process has not been initialized in the data directory
if [ ! -d "$MAIN_DIR/geth" ]
then
geth init $GENESIS_FILE \
--datadir $MAIN_DIR
echo "Initialized GETH with genesis block: $GENESIS_FILE"
fi
# If is a Pi-Puck
if [ $LOGNAME == "pi" ]
then
FILE="/boot/pi-puck_id"
ID=$(cat "$FILE")
else
ID="100"
fi
geth --datadir ${MAIN_DIR} \
--syncmode "full" \
--port 30311 \
--ws \
--ws.addr "0.0.0.0" \
--ws.port 3335 \
--ws.origins 172.17.0.0 \
--ws.api "personal,eth,net,web3,txpool,miner,admin" \
--networkid 1515 \
--allow-insecure-unlock \
--lightkdf \
--verbosity 0 \
--vmdebug \
--nodiscover \
--miner.gasprice "0x1" \
--miner.gastarget "0x1" \
--miner.gaslimit "0x9000000000" \
--nat=extip:"${SUBNET}.${ID}"
# Flags to maybe fix the peering delay issue
# --maxpendpeers 5 \
# --config ${MAIN_DIR}/geth/geth-config.toml
echo ${ID}
# --miner.gaslimit "0x9000000000000" \
[
"enode://bd270b952286994f08ce456c2ffe8e6e4dc5412e267f36bb1a63e08af2e1e4cb32938301403fbd5ada48b6f0449facc0359ad7556b2e321846c7d73aad6e88c3@172.27.1.114:30311?discport=0"
"enode://944e779609c92c82eae2d92f90e765c3dd2e6342619591a5ab2fa3aa83ff97fa46cdc425bc202f3f55d5a045a1e9a8249c4be54cf0027e0bf8998131d8d04437@172.27.1.106:30311?discport=0"
]