Logo
RPC Assistant

What are the Moonbeam RPC endpoints and which provider should I use?

Summary

Moonbeam Mainnet uses chain ID 1284 (0x504) with GLMR as the native token. Public RPC endpoints include https://rpc.api.moonbeam.network, https://moonbeam.drpc.org, and https://moonbeam.api.onfinality.io/public. For production apps, evaluate providers based on reliability, scalability, WebSocket support, and archive data access. OnFinality offers scalable RPC API and dedicated nodes for Moonbeam.

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:

ParameterValue
Network NameMoonbeam Mainnet
Chain ID1284 (0x504)
Native CurrencyGLMR
RPC Endpoint (HTTPS)https://rpc.api.moonbeam.network (official public)
RPC Endpoint (WSS)wss://wss.api.moonbeam.network (official public)
Block Explorerhttps://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.

ProviderHTTPS EndpointWSS EndpointNotes
Official Moonbeamhttps://rpc.api.moonbeam.networkwss://wss.api.moonbeam.networkOperated by the Moonbeam team; may be rate-limited
OnFinalityhttps://moonbeam.api.onfinality.io/publicwss://moonbeam.api.onfinality.io/public-wsFree tier available; scalable premium plans
PublicNodehttps://moonbeam-rpc.publicnode.comwss://moonbeam-rpc.publicnode.comFree and privacy-focused
DRPChttps://moonbeam.drpc.orgwss://moonbeam.drpc.orgDecentralized RPC with multi-provider failover
1RPChttps://1rpc.io/glmrPrivacy-preserving, rate-limited
Dwellirhttps://moonbeam-rpc.dwellir.comwss://moonbeam-rpc.dwellir.comRequires API key for dedicated access

Comparing RPC Providers for Moonbeam

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

CriterionWhat to CheckWhy It Matters
ReliabilityUptime history, failover mechanismsEnsures your dApp stays online
ScalabilityRequest-per-second limits, burst capacityHandles traffic spikes without degradation
WebSocket SupportWSS endpoint availabilityRequired for real-time events (e.g., pending transactions)
Archive DataAccess to historical stateNeeded for analytics, audit, and certain smart contract calls
Geographic CoverageServer locations near your usersReduces latency and improves user experience
PricingPay-as-you-go vs. fixed plansAligns with your budget and usage patterns
SupportSLA, community vs. dedicated supportCritical 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();

For WebSocket connections:

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

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.

RPC Knowledge Base

Related RPC details

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started