Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nucleo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
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
Santiago
nucleo
Commits
3b281d73
Commit
3b281d73
authored
4 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
bfa ps, bfa top
parent
8c44652e
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/bfa
+49
-7
49 additions, 7 deletions
bin/bfa
with
49 additions
and
7 deletions
bin/bfa
+
49
−
7
View file @
3b281d73
...
...
@@ -66,6 +66,40 @@ function pidsfromsigfiles
echo
"
${
pids
#
}
"
}
register_subcommand
'ps'
'psprocs'
'Show processes relating to known .pid files'
function
psprocs
{
pids
=
$(
pidsfromsigfiles
)
if
[
-z
"
$pids
"
]
then
echo
"There are no processes of interest."
>
&2
exit
1
fi
# shellcheck disable=SC2086
ps
-p
${
pids
// /,
}
}
register_subcommand
'top'
'topprocs'
'Show relevant processes in top.'
function
topprocs
{
pids
=
$(
pidsfromsigfiles
)
if
[
-z
"
$pids
"
]
then
echo
"There are no processes of interest."
>
&2
exit
1
fi
# shellcheck disable=SC2086
local
args pid
args
=
# shellcheck disable=SC2086
for
pid
in
$pids
do
args
=
"
$args
-p
$pid
"
done
# shellcheck disable=SC2086
exec
top
$args
}
function
sendsig
{
local
signal pids
...
...
@@ -79,7 +113,8 @@ function sendsig
# shellcheck disable=SC2086
ps
-p
${
pids
// /,
}
echo
"Sending
${
signal
}
signal to pid
$pids
."
kill
"
$signal
"
"
$pids
"
||
true
# shellcheck disable=SC2086
kill
"
$signal
"
$pids
||
true
}
register_subcommand
'kill'
'killbfastuff'
'Kill BFA background processes (no questions asked).'
...
...
@@ -173,9 +208,11 @@ function importdb
done
geth
--networkid
"
${
BFANETWORKID
}
"
--datadir
"
${
BFANODEDIR
}
"
--syncmode
"full"
--gcmode
"archive"
import <
(
n
=
1
while
gzip
-dc
"bfa2018-1Mblocksstartingat
${
n
}
.block.export.gz"
2>/dev/null
printf
-v
filename
'bfa2018.blocks.%09d-%09d.export.gz'
"
$n
"
"
$((
n
+
delta
-
1
))
"
while
gzip
-dc
"
$filename
"
2>/dev/null
do
n
=
$((
n
+
1000000
))
n
=
$((
n
+
delta
))
printf
-v
filename
'bfa2018.blocks.%09d-%09d.export.gz'
"
$n
"
"
$((
n
+
delta
-
1
))
"
done
true
)
...
...
@@ -336,10 +373,15 @@ function truncatelog
true
>
"
${
BFANODEDIR
}
/log"
}
register_subcommand
'
bfa
geth'
'bfageth'
'Start geth for BFA.'
register_subcommand
'geth'
'bfageth'
'Start geth for BFA.'
function
bfageth
{
exec
geth
--config
"
${
BFANETWORKDIR
}
/conf.bfa2018.local+full+archive"
"
$@
"
if
[
-z
"
$*
"
]
then
echo
"You should not run this command without any arguments. Start the background processes with start.sh instead."
>
&2
exit
1
fi
exec
geth
--config
"
${
BFANETWORKDIR
}
/config.localhost+full+archive"
"
$@
"
}
function
bfaadmin
...
...
@@ -388,13 +430,13 @@ function main
eval
${
commands
[
$cmd
]
}
"
$*
"
;;
'admin.sh'
)
bfaadmin
"
$
*
"
bfaadmin
"
$
@
"
;;
'bfalog.sh'
)
bfatail
;;
'bfageth'
)
bfageth
"
$
*
"
bfageth
"
$
@
"
exit
1
esac
}
...
...
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