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

Make sure we have an account

parent 9c5f21b3
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
NODEJSPGP=0x68576280 NODEJSPGP=0x68576280
# /root often does not have enough space, so we create a directory in /home
# for building, which we hope has more space.
NEW=/home/root/new
trap 'exit 1' ERR trap 'exit 1' ERR
set -o errtrace set -o errtrace
# Be verbose # Be verbose
...@@ -62,8 +66,8 @@ function golanginstall ...@@ -62,8 +66,8 @@ function golanginstall
if [ ! -d /usr/local/go ] if [ ! -d /usr/local/go ]
then then
info Downloading package of go binaries. info Downloading package of go binaries.
mkdir -p ~/new mkdir -p ${NEW}
cd ~/new cd ${NEW}
local arch= local arch=
case "$(uname -m)" in case "$(uname -m)" in
x86_64) x86_64)
...@@ -105,21 +109,21 @@ function golanginstall ...@@ -105,21 +109,21 @@ function golanginstall
function gethinstall function gethinstall
{ {
mkdir -p ~/new mkdir -p ${NEW}
cd ~/new cd ${NEW}
info Download geth source code. info Download geth source code.
test -d go-ethereum || test -d go-ethereum ||
git clone https://github.com/ethereum/go-ethereum git clone https://github.com/ethereum/go-ethereum
cd ~/new/go-ethereum cd ${NEW}/go-ethereum
info Running git pull to ensure that the local go-ethereum repo is up-to-date. info Running git pull to ensure that the local go-ethereum repo is up-to-date.
git pull git pull
# #
cd ~/new/go-ethereum cd ${NEW}/go-ethereum
info Compiling geth info Compiling geth
make all && make all &&
echo Ignore that last line, if it tells you to run geth now. echo Ignore that last line, if it tells you to run geth now.
mkdir -p ~bfa/bin mkdir -p ~bfa/bin
cp -vp ~/new/go-ethereum/build/bin/{geth,bootnode,abigen,ethkey,puppeth,rlpdump,wnode,swarm,swarm-smoke} ~bfa/bin/ cp -vp ${NEW}/go-ethereum/build/bin/{geth,bootnode,abigen,ethkey,puppeth,rlpdump,wnode,swarm,swarm-smoke} ~bfa/bin/
chown -R bfa:bfa ~bfa chown -R bfa:bfa ~bfa
} }
...@@ -175,7 +179,7 @@ function welcome ...@@ -175,7 +179,7 @@ function welcome
# development tools # development tools
aptinstall dirmngr apt-transport-https curl git curl build-essential aptinstall dirmngr apt-transport-https curl git curl build-essential sudo
usersetup usersetup
nodejsinstall nodejsinstall
web3install web3install
......
...@@ -3,25 +3,27 @@ ...@@ -3,25 +3,27 @@
if [ -z "${BFAHOME}" ]; then echo "\$BFAHOME not set. Did you source bfa/bin/env ?" >&2; exit 1; fi if [ -z "${BFAHOME}" ]; then echo "\$BFAHOME not set. Did you source bfa/bin/env ?" >&2; exit 1; fi
source ${BFAHOME}/bin/libbfa.sh || exit 1 source ${BFAHOME}/bin/libbfa.sh || exit 1
bootnodeid=6c81b38551fec2f1142b58ed65137cc1b7dfdc7b35bc556ef26604c41e30fcdeb12212b3c19913584f71dc7bf87d76cd67fa523e96996c0f148390fb76fdc5f7 bootNICv4="enode://37614dc9f5e94efc45eb533ac02e9f1d693c47f0537d818b222f02e1e6d73cf9@[200.108.146.101]:30301"
bootnodev6=2800:40:1:6::135 bootnodes="${bootNICv4}"
bootnodev4=200.68.65.135
bootnodeport=30301
bootnodes="enode://${bootnodeid}@[$bootnodev6]:${bootnodeport},enode://${bootnodeid}@[$bootnodev4]:${bootnodeport}"
function accountlist function accountlist
{ {
local accts= local accts=
for file in ${BFANODEDIR}/keystore/*--* local filename
for filename in ${BFANODEDIR}/keystore/*--*
do do
if [ -r "$file" ] if [ -r "$filename" -a ${#filename} -ge 40 ]
then then
acct=$( echo $file | sed 's/^.*--//' ) acct=${filename:$(( ${#filename} - 40 ))}
accts="${accts},${acct}" accts="${accts},${acct}"
fi fi
done done
# strip first comma # strip leading comma
echo "--password /dev/null --unlock ${accts:1}" accts=${accts#,}
if [ ${#accts} -ge 40 ]
then
echo "--password /dev/null --unlock ${accts}"
fi
} }
# touch the "miner" file if you are authorized to mine # touch the "miner" file if you are authorized to mine
...@@ -44,15 +46,19 @@ function getsyncmode ...@@ -44,15 +46,19 @@ function getsyncmode
echo "--syncmode ${syncmode}" echo "--syncmode ${syncmode}"
} }
test -n "${BFAACCOUNT}" ||
fatal "No account defined."
if [ -t 1 ]
then
echo Logging everything to ${BFANODEDIR}/log
echo Consider running: tail -n 1000 -F ${BFANODEDIR}/log
fi
# Start the miner. # Start the node.
( (
echo ${BASHPID} > ${BFANODEDIR}/start-loop.pid
flock --nonblock --exclusive 9 || exit 1 flock --nonblock --exclusive 9 || exit 1
if [ -t 1 ]
then
echo Logging everything to ${BFANODEDIR}/log
echo Consider running: tail -n 1000 -F ${BFANODEDIR}/log
fi
while : while :
do do
echo echo
...@@ -79,4 +85,4 @@ function getsyncmode ...@@ -79,4 +85,4 @@ function getsyncmode
wait wait
sleep 60 sleep 60
done 2>&1 | ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log & done 2>&1 | ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log &
) 9>> ${BFANODEDIR}/geth.pid ) 9>> ${BFANODEDIR}/start-loop.pid
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