Using Docker
Nethermind Dockers instructions
On some OS like Amazon Linux you may need to increase the
nofile
limit by adding the following instruction to docker commands:--ulimit nofile=1000000:1000000
e.g.
docker run -it --ulimit nofile=1000000:1000000 nethermind/nethermind
Docker pull command:
Untitled
docker pull nethermind/nethermind
In order to start
Nethermind.Runner
, simply run:Untitled
docker run -it nethermind/nethermind
You can use
--help
to get a list of possible start parameters for Nethermind or you can find them all here.Untitled
docker run -it nethermind/nethermind --help
It’s possible to modify each configuration property via environment variable, using a simple convention:
NETHERMIND_{MODULE}CONFIG_{PROPERTY} or --{Module}.{Property}
For example:
NETHERMIND_INITCONFIG_ISMINING=true or --Init.IsMining
Environment variables are to be passed before the docker image tag while parameters should be passed right after the docker image tag.
Environment variables can be easily used within docker-compose.yml files in the environment section
To enable JSON RPC, share the host’s networking namespace with
--network host
and set--JsonRpc.Enabled true
. To change port simply pass--JsonRpc.Port 8550
.If running locally:
Untitled
docker run -it --network host nethermind/nethermind --JsonRpc.Enabled true
or with port-mapping
Untitled
docker run -it -p 8545:8545 nethermind/nethermind --JsonRpc.Enabled true --JsonRpc.Host 0.0.0.0
If running from a VM you may want to expose JSON RPC to the outer world via
--JsonRpc.Host {hostmachine_ip}
(127.0.0.1
is set by default). You may try setting --JsonRpc.Host 0.0.0.0
if you still can not connect with JSON RPC.To switch the network use
--config {network}
flag (default value is mainnet
).mainnet
goerli
rinkeby
ropsten
xdai
poacore
volta
energyweb
For example to run Nethermind on
goerli
network:Untitled
docker run -it nethermind/nethermind --config goerli
To successfully map volumes such as
database, keystore, logs
at one go you can use --datadir
command option:docker run -it -v /home/user/data:/nethermind/data nethermind/nethermind --datadir data
To fully override a configuration file, you need to use a volume:
-v /home/user/mainnet.cfg:/nethermind/configs/mainnet.cfg
In order to map an internal database to a local volume, you need to map
/nethermind/nethermind_db/
:-v /home/user/nethermind_db:/nethermind/nethermind_db
Logs can be mapped with the following command:
-v /home/user/logs:/nethermind/logs
Keystore:
-v /home/user/keystore:/nethermind/keystore
NLog:
-v /home/user/NLog.config:/nethermind/NLog.config
Dockerfile can be found in the repository root and it currently uses the power of multi-arch builds:
Last modified 7mo ago