DEV Community

Zhuoxin Sun
Zhuoxin Sun

Posted on • Originally published at onfinality.io

Moonbeam RPC List: Endpoints, Chain ID, and Provider Options

Moonbeam RPC Decision Checklist

Before connecting your dApp to Moonbeam, verify these key items:

  • Chain ID: 1284 (0x504) — ensure your wallet and app configuration match.
  • Native token: GLMR — used for gas fees.
  • RPC endpoint type: Choose between public shared endpoints, or a dedicated node for higher reliability.
  • WebSocket support: Required for real-time features like transaction subscriptions.
  • Archive node access: Needed for historical state queries (e.g., eth_call on past blocks).
  • Rate limits: Public endpoints may throttle; production apps often need a provider with scalable plans.
  • Geographic latency: Select a provider with endpoints close to your user base.

Moonbeam Chain Settings

Moonbeam is an Ethereum-compatible smart contract parachain on Polkadot. It mirrors Ethereum's JSON-RPC API, making it straightforward to deploy Solidity-based dApps. Below are the essential network parameters for Moonbeam Mainnet:

Parameter Value
Network Name Moonbeam Mainnet
Chain ID 1284 (0x504)
Native Currency GLMR
RPC Endpoint (HTTPS) https://rpc.api.moonbeam.network (official public)
RPC Endpoint (WSS) wss://wss.api.moonbeam.network (official public)
Block Explorer https://moonbeam.moonscan.io

Public RPC Endpoints for Moonbeam

Here is a list of commonly used public RPC endpoints for Moonbeam Mainnet. Note that public endpoints may have rate limits and are not recommended for high-traffic production applications.

Provider HTTPS Endpoint WSS Endpoint Notes
Official Moonbeam https://rpc.api.moonbeam.network wss://wss.api.moonbeam.network Operated by the Moonbeam team; may be rate-limited
OnFinality https://moonbeam.api.onfinality.io/public wss://moonbeam.api.onfinality.io/public-ws Free tier available; scalable premium plans
PublicNode https://moonbeam-rpc.publicnode.com wss://moonbeam-rpc.publicnode.com Free and privacy-focused
DRPC https://moonbeam.drpc.org wss://moonbeam.drpc.org Decentralized RPC with multi-provider failover
1RPC https://1rpc.io/glmr Privacy-preserving, rate-limited
Dwellir https://moonbeam-rpc.dwellir.com wss://moonbeam-rpc.dwellir.com Requires API key for dedicated access

Comparing RPC Providers for Moonbeam

When selecting a provider for production, consider the following criteria:

Criterion What to Check Why It Matters
Reliability Uptime history, failover mechanisms Ensures your dApp stays online
Scalability Request-per-second limits, burst capacity Handles traffic spikes without degradation
WebSocket Support WSS endpoint availability Required for real-time events (e.g., pending transactions)
Archive Data Access to historical state Needed for analytics, audit, and certain smart contract calls
Geographic Coverage Server locations near your users Reduces latency and improves user experience
Pricing Pay-as-you-go vs. fixed plans Aligns with your budget and usage patterns
Support SLA, community vs. dedicated support Critical for production incidents

OnFinality provides both shared RPC API access and dedicated nodes for Moonbeam, offering flexible scaling and global endpoints. For detailed pricing and network support, visit the RPC pricing page and the supported networks list.


Connecting to Moonbeam with ethers.js

Here's how to connect to Moonbeam using the ethers.js library. Replace the endpoint URL with your preferred provider.

import { ethers } from "ethers";

// Using a public endpoint
const provider = new ethers.JsonRpcProvider("https://rpc.api.moonbeam.network");

async function getChainId() {
  const network = await provider.getNetwork();
  console.log("Chain ID:", network.chainId); // 1284
}

getChainId();
Enter fullscreen mode Exit fullscreen mode

For WebSocket connections:

const wsProvider = new ethers.WebSocketProvider("wss://wss.api.moonbeam.network");
wsProvider.on("block", (blockNumber) => {
  console.log("New block:", blockNumber);
});
Enter fullscreen mode Exit fullscreen mode

Common Pitfalls and Troubleshooting

  • Incorrect Chain ID: Always use 1284 (or 0x504). Using a different ID will cause transaction rejection.
  • Rate Limiting: Public endpoints may return 429 Too Many Requests. For production, choose a provider with sufficient capacity.
  • WebSocket Disconnections: Unstable connections can drop subscriptions. Implement reconnection logic in your app.
  • Archive Node Required: Methods like eth_call on historical blocks require an archive node. OnFinality offers archive access with dedicated nodes.
  • Gas Price Estimation: Moonbeam uses a fixed base fee; monitor network congestion to adjust gas limits.

Key Takeaways

  • Moonbeam Mainnet uses chain ID 1284 and GLMR as native currency.
  • Multiple public RPC endpoints are available, but they have limitations for production use.
  • When choosing a provider, evaluate reliability, scalability, WebSocket support, archive data, and geographic coverage.
  • OnFinality offers flexible RPC API and dedicated node solutions for Moonbeam, suitable for projects of all sizes.
  • Always test your integration with both HTTP and WebSocket endpoints before deploying.

Frequently Asked Questions

What is the RPC URL for Moonbeam Mainnet?
Multiple public endpoints exist, including https://rpc.api.moonbeam.network (official) and https://moonbeam.api.onfinality.io/public. For production, consider a dedicated node.

What is the Moonbeam chain ID?
The chain ID is 1284 (hex: 0x504).

Does Moonbeam support WebSocket?
Yes, WebSocket endpoints are available for real-time data.

How do I get archive data on Moonbeam?
Use an archive node provider. OnFinality's dedicated nodes include archive access.

Can I use Moonbeam with MetaMask?
Yes, you can add the network manually using the chain settings above.

What is the difference between shared and dedicated nodes?
Shared nodes are multi-tenant and may have rate limits; dedicated nodes provide exclusive access and higher reliability.

Related resources

Originally published at OnFinality.

Top comments (0)