Helpful Flags for Running a Node on Moonbeam¶
Introduction¶
When spinning up your own Moonbeam node, there are some required and optional flags that can be used.
This guide will cover some of the most common flags and show you how to access all of the available flags.
Common Flags¶
--collator
- enables collator mode for collator candidates and, if eligible, allows the node to actively participate in block production--port
- specifies the peer-to-peer protocol TCP port. The default port for parachains is30333
and30334
for the embedded relay chain--rpc-port
- deprecated as of client v0.30.0, use--ws-port
for HTTP and WS connections instead - specifies the HTTP RPC server TCP port. The default port for parachains is9933
and9934
for the embedded relay chain--ws-port
- specifies the WebSockets RPC server TCP port. As of client v0.30.0, the WS port is a unified port for both HTTP and WS connections. The default port for parachains is9944
and9945
for the embedded relay chain--rpc-max-connections
- deprecated as of client v0.30.0, this value has been hardcoded to 100. Use--ws-max-connections
to adjust the combined HTTP and WS connection limit instead - specifies the maximum number of HTTP RPC server connections--ws-max-connections
- specifies the maximum number of WS RPC server connections. As of client v0.30.0, this flag adjusts the combined HTTP and WS connection limit. The default value is 100--execution
- specifies the execution strategy that should be used by all execution contexts. The Substrate runtime is compiled into a native executable which is included locally as part of the node and a WebAssembly (Wasm) binary that is stored on-chain. The available options are:native
- only execute with the native buildwasm
- only execute with the Wasm buildboth
- execute with both native and Wasm buildsnativeelsewasm
- execute with the native build if possible and if it fails, then execute with Wasm
--wasm-execution
- specifies the method for executing Wasm runtime code. The available options are:compiled
- this is the default and uses the Wasmtime compiled runtimeinterpreted-i-know-what-i-do
- uses the wasmi interpreter
--state-pruning
- specifies the state pruning mode. For client versions prior to v0.27.0, the--state-pruning
flag was named--pruning
. If running a node with the--collator
flag, the default is to keep the full state of all blocks. Otherwise, the state is only kept for the last 256 blocks. The available options are:archive
- keeps the full state of all blocks<number-of-blocks>
- specifies a custom number of blocks to keep the state for
--trie-cache-size
- specifies the size of the internal state cache. The default is67108864
. You can set this value to0
to disable the cache and improve collator performance. For client versions prior to v0.27.0, the--trie-cache-size
flag was named--state-cache-size
--db-cache
- specifies the memory the database cache is limited to use. It is recommended to set it to 50% of the actual RAM your server has. For example, for 32 GB RAM, the value should be set to16000
. The minimum value is2000
, but it is below the recommended specs--base-path
- specifies the base path where your chain data is stored--chain
- specifies the chain specification to use. It can be a predefined chainspec such asmoonbeam
,moonriver
, oralphanet
. Or it can be a path to a file with the chainspec (such as the one exported by thebuild-spec
command)--name
- specifies a human-readable name for the node, which can be seen on telemetry, if enabled--telemetry-url
- specifies the URL of the telemetry server to connect to. This flag can be passed multiple times as a means to specify multiple telemetry endpoints. This flag takes two parameters: the URL and the verbosity level. Verbosity levels range from 0-9, with 0 denoting the least verbosity. Expected format is '', e.g. --telemetry-url 'wss://foo/bar 0'
.--in-peers
- specifies the maximum amount of accepted incoming connections. The default is25
--out-peers
- specifies the maximum amount of outgoing connections to maintain. The default is25
--runtime-cache-size 64
- configures the number of different runtime versions preserved in the in-memory cache to 64--eth-log-block-cache
- size in bytes the LRU cache for block data is limited to use. This flag mostly pertains to RPC providers. The default is300000000
--eth-statuses-cache
- size in bytes the LRU cache for transaction statuses data is limited to use. This flag mostly pertains to RPC providers. The default is300000000
How to Access All of the Available Flags¶
For a complete list of the available flags, you can spin up your Moonbeam node with --help
added to the end of the command. The command will vary depending on how you choose to spin up your node, and if you're using Docker or Systemd.
Docker¶
docker run --network="host" -v "/var/lib/moonbeam-data:/data" \
-u $(id -u ${USER}):$(id -g ${USER}) \
purestake/moonbeam:v0.29.0 \
--help
docker run --network="host" -v "/var/lib/moonriver-data:/data" \
-u $(id -u ${USER}):$(id -g ${USER}) \
purestake/moonbeam:v0.30.0 \
--help
docker run --network="host" -v "/var/lib/alphanet-data:/data" \
-u $(id -u ${USER}):$(id -g ${USER}) \
purestake/moonbeam:v0.30.0 \
--help
Systemd¶
# If you used the release binary
./moonbeam --help
# Or if you compiled the binary
./target/release/moonbeam --help
# If you used the release binary
./moonbeam --help
# Or if you compiled the binary
./target/release/moonbeam --help
# If you used the release binary
./moonbeam --help
# Or if you compiled the binary
./target/release/moonbeam --help
Last update:
March 8, 2023
| Created: February 15, 2022
| Created: February 15, 2022