Skip to content

Commit

Permalink
Merge pull request #1040 from yorickdowne/main
Browse files Browse the repository at this point in the history
Nethermind pruning refined
  • Loading branch information
yorickdowne committed Nov 2, 2022
2 parents 03067bc + f0cb125 commit e6ad7d1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
16 changes: 15 additions & 1 deletion ethd
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,19 @@ prune-nethermind() {
docompose run --rm set-prune-marker "touch /var/lib/nethermind/prune-marker"
docompose stop execution && docompose rm -f execution
start
docompose run --rm set-prune-marker "curl -s --data {\\\"method\\\":\\\"admin_prune\\\",\\\"params\\\":[],\\\"id\\\":1,\\\"jsonrpc\\\":\\\"2.0\\\"} -H Content-Type:\ application/json http://execution:8545"
echo "Waiting 10 seconds for Nethermind to be up"
sleep 10
prune_result=docompose run --rm set-prune-marker "curl -s --data {\\\"method\\\":\\\"admin_prune\\\",\\\"params\\\":[],\\\"id\\\":1,\\\"jsonrpc\\\":\\\"2.0\\\"} -H Content-Type:\ application/json http://execution:8545"
exitstatus=$?
if [ $exitstatus -ne 0 ]; then
echo "Unable to start prune. This is likely a bug."
exit 1
fi
echo Nethermind returns ${prune_result}
if [[ ! "${prune_result}" =~ "Starting" ]]; then
echo "Unable to start prune. This is likely a bug."
exit 1
fi
echo ""
echo "Prune is running, you can observe it with './ethd logs -f execution'"
echo ""
Expand Down Expand Up @@ -1628,6 +1640,8 @@ printhelp() {
echo " stops the Ethereum node and destroys all data stores"
echo " prune-geth"
echo " stops the Geth execution client and prunes its DB. This takes about 4-5 hours"
echo " prune-nethermind"
echo " restarts the Nethermind execution client and prunes its DB."
echo ""
echo ""
echo "The logs subcommand can be appended by flags and specify the container(s). example: "
Expand Down
2 changes: 0 additions & 2 deletions nethermind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ services:
- ${EL_MAX_PEER_COUNT:-50}
- --JsonRpc.Enabled
- "true"
- --JsonRpc.EnabledModules
- "Web3,Eth,Subscribe,Net"
- --JsonRpc.Host
- 0.0.0.0
- --JsonRpc.Port
Expand Down
4 changes: 2 additions & 2 deletions nethermind/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fi
__cores=$(($(nproc)/2))
if [ -f /var/lib/nethermind/prune-marker ]; then
rm -f /var/lib/nethermind/prune-marker
exec "$@" ${EL_EXTRAS} --JsonRpc.EnabledModules "Web3,Eth,Subscribe,Net,Admin" --Pruning.FullPruningMaxDegreeOfParallelism $__cores --Pruning.FullPruningCompletionBehavior ShutdownOnSuccess
exec "$@" --JsonRpc.EnabledModules "Web3,Eth,Subscribe,Net,Admin" --Pruning.FullPruningMaxDegreeOfParallelism $__cores --Pruning.FullPruningCompletionBehavior ShutdownOnSuccess ${EL_EXTRAS}
else
exec "$@" ${EL_EXTRAS}
exec "$@" --JsonRpc.EnabledModules "Web3,Eth,Subscribe,Net" ${EL_EXTRAS}
fi

0 comments on commit e6ad7d1

Please sign in to comment.