Logo
RPC Assistant

Moonriver RPC: Endpoints, Configuration, and Best Practices

摘要

Moonriver is an Ethereum-compatible canary network on Kusama, ideal for testing dApps before deploying on Moonbeam. This guide covers Moonriver RPC endpoints, how to configure wallets and tools, and how to choose a reliable RPC provider for production use.

Moonriver RPC Decision Checklist

Before integrating Moonriver RPC into your project, consider the following:

CriterionWhat to checkWhy it matters
Network typeMainnet (chain ID 1285) vs testnetMoonriver is a canary network with real MOVR tokens; ensure you are on the correct network for your use case.
Endpoint typeHTTPS vs WSSUse HTTPS for standard requests, WSS for real-time subscriptions (e.g., event listeners).
Rate limitsPublic vs private endpointsPublic endpoints have rate limits; for production, use a private endpoint or dedicated node.
Archive dataFull vs archive nodeArchive nodes provide historical state; needed for dApps that query past data.
Provider reliabilityUptime, latency, supportChoose a provider with consistent performance and responsive support.
Pricing modelPay-as-you-go vs subscriptionMatch the pricing model to your expected request volume.
SecurityAPI key management, encryptionProtect your API keys and use HTTPS/WSS to secure data in transit.
Geographic distributionNode locationsMultiple regions reduce latency for global users.

What is Moonriver?

Moonriver is a companion network to Moonbeam, serving as an incentivized canary network on the Kusama ecosystem. It provides a full Ethereum-like environment, supporting Solidity smart contracts and Ethereum-compatible tools. Developers use Moonriver to test new features and dApps in a production-like setting before deploying to Moonbeam. The native token is MOVR.

Moonriver Network Details

  • Chain ID: 1285 (0x505 in hex)
  • Currency: MOVR
  • Block Explorer: Moonscan
  • Block Time: ~12 seconds
  • Consensus: Nominated Proof-of-Stake (NPoS) with collators

Moonriver RPC Endpoints

To interact with Moonriver, you need an RPC endpoint. Below are common public endpoints (rate-limited) and private endpoints from providers.

Public Endpoints (for testing)

ProviderHTTPS URLWSS URL
Moonbeam Foundationhttps://rpc.api.moonriver.moonbeam.networkwss://wss.api.moonriver.moonbeam.network
OnFinalityhttps://moonriver.api.onfinality.io/publicwss://moonriver.api.onfinality.io/public-ws
PublicNodehttps://moonriver-rpc.publicnode.comwss://moonriver-rpc.publicnode.com
UnitedBlochttps://moonriver.unitedbloc.comwss://moonriver.unitedbloc.com

Note: Public endpoints are rate-limited and not suitable for production. For reliable access, obtain a private API key from an RPC provider.

Private Endpoints (for production)

Private endpoints offer higher rate limits, dedicated support, and optional archive/trace data. Providers like OnFinality offer managed RPC services with configurable plans. Visit the Moonriver network page for details.

How to Connect to Moonriver

Using curl

curl -H "Content-Type: application/json" \
  -d '{"id":1,"jsonrpc":"2.0","method":"eth_blockNumber","params":[]}' \
  https://moonriver.api.onfinality.io/public

Using ethers.js (JavaScript)

const { ethers } = require("ethers");

const provider = new ethers.JsonRpcProvider(
  "https://moonriver.api.onfinality.io/public",
  { chainId: 1285, name: "moonriver" }
);

async function getBlockNumber() {
  const blockNumber = await provider.getBlockNumber();
  console.log("Current block:", blockNumber);
}

getBlockNumber();

Using web3.py (Python)

from web3 import Web3

w3 = Web3(Web3.HTTPProvider("https://moonriver.api.onfinality.io/public"))
print(w3.eth.block_number)

Adding Moonriver to MetaMask

  1. Open MetaMask and click the network dropdown.
  2. Click "Add Network" or "Custom Network".
  3. Enter the following details:
    • Network Name: Moonriver
    • New RPC URL: https://rpc.api.moonriver.moonbeam.network (or your private endpoint)
    • Chain ID: 1285
    • Currency Symbol: MOVR
    • Block Explorer URL: https://moonriver.moonscan.io
  4. Click "Save".

Choosing an RPC Provider for Moonriver

When selecting an RPC provider, consider:

  • Reliability: Look for providers with consistent uptime and low latency. Check their status page or community feedback.
  • Scalability: Ensure the provider can handle your request volume without throttling.
  • Features: Some providers offer archive nodes, trace APIs, or WebSocket support.
  • Pricing: Compare pay-as-you-go vs subscription plans. Visit RPC pricing for details.
  • Support: Access to technical support can be crucial for production dApps.

OnFinality provides Moonriver RPC endpoints with configurable rate limits, archive support, and dedicated node options. See the Moonriver network page for more information.

Common Pitfalls and Troubleshooting

Rate Limiting

Public endpoints have rate limits (e.g., 25-40 req/s). If you get 429 errors, switch to a private endpoint or reduce request frequency.

Incorrect Chain ID

Ensure your wallet or dApp uses chain ID 1285. Using the wrong chain ID can cause transaction failures.

WebSocket Disconnections

For real-time subscriptions, use WSS endpoints. If disconnections occur, implement reconnection logic in your application.

Missing Archive Data

If your dApp requires historical state, use an archive node. Not all providers offer archive data.

Key Takeaways

  • Moonriver is an Ethereum-compatible canary network on Kusama with chain ID 1285.
  • Public RPC endpoints are available for testing but have rate limits.
  • For production, use a private endpoint from a reliable provider.
  • Configure your tools (MetaMask, ethers.js, etc.) with the correct network details.
  • Evaluate providers based on reliability, scalability, features, and pricing.

Frequently Asked Questions

What is the difference between Moonriver and Moonbeam?

Moonriver is a canary network on Kusama where new features are tested before being deployed to Moonbeam on Polkadot. Moonriver uses MOVR tokens and has real economic value.

Can I use Moonriver for production dApps?

Yes, Moonriver is a live network with real assets. Many dApps deploy on Moonriver to reach the Kusama ecosystem.

How do I get MOVR tokens?

MOVR can be obtained through decentralized exchanges (e.g., SushiSwap on Moonriver) or centralized exchanges that list MOVR.

What are the rate limits for public endpoints?

Rate limits vary by provider. For example, the Moonbeam Foundation endpoint allows 25 req/s, while OnFinality's public endpoint allows 40 req/s. For higher limits, use a private endpoint.

Does OnFinality support Moonriver archive nodes?

Yes, OnFinality offers archive nodes for Moonriver. Check the Moonriver network page for details.

Next Steps

RPC 知识库

相关 RPC 内容

Testnet Rpc

Polygon Amoy 测试网:RPC 端点、水龙头和部署的完整开发者指南

# Polygon Amoy 测试网:RPC 端点、水龙头和部署的完整开发者指南 Polygon Amoy 是 Polygon PoS 的官方测试网,于 2024 年 1 月作为 Mumbai 的继任者启动。Amoy 锚定到 Ethereum Sepolia,为开发者提供了一个可持续、面向未来的环境...

Rpc Provider Selection

哪个RPC提供商提供最可靠的以太坊RPC端点?

# 哪个RPC提供商提供最可靠的以太坊RPC端点? 以太坊RPC端点的可靠性意味着持续的正常运行时间、低延迟、准确的数据以及处理流量高峰而不受速率限制或错误的能力。没有哪个提供商能普遍适用于所有工作负载,但生产团队应根据端点性能、方法支持、归档和追踪访问以及扩展选项来评估提供商。OnFinality...

Network Rpc

关于 Moonbeam RPC 端点,我需要了解什么?

# 关于 Moonbeam RPC 端点,我需要了解什么? Moonbeam RPC 端点之所以重要,是因为 Web3 应用程序依赖稳定的端点访问来进行读取、交易、仪表盘和后端工作流。正确的设置应匹配你的工作负载,支持你所需的网络和测试网,使限制可见,并在共享 RPC 不再足够时为你提供扩展路径。 ...

Network Rpc

选择BSC RPC提供商时应该关注什么?

# 选择BSC RPC提供商时应该关注什么? BSC RPC提供商之所以重要,是因为Web3应用依赖稳定的端点访问来进行读取、交易、仪表盘和后端工作流。正确的设置应匹配你的工作负载,支持你所需的网络和测试网,使限制透明可见,并在共享RPC不再足够时提供扩展路径。 对于BNB Smart Chain构...

Blockchain Infrastructure

区块链节点托管:面向开发者和基础设施采购者的实用指南

# 区块链节点托管:面向开发者和基础设施采购者的实用指南 区块链节点托管是指在专用或云基础设施上运行和维护区块链节点——全节点、归档节点或验证者节点。无论您是构建去中心化应用、运行验证者节点,还是执行分析管道,选择自行托管还是使用托管节点提供商,都会直接影响应用的可靠性、延迟和运营开销。本指南涵盖了...

Network Rpc

关于 Scroll RPC 端点,我需要了解什么?

# 关于 Scroll RPC 端点,我需要了解什么? Scroll RPC 端点至关重要,因为 Web3 应用程序依赖于稳定的端点访问来实现读取、交易、仪表盘和后端工作流。正确的设置应匹配您的工作负载,支持您所需的网络和测试网,使限制可见,并在共享 RPC 不再足够时为您提供扩展路径。 对于 Sc...

永远不用担心基础设施

OnFinality 消除了 DevOps 的繁重工作,让您能够更聪明、更快地构建。

开始