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

Supporting multiple accounts easier

parent 8638238f
No related branches found
No related tags found
No related merge requests found
...@@ -10,18 +10,42 @@ bootnodeport=5445 ...@@ -10,18 +10,42 @@ bootnodeport=5445
bootnodes="enode://${bootnodeid}@[$bootnodev6]:${bootnodeport},enode://${bootnodeid}@[$bootnodev4]:${bootnodeport}" bootnodes="enode://${bootnodeid}@[$bootnodev6]:${bootnodeport},enode://${bootnodeid}@[$bootnodev4]:${bootnodeport}"
bfaconfig max bfaconfig max
accts=
for file in ${BFANODEDIR}/keystore/*--*
do
if [ -r "$file" ]
then
acct=$( echo $file | sed 's/^.*--//' )
accts="${accts},${acct}"
fi
done
# also, strip first comma
accts="--unlock ${accts:1}"
# touch the "miner" file if you are authorized to mine
# If you don't want to restart after touching the file,
# you can use attach.sh and issue the command:
# miner.start()
miner=
if [ -e "${BFANODEDIR}/miner" ]
then
miner="--miner"
fi
( (
echo echo
echo '***' echo '***'
echo echo
set -x
# Start the miner. # Start the miner.
exec flock --nonblock --exclusive ${BFANODEDIR}/rpcport \ test -e "${BFANODEDIR}/geth.pid" ||
touch ${BFANODEDIR}/geth.pid
set -x
flock --nonblock --exclusive ${BFANODEDIR}/geth.pid \
geth \ geth \
--datadir ${BFANODEDIR} \ --datadir ${BFANODEDIR} \
--unlock "$account" \ $accts \
--password /dev/null \ --password /dev/null \
--mine \ $miner \
--networkid $BFANETWORKID \ --networkid $BFANETWORKID \
--rpc \ --rpc \
--rpcport $rpcport \ --rpcport $rpcport \
...@@ -36,13 +60,19 @@ bfaconfig max ...@@ -36,13 +60,19 @@ bfaconfig max
--txpool.accountqueue 512 \ --txpool.accountqueue 512 \
--txpool.globalqueue 8192 \ --txpool.globalqueue 8192 \
--extradata "${BFAEXTRADATA}" \ --extradata "${BFAEXTRADATA}" \
--gcmode archive \
--cache 512 \ --cache 512 \
--verbosity 3 --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 | ) 2>&1 |
${BFAHOME}/bin/log.sh ${BFANODEDIR}/log & ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log &
if [ -t 1 ] if [ -t 1 ]
then then
echo Logging everything to ${BFANODEDIR}/log echo Logging everything to ${BFANODEDIR}/log
echo Consider running: tail -F ${BFANODEDIR}/log echo Consider running: tail -n 1000 -F ${BFANODEDIR}/log
fi fi
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