Skip to content
Snippets Groups Projects
Commit 7977e374 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

start.sh now loops forever, because geth is prone to die

parent 8d63fd95
No related branches found
No related tags found
No related merge requests found
...@@ -11,65 +11,73 @@ bootnodes="enode://${bootnodeid}@[$bootnodev6]:${bootnodeport},enode://${bootnod ...@@ -11,65 +11,73 @@ bootnodes="enode://${bootnodeid}@[$bootnodev6]:${bootnodeport},enode://${bootnod
bfaconfig max bfaconfig max
accts= function startgeth
for file in ${BFANODEDIR}/keystore/*--* {
do while :
do
echo
echo '***'
echo
set -x
geth \
--datadir ${BFANODEDIR} \
$( accountlist ) \
$( miner ) \
--networkid $BFANETWORKID \
--rpc \
--rpcport $rpcport \
--rpcapi "eth,net,web3,admin,clique,miner" \
--port $netport \
--syncmode full \
--nousb \
--bootnodes "${bootnodes}" \
--txpool.nolocals \
--txpool.accountslots 128 \
--txpool.globalslots 32768 \
--txpool.accountqueue 512 \
--txpool.globalqueue 8192 \
--extradata "${BFAEXTRADATA}" \
--cache 512 \
--verbosity 3 &
set +x
echo $! > ${BFANODEDIR}/geth.pid
wait
sleep 60
done
}
function accountlist
{
local accts=
for file in ${BFANODEDIR}/keystore/*--*
do
if [ -r "$file" ] if [ -r "$file" ]
then then
acct=$( echo $file | sed 's/^.*--//' ) acct=$( echo $file | sed 's/^.*--//' )
accts="${accts},${acct}" accts="${accts},${acct}"
fi fi
done done
# also, strip first comma # strip first comma
accts="--unlock ${accts:1}" echo "--password /dev/null --unlock ${accts:1}"
}
# touch the "miner" file if you are authorized to mine # touch the "miner" file if you are authorized to mine
# If you don't want to restart after touching the file, # If you don't want to restart after touching the file,
# you can use attach.sh and issue the command: # you can use attach.sh and issue the command:
# miner.start() # miner.start()
miner=
if [ -e "${BFANODEDIR}/miner" ]
then
miner="--miner"
fi
( function miner
echo {
echo '***' if [ -e "${BFANODEDIR}/miner" ]
echo then
# Start the miner. echo -- "--miner"
test -e "${BFANODEDIR}/geth.pid" || fi
touch ${BFANODEDIR}/geth.pid }
set -x
flock --nonblock --exclusive ${BFANODEDIR}/geth.pid \ # Start the miner.
geth \ test -e "${BFANODEDIR}/geth.pid" ||
--datadir ${BFANODEDIR} \ touch ${BFANODEDIR}/geth.pid
$accts \ flock --nonblock --exclusive ${BFANODEDIR}/geth.pid startgeth 2>&1 |
--password /dev/null \
$miner \
--networkid $BFANETWORKID \
--rpc \
--rpcport $rpcport \
--rpcapi "eth,net,web3,admin,clique,miner" \
--port $netport \
--syncmode full \
--nousb \
--bootnodes "${bootnodes}" \
--txpool.nolocals \
--txpool.accountslots 128 \
--txpool.globalslots 32768 \
--txpool.accountqueue 512 \
--txpool.globalqueue 8192 \
--extradata "${BFAEXTRADATA}" \
--cache 512 \
--verbosity 3 &
set +x
pid_flock=$!
pid_geth=$( ps -eo ppid,pid | awk "/$pid_flock /{print \$2}" | tail -1 )
if [ -n "$pid_geth" ]
then
echo $pid_geth > ${BFANODEDIR}/geth.pid
fi
) 2>&1 |
${BFAHOME}/bin/log.sh ${BFANODEDIR}/log & ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log &
if [ -t 1 ] if [ -t 1 ]
then then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment