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
86b5c43b
Commit
86b5c43b
authored
6 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Indentation
parent
6a939497
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/admin.sh
+51
-48
51 additions, 48 deletions
bin/admin.sh
with
51 additions
and
48 deletions
bin/admin.sh
+
51
−
48
View file @
86b5c43b
...
...
@@ -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
...
...
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