forked from XinFinOrg/XinFin-Node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-node.sh
executable file
·32 lines (29 loc) · 1.11 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
#!/bin/bash
if [ ! -d /work/xdcchain/XDC/chaindata ]
then
wallet=$(XDC account new --password /work/.pwd --datadir /work/xdcchain | awk -v FS="({|})" '{print $2}')
echo "Initalizing Genesis Block"
coinbaseaddr="0x$wallet"
coinbasefile=/work/xdcchain/coinbase.txt
touch $coinbasefile
if [ -f "$coinbasefile" ]
then
echo "$coinbaseaddr" > "$coinbasefile"
fi
XDC --datadir /work/xdcchain init /work/genesis.json
else
wallet=$(XDC account list --datadir /work/xdcchain| head -n 1 | awk -v FS="({|})" '{print $2}')
fi
input="/work/bootnodes.list"
bootnodes=""
while IFS= read -r line
do
if [ -z "${bootnodes}" ]
then
bootnodes=$line
else
bootnodes="${bootnodes},$line"
fi
done < "$input"
echo "Starting nodes with $bootnodes ..."
XDC --bootnodes ${bootnodes} --syncmode "full" --datadir /work/xdcchain --networkid 89 -port 30303 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcport 8545 --rpcvhosts "*" --unlock "${wallet}" --password /work/.pwd --mine --gasprice "1" --targetgaslimit "420000000" --verbosity 3 --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,XDPoS