Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nucleo
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blockchain
nucleo
Commits
6a939497
Commit
6a939497
authored
6 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
bootnode option in admin.sh
parent
a8c4342d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/admin.sh
+54
-8
54 additions, 8 deletions
bin/admin.sh
bin/installbfa.sh
+1
-1
1 addition, 1 deletion
bin/installbfa.sh
bin/libbfa.sh
+16
-0
16 additions, 0 deletions
bin/libbfa.sh
with
71 additions
and
9 deletions
bin/admin.sh
+
54
−
8
View file @
6a939497
...
...
@@ -4,7 +4,7 @@
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
defaultmode
=
"fast"
default
sync
mode
=
"fast"
function
modefilter
{
...
...
@@ -20,6 +20,8 @@ function modefilter
true
}
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)"
...
...
@@ -32,7 +34,7 @@ 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
:-${
defaultmode
}}
mode
=
${
mode
:-${
default
sync
mode
}}
orgmode
=
$mode
modefilter
echo
"Your current mode is set to
${
mode
}
"
...
...
@@ -53,12 +55,7 @@ then
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."
REPLY
=
while
[
"
$REPLY
"
!=
"y"
-a
"
$REPLY
"
!=
"n"
]
do
read
-p
"Do you wish to delete all downloaded blocks and resynchronize? [yn]: "
REPLY
=
${
REPLY
,,
}
done
yesno n
"Do you wish to delete all downloaded blocks and resynchronize?"
if
[
"
$REPLY
"
=
"y"
]
then
if
[
-r
"
${
BFANODEDIR
}
/geth.pid"
]
...
...
@@ -79,3 +76,52 @@ then
echo
"The startup.sh should restart your geth shortly."
fi
fi
}
function
admin_bootnode
{
keyfile
=
${
BFANETWORKDIR
}
/bootnode/key
echo
"Only very few wants to actually run a boot node."
echo
"If you have a keyfile for a bootnode, then you will"
echo
"automatically start one, when restarting your system."
if
[
-f
$keyfile
]
then
echo
"You are set up to run a boot node."
echo
"Deleting your bootnode keyfile disables your bootnode."
yesno n
"Do you want to delete your bootnode keyfile?"
if
[
"
$REPLY
"
=
"y"
]
then
rm
$keyfile
fi
pidfile
=
${
BFANETWORKDIR
}
/bootnode/pid
if
[
-r
$pidfile
]
then
pid
=
`
cat
$pidfile
`
kill
-0
$pid
&&
echo
"Terminating your bootnode."
&&
kill
`
cat
$pidfile
`
||
true
fi
else
echo
"You are not set up to run a boot node."
yesno n
"Do you want to create a keyfile for a bootnode?"
if
[
"
$REPLY
"
=
"y"
]
then
bootnode
-genkey
$keyfile
fi
echo
"You can now start your bootnode by running start.sh"
fi
}
case
"
$1
"
in
bootnode
)
admin_bootnode
;;
syncmode
)
admin_syncmode
;;
*
)
echo
Usage:
`
basename
$0
`
"{bootnode|syncmode}"
trap
''
ERR
exit
1
esac
This diff is collapsed.
Click to expand it.
bin/installbfa.sh
+
1
−
1
View file @
6a939497
...
...
@@ -57,7 +57,7 @@ function web3install
)
# nodejs package(s) that we need.
echo
'require("web3")'
|
sudo
--set-home
-u
bfa nodejs 2>/dev/null
&&
return
info Installing nodejs module: web3
info Installing nodejs module: web3
"(will show many warnings)"
sudo
--set-home
-u
bfa npm
install
web3
}
...
...
This diff is collapsed.
Click to expand it.
bin/libbfa.sh
+
16
−
0
View file @
6a939497
...
...
@@ -21,6 +21,22 @@ test -n "$BASH_VERSION" ||
test
"
$(
caller
2>/dev/null |
awk
'{print $1}'
)
"
!=
"0"
||
fatal
"This file must be source(d), not executed."
function
yesno
{
local
defreply
=
${
1
,,
}
local
yn
=
Yn
test
"
$defreply
"
=
"n"
&&
yn
=
yN
shift
REPLY
=
read
-p
"
$*
[
${
yn
}
]: "
-n
1
-e
REPLY
=
${
REPLY
,,
}
if
[
"
$REPLY
"
!=
"y"
-a
"
$REPLY
"
!=
"n"
]
then
REPLY
=
$defreply
fi
}
function
cleanup
{
if
[
$#
-gt
0
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment