Skip to content

Run a Node on Moonbeam

Introduction

Running a full node on a Moonbeam-based network allows you to connect to the network, sync with a bootnode, obtain local access to RPC endpoints, author blocks on the parachain, and more.

There are multiple deployments of Moonbeam, including the Moonbase Alpha TestNet, Moonriver on Kusama, and Moonbeam on Polkadot. Here's how these environments are named and their corresponding chain specification file names:

Network Hosted By Chain Name
Moonbase Alpha Moonbeam Foundation alphanet
Moonriver Kusama moonriver
Moonbeam Polkadot moonbeam

Note

Moonbase Alpha is still considered an Alphanet, and as such will not have 100% uptime. The parachain might be purged as needed. During the development of your application, make sure you implement a method to redeploy your contracts and accounts to a fresh parachain quickly. If a chain purge is required, it will be announced via our Discord channel at least 24 hours in advance.

Requirements

Running a parachain node is similar to a typical Substrate node, but there are some differences. A Substrate parachain node is a bigger build because it contains code to run the parachain itself, as well as code to sync the relay chain, and facilitate communication between the two. As such, this build is quite large and may take over 30 min and require 32GB of memory.

The minimum specs recommended to run a node are shown in the following table. For our Kusama and Polkadot MainNet deployments, disk requirements will be higher as the network grows.

Component Requirement
CPU 8 Cores (Fastest per core speed)
RAM 16 GB
SSD 1 TB (recommended)
Firewall P2P port must be open to incoming traffic:
    - Source: Any
    - Destination: 30333, 30334 TCP
Component Requirement
CPU 8 Cores (Fastest per core speed)
RAM 16 GB
SSD 1 TB (recommended)
Firewall P2P port must be open to incoming traffic:
    - Source: Any
    - Destination: 30333, 30334 TCP
Component Requirement
CPU 8 Cores (Fastest per core speed)
RAM 16 GB
SSD 1 TB (recommended)
Firewall P2P port must be open to incoming traffic:
    - Source: Any
    - Destination: 30333, 30334 TCP

Note

If you don't see an Imported message (without the [Relaychain] tag) when running a node, you might need to double-check your port configuration.

Running Ports

As stated before, the relay/parachain nodes will listen on multiple ports. The default Substrate ports are used in the parachain, while the relay chain will listen on the next higher port.

The only ports that need to be open for incoming traffic are those designated for P2P. Collators must not have RPC or WS ports opened.

Note

As of client v0.33.0, the --ws-port and --ws-max-connections flags have been deprecated and removed in favor of the --rpc-port and --rpc-max-connections flags for both RPC and WSS connections. The default port is 9944, and the default maximum number of connections is set to 100.

Default Ports for a Parachain Full-Node

Description Port
P2P 30333 (TCP)
RPC & WS 9944
Prometheus 9615

Default Ports of Embedded Relay Chain

Description Port
P2P 30334 (TCP)
RPC & WS 9945
Prometheus 9616

Installation

There are a couple different guides to help you get started running a Moonbeam-based node:

  • Using Docker - this method provides a quick and easy way to get started with a Docker container
  • Using Systemd - this method is recommended for those with experience compiling a Substrate node

Debug, Trace and TxPool APIs

You can also gain access to some non-standard RPC methods by running a tracing node, which allow developers to inspect and debug transactions during runtime. Tracing nodes use a different Docker image than a standard Moonbase Alpha, Moonriver, or Moonbeam node. Check out the Run a Tracing Node guide and be sure to switch to the right network tab throughout the instructions. Then to interact with your tracing node, check out the Debug & Trace guide.

Logs and Troubleshooting

You will see logs from both the relay chain and the parachain. The relay chain will be prefixed by [Relaychain], while the parachain has no prefix.

P2P Ports Not Open

If you don't see an Imported message (without the [Relaychain] tag), you need to check the P2P port configuration. P2P port must be open to incoming traffic.

In Sync

Both chains must be in sync at all times, and you should see either Imported or Idle messages and have connected peers.

Genesis Mismatching

The Moonbase Alpha TestNet may need to be purged and upgraded once in a while. Consequently, you may see the following message:

DATE [Relaychain] Bootnode with peer id `ID` is on a different
chain (our genesis: GENESIS_ID theirs: OTHER_GENESIS_ID)

This typically means that you are running an older version and will need to upgrade.

We announce the upgrades (and corresponding chain purge) via our Discord channel at least 24 hours in advance.

Instructions for purging chain data will vary slightly depending on how you spun up your node:

Last update: June 10, 2024
| Created: November 17, 2021