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

Adding UNC bootnode. Starting bootnode at start (if keyfile exists)

parent 39548d9e
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,8 @@ if [ -z "${BFAHOME}" ]; then echo "\$BFAHOME not set. Did you source bfa/bin/env
source ${BFAHOME}/bin/libbfa.sh || exit 1
bootNICv4="enode://59ae768ecdee632e0daceccb6f71b215392eba89230d626573f2fb4e9c0786c9a661027ab7343820ca63d96fe48ffd81ed1bf6e4d512f0ba50ec072c9efd9e4e@[200.108.146.101]:30301"
bootnodes="${bootNICv4}"
bootUNCv4="enode://82b66b13d7addcf9ffe1e4e972a105f6ccf50557161c4a0978a5d9ce595ababde609ea8a49897ae89b1d41e90551cb2e9241363238593e950ca68bd5af7c24d6@[200.16.28.28]:30301"
bootnodes="${bootUNCv4},${bootNICv4}"
function accountlist
{
......@@ -55,9 +56,39 @@ then
echo Consider running: tail -n 1000 -F ${BFANODEDIR}/log
fi
# Start the node.
(
flock --nonblock --exclusive 9 || exit 1
function startbootnode
{
local keyfile=${BFANETWORKDIR}/bootnode/key
local pidfile=${BFANETWORKDIR}/bootnode/bootnode.pid
which bootnode >/dev/null 2>&1 || return
test -r $keyfile || return
(
flock --nonblock --exclusive 9 || (
echo "A bootnode is already running."
false
) || exit
while :
do
echo
echo '***'
echo
bootnode --nodekey $keyfile &
echo $! > $pidfile
wait
sleep 60
done 2>&1 | ${BFAHOME}/bin/log.sh ${BFANETWORKDIR}/bootnode/log &
) 9>> $pidfile
}
function startgeth
{
# Start the node.
which geth >/dev/null 2>&1 || return
(
flock --nonblock --exclusive 9 || (
echo "A geth is already running."
false
) || exit 1
echo ${BASHPID} > ${BFANODEDIR}/start-loop.pid
while :
do
......@@ -85,4 +116,8 @@ fi
wait
sleep 60
done 2>&1 | ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log &
) 9>> ${BFANODEDIR}/start-loop.pid
) 9>> ${BFANODEDIR}/start-loop.pid
}
startgeth
startbootnode
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