Summary
A Moonbeam node is a full client for the Moonbeam network, an Ethereum-compatible parachain on Polkadot. Running one gives you local RPC access, block production, and deeper control, but it requires significant hardware and maintenance. For most dApps, a managed RPC service like OnFinality offers reliable endpoints without the operational overhead.
Quick decision: run your own Moonbeam node or use a managed RPC?
Before you provision hardware or start syncing, decide what you actually need from a Moonbeam node. The choice usually comes down to three scenarios:
- You are building a dApp or indexer that just needs reliable RPC access. A managed RPC service such as OnFinality gives you authenticated endpoints, archive and trace support, and observability without the burden of node operations.
- You are a collator or need block production. Running your own node is required to participate in Moonbeam's collator set. This is a specialized role with staking and performance requirements.
- You need deep control over node configuration for research, custom tooling, or privacy. Self-hosting gives you full control, but you take on sync time, storage growth, and ongoing maintenance.
If your goal is to interact with Moonbeam for development or production applications, a managed RPC endpoint is usually the fastest and most cost-effective path. You can test the public endpoint, then sign up for authenticated access with higher rate limits and analytics. For teams that need dedicated resources, OnFinality also offers dedicated node options.
What is a Moonbeam node?
Moonbeam is an Ethereum-compatible parachain on Polkadot. A Moonbeam node is a client that connects to the Moonbeam network, syncs its blockchain state, and exposes RPC endpoints for querying and submitting transactions. Because Moonbeam is a Substrate-based parachain, its node software includes both the parachain runtime and an embedded relay chain client to communicate with Polkadot.
There are several types of Moonbeam nodes:
- Full node: syncs the entire blockchain and validates transactions. Provides local RPC access.
- Archive node: stores all historical state, enabling queries like
eth_getBalanceat past blocks. Essential for indexers and analytics. - Tracing node: enables debug and trace RPC methods for deep transaction analysis.
- Collator node: a full node that also produces blocks and earns rewards. Requires staking and high performance.
For most developers, the distinction between full and archive is the most important. If your application needs historical data, you need archive access. Managed services like OnFinality provide archive and trace support where available, so you don't have to run a separate archive node.
Hardware and requirements for running a Moonbeam node
Running a Moonbeam node is not trivial. The official documentation recommends at least 32GB of RAM and a fast SSD. The node build is large because it includes both the parachain and relay chain components. Sync can take days, and storage grows continuously.
Here is a typical setup for a Moonbeam full node:
| Component | Minimum Recommendation |
|---|---|
| CPU | 4+ cores |
| RAM | 32 GB |
| Storage | 1 TB+ NVMe SSD |
| Network | 100 Mbps+ stable connection |
These requirements increase if you run an archive or tracing node. You also need to open specific ports for P2P communication. The default ports are 30333 for parachain P2P and 30334 for the embedded relay chain.
If you are not prepared to handle hardware failures, software upgrades, and storage scaling, a managed RPC service is a pragmatic alternative.
How to run a Moonbeam node (overview)
The official Moonbeam documentation provides detailed instructions for running a node using Docker or systemd. Here is a high-level overview:
- Install Docker or prepare a Linux environment.
- Download the Moonbeam binary or use the official Docker image.
- Choose your network: Moonbeam (Polkadot), Moonriver (Kusama), or Moonbase Alpha (testnet).
- Run the node with the appropriate chain specification and flags.
- Wait for sync – this can take hours or days.
- Verify sync status using RPC calls.
A basic Docker command might look like:
docker run -p 9933:9933 -p 9944:9944 -p 30333:30333 \
-v /moonbeam-data:/data \
moonbeamfoundation/moonbeam:latest \
--chain moonbeam \
--base-path /data \
--rpc-external \
--rpc-cors all
This exposes the RPC port (9933) and WebSocket port (9944). You would then use http://localhost:9933 as your RPC endpoint.
However, running a node is only the beginning. You must monitor it, keep it updated, and handle chain forks or network upgrades. For production applications, the operational burden is often underestimated.
Moonbeam RPC endpoints and how to use them
Once you have a node running, you can interact with it via JSON-RPC. Moonbeam supports both Ethereum-compatible methods (like eth_getBalance) and Substrate methods (like chain_getBlock).
For example, to get the latest block using curl:
curl -H 'Content-Type: application/json' \
-d '{"id":1,"jsonrpc":"2.0","method":"chain_getBlock"}' \
'https://moonbeam.api.onfinality.io/public'
This public endpoint is rate-limited to 5 requests per second. For production use, you should sign up for an authenticated endpoint with higher limits.
If you are using ethers.js, you can connect like this:
const { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("https://moonbeam.api.onfinality.io/public");
async function getBlockNumber() {
const blockNumber = await provider.getBlockNumber();
console.log(blockNumber);
}
getBlockNumber();
For WebSocket subscriptions, use the public WebSocket endpoint:
wss://moonbeam.api.onfinality.io/public-ws
You can subscribe to new heads or pending transactions.
Managed RPC vs. self-hosted: what to consider
When deciding between a managed RPC service and running your own node, consider the following tradeoffs:
| Factor | Self-Hosted | Managed RPC (OnFinality) |
|---|---|---|
| Setup time | Days (sync + config) | Minutes |
| Hardware cost | High upfront | Pay-as-you-go |
| Maintenance | You handle upgrades, monitoring, backups | Provider handles it |
| Scalability | Manual | Automatic |
| Archive/trace | Requires extra storage/compute | Often included |
| Control | Full | Limited to API access |
For most dApps, the managed route is more efficient. You avoid the capital expenditure and ongoing operational work. OnFinality provides authenticated endpoints with rate limits, analytics, and dedicated node options for teams that need more.
Common pitfalls and troubleshooting
Even with a managed service, you may encounter issues. Here are common problems and how to address them:
- Sync stuck: If your node is not syncing, check your P2P ports are open and your clock is synchronized.
- RPC timeouts: If you are using a public endpoint, you may hit rate limits. Upgrade to an authenticated endpoint.
- Missing historical data: If you need past state, ensure you are using an archive node. Public endpoints may not support archive queries.
- WebSocket disconnects: Some networks limit WebSocket connections. Use a dedicated endpoint if you need persistent subscriptions.
If you are using OnFinality, you can monitor request usage and errors in the dashboard to diagnose issues.
Key Takeaways
- A Moonbeam node is a full client for the Moonbeam parachain, providing RPC access and block production.
- Running your own node requires significant hardware and maintenance; it is only necessary for collators or specialized use cases.
- For most developers, a managed RPC service like OnFinality offers a faster, more reliable path to Moonbeam data.
- OnFinality provides public and authenticated endpoints, archive and trace support, and dedicated node options.
- Always consider your need for historical data and WebSocket support when choosing an RPC provider.
Frequently Asked Questions
What is the difference between a Moonbeam full node and an archive node?
A full node stores the current state and recent history, while an archive node stores all historical state. Archive nodes are needed for queries like eth_getBalance at past blocks.
Can I run a Moonbeam node on a testnet?
Yes, Moonbase Alpha is the Moonbeam testnet. You can run a node on it, but note that it may be purged periodically. For development, you can also use a managed RPC endpoint for Moonbase Alpha.
Do I need to run a node to use Moonbeam?
No. You can interact with Moonbeam using public or managed RPC endpoints. Running a node is only necessary if you need local access, are a collator, or require custom node configuration.
How much does it cost to run a Moonbeam node?
Costs vary based on hardware and cloud provider. Expect to pay for a large VM with 32GB RAM and 1TB+ SSD, plus bandwidth. Managed RPC services offer predictable monthly pricing.
What RPC methods does Moonbeam support?
Moonbeam supports both Ethereum JSON-RPC methods (eth_) and Substrate RPC methods (chain_, state_*, etc.). This makes it compatible with tools like MetaMask and ethers.js.
For more details on Moonbeam RPC endpoints and dedicated node options, visit the Moonbeam network page. You can also explore RPC pricing and the full list of supported networks.