Summary
Moonbeam is an Ethereum-compatible parachain on Polkadot. To interact with it, you need a JSON-RPC endpoint. This page covers public endpoints, supported JSON-RPC methods, and how to choose a production-grade RPC provider for Moonbeam, Moonriver, and Moonbase Alpha.
Moonbeam API Decision Checklist
Before you start building on Moonbeam, evaluate these factors to choose the right API approach:
| Criterion | What to check | Why it matters |
|---|---|---|
| Network type | Moonbeam (Polkadot), Moonriver (Kusama), or Moonbase Alpha (testnet) | Each has a separate endpoint and GLMR/MOVR/DEV token |
| Endpoint reliability | Uptime history, rate limits, and dedicated node options | Public endpoints may throttle; production apps need consistent availability |
| Archive data | Does the provider support archive node requests? | Required for historical state queries (e.g., eth_call on past blocks) |
| WebSocket support | WSS URL available | Needed for real-time subscriptions (e.g., pending transactions) |
| JSON-RPC method coverage | Full Ethereum API compatibility plus Moonbeam-specific methods | Most dApps require eth_, net_, web3_*, plus debug/trace |
| Pricing model | Pay-as-you-go vs. flat subscription vs. dedicated node | Choose based on your request volume and budget |
Moonbeam Network Overview
Moonbeam is a fully Ethereum-compatible parachain on the Polkadot network. It allows developers to deploy existing Solidity smart contracts with minimal changes while benefiting from Polkadot's shared security and cross-chain interoperability. The network has three core environments:
- Moonbeam (mainnet) – GLMR token, connected to Polkadot
- Moonriver (canary net) – MOVR token, connected to Kusama
- Moonbase Alpha (testnet) – DEV token, for development and testing
All three support the standard Ethereum JSON-RPC interface, making them compatible with MetaMask, Hardhat, Truffle, and other familiar developer tools.
Public vs. Production RPC Endpoints
Public Endpoints (Free, Limited)
The Moonbeam Foundation and other providers offer public endpoints for development and low-volume use. They are rate-limited and not recommended for production apps.
| Network | HTTPS URL | WSS URL | Rate Limit |
|---|---|---|---|
| Moonbeam | https://rpc.api.moonbeam.network | wss://wss.api.moonbeam.network | 25 req/s |
| Moonriver | https://rpc.api.moonriver.moonbeam.network | wss://wss.api.moonriver.moonbeam.network | 25 req/s |
| Moonbase Alpha | https://rpc.api.moonbase.moonbeam.network | wss://wss.api.moonbase.moonbeam.network | 25 req/s |
Production RPC Provider Options
For production dApps, you need a reliable RPC provider that offers higher rate limits, dedicated nodes, and archive data. OnFinality provides RPC endpoints for all Moonbeam networks with scalable infrastructure. You can also consider providers listed in the Moonbeam documentation.
When choosing a provider, look for:
- Transparent pricing (e.g., free tier, pay-as-you-go, dedicated nodes)
- Archive node support
- WebSocket (WSS) availability
- Multi-region failover and uptime guarantees (use cautious wording)
- Developer-friendly dashboard and API keys
Essential JSON-RPC Methods on Moonbeam
Moonbeam supports the standard Ethereum JSON-RPC methods plus some additional APIs. Below are the most commonly used methods.
Core Ethereum Methods
// Example: Get the latest block number
curl -X POST https://moonbeam.api.onfinality.io/public \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_blockNumber",
"params":[],
"id":1
}'
Methods List
| Method | Description | Notes |
|---|---|---|
eth_blockNumber | Latest block number | |
eth_getBalance | Account balance | Supports block tag |
eth_call | Execute a read-only contract call | Supports archive blocks |
eth_estimateGas | Estimate gas for a transaction | |
eth_gasPrice | Current gas price | |
eth_getLogs | Filter event logs | Use address, topics, block range |
eth_getTransactionReceipt | Get receipt by hash | |
eth_sendRawTransaction | Submit a signed transaction | |
net_version | Network ID (1284 for Moonbeam) | |
web3_clientVersion | Client version |
Moonbeam-Specific & Debug/Trace
debug_traceTransaction: For debugging transaction execution (requires archive node)trace_filter: Parity-style trace filteringeth_subscribe(WSS): Real-time event subscriptions
Note: Some methods (like
trace_*) require a provider that supports trace API. Check with your provider before relying on these features.
How to Connect with Popular Tools
MetaMask
- Open MetaMask and click "Add Network" manually.
- Enter these details for Moonbeam:
- Network Name: Moonbeam
- RPC URL:
https://moonbeam.api.onfinality.io/public - Chain ID:
1284 - Currency Symbol:
GLMR - Block Explorer URL:
https://moonbeam.subscan.io
Hardhat
// hardhat.config.js
module.exports = {
networks: {
moonbeam: {
url: "https://moonbeam.api.onfinality.io/public",
chainId: 1284,
accounts: ["<PRIVATE_KEY>"]
}
}
};
ethers.js
const { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider(
"https://moonbeam.api.onfinality.io/public"
);
const blockNumber = await provider.getBlockNumber();
console.log("Current block:", blockNumber);
Common Pitfalls and Troubleshooting
- Rate limiting: Public endpoints will throttle after a certain number of requests per second. Use a dedicated or shared private endpoint for production.
- Archive data: Many providers offer only full nodes (latest state). If you need eth_call on historical blocks, ensure the provider supports archive mode.
- WebSocket disconnects: For real-time dApps, monitor connection health and implement reconnection logic.
- Chain ID mismatch: Moonbeam uses 1284, Moonriver uses 1285, Moonbase Alpha uses 1287. Double-check when configuring wallets.
- Faucet: For Moonbase Alpha testnet DEV tokens, use the official faucet.
Choosing a Provider: What to Compare
Not all RPC providers are equal for Moonbeam. Use this checklist when evaluating:
- Rate limits: Match your expected request volume. Free plans are fine for testing; production needs higher limits.
- Geographic distribution: Global endpoints reduce latency for your users.
- Archive support: Essential for analytics, historical dApps, and some DeFi protocols.
- Trace API: Required for tools like Tenderly or custom debugging.
- Pricing transparency: No hidden fees, clear per-request or monthly pricing.
- Support: SLA and developer support availability.
OnFinality offers RPC services for Moonbeam with multiple tiers, archive support, and WebSocket endpoints. Check the Moonbeam network page for endpoint details.
Frequently Asked Questions
Q: What is the difference between Moonbeam and Moonriver? Moonbeam is the mainnet parachain on Polkadot (GLMR), while Moonriver is the canary network on Kusama (MOVR). Both share identical Ethereum compatibility but have different tokenomics and security models.
Q: Can I use Ethereum libraries (ethers.js, web3.js) on Moonbeam? Yes, Moonbeam is fully Ethereum-compatible. All standard Ethereum libraries work out of the box with a Moonbeam RPC endpoint.
Q: How do I get free DEV tokens for Moonbase Alpha? Use the official Moonbase Alpha faucet to receive DEV tokens daily.
Q: Does Moonbeam support EIP-1559?
Yes, Moonbeam supports EIP-1559 fee market. Use eth_feeHistory and eth_maxPriorityFeePerGas methods.
Q: Where can I find the complete list of JSON-RPC methods?
The Moonbeam API overview lists all supported methods. Additionally, you can use eth_subscribe for real-time events.
Key Takeaways
- Moonbeam provides Ethereum-compatible JSON-RPC endpoints for mainnet, canary, and testnet.
- Public endpoints are suitable for development but not production due to rate limits.
- Choose a production RPC provider based on rate limits, archive support, WebSocket, and pricing.
- Standard Ethereum tools (MetaMask, Hardhat, ethers.js) work seamlessly with Moonbeam.
- For debugging and advanced use cases, ensure your provider supports trace and archive APIs.
Start building on Moonbeam today by connecting to a reliable RPC API from OnFinality or another provider that meets your requirements.