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

archivos de pid tambien funciona para los start-*.pid

parent 9cd333b9
No related branches found
No related tags found
No related merge requests found
...@@ -34,21 +34,23 @@ function startbootnode ...@@ -34,21 +34,23 @@ function startbootnode
echo "A bootnode is already running." echo "A bootnode is already running."
false false
) || exit ) || exit
echo ${BASHPID} > ${BFANETWORKDIR}/start-bootnode-loop.pid
if [ -t 1 ] if [ -t 1 ]
then then
echo Starting bootnode. echo Starting bootnode.
fi fi
while : (
do echo ${BASHPID} > ${BFANETWORKDIR}/start-bootnode-loop.pid
echo while :
echo '***' do
echo echo
bootnode --nodekey $keyfile & echo '***'
echo $! > $pidfile echo
wait bootnode --nodekey $keyfile &
sleep 60 echo $! > $pidfile
done 2>&1 | ${BFAHOME}/bin/log.sh ${BFANETWORKDIR}/bootnode/log & wait
sleep 60
done
) 2>&1 | ${BFAHOME}/bin/log.sh ${BFANETWORKDIR}/bootnode/log &
) 9>> $pidfile ) 9>> $pidfile
} }
...@@ -66,8 +68,8 @@ function startmonitor ...@@ -66,8 +68,8 @@ function startmonitor
echo "A monitor is already running." echo "A monitor is already running."
false false
) || exit ) || exit
echo ${BASHPID} > ${BFANETWORKDIR}/start-monitor-loop.pid
( (
echo ${BASHPID} > ${BFANETWORKDIR}/start-monitor-loop.pid
while : while :
do do
monitor.js & monitor.js &
...@@ -119,6 +121,53 @@ function geth_capab ...@@ -119,6 +121,53 @@ function geth_capab
fi fi
} }
function geth_args
{
# (re)configure parameters (you never know if they changed)
flexargs="$( getsyncmode )"
geth_capab
xtra=$( extradata )
if [ -n "$xtra" ]
then
flexargs="${flexargs} --extradata $( extradata )"
fi
unset xtra
#
if [ "$netport" != 30303 ]
then
flexargs="${flexargs} --port $netport"
fi
if [ "$rpcport" != 30303 ]
then
flexargs="${flexargs} --rpcport $rpcport"
fi
if [ -n "$BFAVERBOSITY" -a "$BFAVERBOSITY" != 3 ]
then
flexargs="${flexargs} --verbosity ${BFAVERBOSITY:-3}"
fi
# the basic modules
rpcapis="eth,net,web3,clique"
if [ -e "${BFANODEDIR}/opentx" ]
then
# If you want other hostnames, put them in this file (comma separated)
read txhostnames dummy < ${BFANODEDIR}/opentx
if [ "${txhostnames}" = "" ]
then
# but if you don't put any hostnames, these are the defaults
txhostnames="localhost,opentx.bfa.ar"
fi
flexargs="${flexargs} --rpcvhosts ${txhostnames}"
# INADDR_ANY - listen on all addresses
flexargs="${flexargs} --rpcaddr 0.0.0.0"
# Oh, and don't put your keys in / because we use that as a dummy directory
flexargs="${flexargs} --keystore /"
else
# expose more modules, if we are a private node (localhost'ed)
rpcapis="${rpcapis},admin,miner,personal"
fi
flexargs="${flexargs} --rpcapi ${rpcapis}"
}
function startgeth function startgeth
{ {
# Start the node. # Start the node.
...@@ -131,7 +180,6 @@ function startgeth ...@@ -131,7 +180,6 @@ function startgeth
echo "A geth is already running." echo "A geth is already running."
false false
) || exit 1 ) || exit 1
echo ${BASHPID} > ${BFANETWORKDIR}/start-geth-loop.pid
if [ -t 1 ] if [ -t 1 ]
then then
echo Starting geth echo Starting geth
...@@ -139,74 +187,34 @@ function startgeth ...@@ -139,74 +187,34 @@ function startgeth
echo Consider running: bfalog.sh echo Consider running: bfalog.sh
fi fi
loop_counter=0 loop_counter=0
while : (
do echo ${BASHPID} > ${BFANETWORKDIR}/start-geth-loop.pid
loop_counter=$(( ${loop_counter} + 1 )) while :
ERRTEXT="geth" do
echo loop_counter=$(( ${loop_counter} + 1 ))
echo '***' ERRTEXT="geth"
echo "*** loop #${loop_counter}" echo
echo '***' echo '***'
echo echo "*** loop #${loop_counter}"
# (re)configure parameters (you never know if they changed) echo '***'
flexargs="$( getsyncmode )" echo
geth_capab geth_args
# set -x
xtra=$( extradata ) geth \
if [ -n "$xtra" ] --datadir ${BFANODEDIR} \
then --networkid ${BFANETWORKID} \
flexargs="${flexargs} --extradata $( extradata )" --rpc \
fi --gcmode archive \
unset xtra ${flexargs} \
# --rpccorsdomain \* \
if [ "$netport" != 30303 ] --bootnodes "${bootnodes}" &
then set +x
flexargs="${flexargs} --port $netport" echo $! > $pidfile
fi rv=0
if [ "$rpcport" != 30303 ] wait -n || rv=$?
then sleep 60
flexargs="${flexargs} --rpcport $rpcport" done
fi ) 2>&1 | ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log &
if [ -n "$BFAVERBOSITY" -a "$BFAVERBOSITY" != 3 ]
then
flexargs="${flexargs} --verbosity ${BFAVERBOSITY:-3}"
fi
# the basic modules
rpcapis="eth,net,web3,clique"
if [ -e "${BFANODEDIR}/opentx" ]
then
# If you want other hostnames, put them in this file (comma separated)
read txhostnames dummy < ${BFANODEDIR}/opentx
if [ "${txhostnames}" = "" ]
then
# but if you don't put any hostnames, these are the defaults
txhostnames="localhost,opentx.bfa.ar"
fi
flexargs="${flexargs} --rpcvhosts ${txhostnames}"
# INADDR_ANY - listen on all addresses
flexargs="${flexargs} --rpcaddr 0.0.0.0"
# Oh, and don't put your keys in / because we use that as a dummy directory
flexargs="${flexargs} --keystore /"
else
# expose more modules, if we are a private node (localhost'ed)
rpcapis="${rpcapis},admin,miner,personal"
fi
flexargs="${flexargs} --rpcapi ${rpcapis}"
set -x
geth \
--datadir ${BFANODEDIR} \
--networkid ${BFANETWORKID} \
--rpc \
--gcmode archive \
${flexargs} \
--rpccorsdomain \* \
--bootnodes "${bootnodes}" &
set +x
echo $! > $pidfile
rv=0
wait -n || rv=$?
sleep 60
done 2>&1 | ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log &
) 9>> $pidfile ) 9>> $pidfile
} }
......
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