Manage Nethermind with systemd

Create a new user

1
sudo useradd -m -s /bin/bash nethermind
Copied!
  • increase the maximum number of open files
1
sudo bash -c 'echo "nethermind soft nofile 1000000" > /etc/security/limits.d/nethermind.conf'
Copied!
1
sudo bash -c 'echo "nethermind hard nofile 1000000" >> /etc/security/limits.d/nethermind.conf'
Copied!
  • switch to the new user
1
sudo su - nethermind
Copied!

Install Dependencies

1
sudo apt-get update && sudo apt-get install libsnappy-dev libc6-dev libc6 unzip -y
Copied!

Get Nethermind

  • download the latest Nethermind package
1
wget [LINUX_PACKAGE_URL]
Copied!
  • extract the files
1
unzip [LINUX_PACKAGE_FILENAME] -d build
Copied!
  • create data directory for logs, database and keystore
1
mkdir data
Copied!
  • create .env file inside data directory and provide environment variables to the Node configuration like for example:
NETHERMIND_CONFIG is the important one - defines the network config, the rest is optional.
.env
1
NETHERMIND_CONFIG="mainnet_pruned"
2
NETHERMIND_JSONRPCCONFIG_ENABLED=true
3
NETHERMIND_JSONRPCCONFIG_HOST="0.0.0.0"
4
NETHERMIND_HEALTHCHECKSCONFIG_ENABLED="true"
Copied!
  • remove the no more need package (optional)
1
rm [LINUX_PACKAGE_FILENAME]
Copied!

Manage Nethermind with systemd

  • download the nethermind.service config
1
wget https://raw.githubusercontent.com/NethermindEth/nethermind/master/scripts/nethermind.service
Copied!
  • move the config into the systemd folder
1
sudo mv nethermind.service /etc/systemd/system/
Copied!
  • reload the systemd configs
1
sudo systemctl daemon-reload
Copied!
  • you can now start, stop, restart Nethermind with systemd
1
sudo service nethermind start
Copied!
  • display the current Nethermind output (optional)
1
journalctl -u nethermind -f
Copied!
  • enable autorun (optional)
1
sudo systemctl enable nethermind
Copied!
Last modified 5mo ago