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

Indentation

parent 6a939497
No related branches found
No related tags found
No related merge requests found
......@@ -22,60 +22,63 @@ function modefilter
function admin_syncmode
{
echo "Available synchronization modes:"
echo " full : verify all blocks and all transactions since genesis (most secure)"
echo " fast : verify all blocks but not all transactions (faster than full, but less certain)"
echo " light: Makes this node into a light node which downloads almost"
echo " nothing, but relies on fast and full nodes in the network"
echo " to answer it's requests. This is the fastest and uses least"
echo " local resources, but outsources all trust to another node."
echo "Default mode is fast, because for many, it is a healthy compromise"
echo "between speed and paranoia. You can change the setting, according to"
echo "your needs."
echo "Available synchronization modes:"
echo " full : verify all blocks and all transactions since genesis (most secure)"
echo " fast : verify all blocks but not all transactions (faster than full, but less certain)"
echo " light: Makes this node into a light node which downloads almost"
echo " nothing, but relies on fast and full nodes in the network"
echo " to answer it's requests. This is the fastest and uses least"
echo " local resources, but outsources all trust to another node."
echo "Default mode is fast, because for many, it is a healthy compromise"
echo "between speed and paranoia. You can change the setting, according to"
echo "your needs."
mode=$( cat ${BFANODEDIR}/syncmode 2>/dev/null || true )
mode=${mode:-${defaultsyncmode}}
orgmode=$mode
modefilter
echo "Your current mode is set to ${mode}"
killed=0
mode=
echo
while [ -z "${mode}" ]
do
read -p "Which mode do you wish? : " mode
mode=$( cat ${BFANODEDIR}/syncmode 2>/dev/null || true )
mode=${mode:-${defaultsyncmode}}
orgmode=$mode
modefilter
done
echo $mode > ${BFANODEDIR}/syncmode
if [ "$orgmode" = "fast" -a "$mode" = "full" ]
then
echo "You increased your paranoia level. The proper thing to do now,"
echo "would be to delete your version of what you synchronized with"
echo "fast mode, and revalidate everything in the entire blockchain."
echo "This probably takes quite a long time and also requires downloading"
echo "all blocks from the entire blockchain again."
yesno n "Do you wish to delete all downloaded blocks and resynchronize?"
if [ "$REPLY" = "y" ]
echo "Your current mode is set to ${mode}"
killed=0
mode=
echo
while [ -z "${mode}" ]
do
read -p "Which mode do you wish? : " mode
modefilter
done
echo "Remembering your choice."
echo $mode > ${BFANODEDIR}/syncmode
if [ "$orgmode" = "fast" -a "$mode" = "full" ]
then
if [ -r "${BFANODEDIR}/geth.pid" ]
echo "You increased your paranoia level. The proper thing to do now,"
echo "would be to delete your version of what you synchronized with"
echo "fast mode, and revalidate everything in the entire blockchain."
echo "This probably takes quite a long time and also requires downloading"
echo "all blocks from the entire blockchain again."
yesno n "Do you wish to delete all downloaded blocks and resynchronize?"
if [ "$REPLY" = "y" ]
then
pid=$( cat ${BFANODEDIR}/geth.pid )
kill -0 $pid 2>/dev/null &&
echo "Killing running geth." &&
killed=1
while ! kill $pid 2>/dev/null
do
sleep 1
done
if [ -r "${BFANODEDIR}/geth.pid" ]
then
pid=$( cat ${BFANODEDIR}/geth.pid )
kill -0 $pid 2>/dev/null &&
echo "Killing running geth." &&
killed=1
while ! kill $pid 2>/dev/null
do
sleep 1
done
fi
rm -fr ${BFANODEDIR}/geth/chainstate ${BFANODEDIR}/geth/lightchainstate
geth --cache 0 --datadir ${BFANODEDIR} init ${BFAHOME}/src/genesis.json
test $killed -eq 1 &&
echo &&
echo "The startup.sh should restart your geth shortly."
fi
rm -fr ${BFANODEDIR}/geth/chainstate ${BFANODEDIR}/geth/lightchainstate
geth --cache 0 --datadir ${BFANODEDIR} init ${BFAHOME}/src/genesis.json
test $killed -eq 1 &&
echo &&
echo "The startup.sh should restart your geth shortly."
else
echo "No further action taken."
fi
fi
}
function admin_bootnode
......
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