Logo
RPC Assistant

Astar RPC Endpoints: Chain Settings, Public Nodes, and Production Considerations

Summary

Astar is a Polkadot parachain that offers EVM and Wasm smart contract support. This page lists public and provider-hosted Astar RPC endpoints, chain configuration details, and guidance for choosing an RPC provider for production dApps.

Astar RPC Decision Checklist

Before selecting an Astar RPC endpoint for your project, consider these factors:

CriterionWhat to checkWhy it matters
Public vs. privateRate limits, reliability, and uptime guaranteesPublic endpoints may throttle requests; private endpoints offer dedicated capacity for production apps
EVM vs. SubstrateDoes the endpoint support EVM JSON-RPC methods?Astar has both EVM and native Substrate layers; ensure your provider supports the methods you need
WebSocket supportAvailability of wss:// endpointsRequired for real-time event listening and subscriptions
Archive dataDoes the node store historical state?Needed for dApps that query past balances or events
Geographic latencyProximity of node to your users or backendLower latency improves transaction submission speed and user experience
Provider reputationTrack record, support, and network coverageA reliable provider reduces downtime and maintenance overhead

Astar Network Overview

Astar Network is a Polkadot parachain that supports both EVM and WebAssembly (Wasm) smart contracts. It serves as a hub for cross-chain dApps, connecting the Polkadot ecosystem with Ethereum and other major blockchains. Developers building on Astar can use standard Ethereum tooling (MetaMask, Hardhat, ethers.js) alongside Substrate-native tools.

Astar Chain Configuration

To connect to Astar, you need the following chain details:

Public Astar RPC Endpoints

Public endpoints are free to use but come with rate limits and no uptime guarantees. They are suitable for testing, light dApp usage, and development. Here are some commonly available public endpoints:

ProviderHTTPS URLWebSocket URL
Astar Teamhttps://evm.astar.networkwss://rpc.astar.network
OnFinalityhttps://astar.api.onfinality.io/publicwss://astar.api.onfinality.io/public-ws
Dwellirhttps://astar-rpc.n.dwellir.comwss://astar-rpc.n.dwellir.com
BlastAPIhttps://astar.public.blastapi.iowss://astar.public.blastapi.io
1RPChttps://1rpc.io/astr
RadiumBlockhttps://astar.public.curie.radiumblock.co/httpwss://astar.public.curie.radiumblock.co/ws
Alchemyhttps://astar-mainnet.g.alchemy.com/v2/demo

Note: Public endpoints are rate-limited. For production workloads, consider a dedicated node or a managed RPC service.

Using Astar RPC with Ethereum Libraries

Since Astar is EVM-compatible, you can use standard Ethereum libraries to interact with it. Below is an example using ethers.js:

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

// Connect to Astar via a public endpoint
const provider = new ethers.providers.JsonRpcProvider("https://astar.api.onfinality.io/public");

// Get the latest block number
provider.getBlockNumber().then((blockNumber) => {
  console.log("Current block number:", blockNumber);
});

// Get ASTR balance of an address
const address = "0x...";
provider.getBalance(address).then((balance) => {
  console.log("Balance:", ethers.utils.formatEther(balance), "ASTR");
});

When to Move Beyond Public Endpoints

Public endpoints are convenient for prototyping, but they have limitations:

  • Rate limiting: Too many requests can result in 429 errors.
  • No SLA: Uptime and performance are not guaranteed.
  • Shared resources: Other users' traffic can affect your latency.
  • Limited methods: Some advanced RPC methods (e.g., trace_*, debug_*) may not be available.

For production dApps, you need a reliable RPC provider that offers:

  • Dedicated nodes with guaranteed throughput.
  • Archive nodes for historical data queries.
  • WebSocket support for real-time subscriptions.
  • Global infrastructure to minimize latency.

Choosing an Astar RPC Provider

When evaluating RPC providers for Astar, consider the following:

  1. Network coverage: Does the provider have nodes in multiple regions?
  2. Pricing model: Pay-as-you-go vs. subscription; free tier availability.
  3. Supported methods: Ensure the provider supports the JSON-RPC methods your dApp needs (e.g., eth_call, eth_getLogs, eth_subscribe).
  4. Archive data: If your dApp requires historical state, confirm archive node support.
  5. WebSocket: Essential for event-driven applications.
  6. Documentation and support: Clear API docs and responsive support channels.

OnFinality offers dedicated and shared Astar RPC endpoints with competitive pricing. You can find more details on the Astar network page and RPC pricing page.

Common Pitfalls and Troubleshooting

  • Incorrect Chain ID: Always use chain ID 592 for Astar mainnet. Using the wrong chain ID will cause transaction failures.
  • Rate limit exceeded: If you receive HTTP 429 errors, reduce request frequency or upgrade to a private endpoint.
  • WebSocket disconnections: Ensure your client handles reconnection logic gracefully.
  • Method not found: Some public endpoints disable certain RPC methods. Check the provider's documentation.

Key Takeaways

  • Astar is an EVM-compatible Polkadot parachain with chain ID 592.
  • Public RPC endpoints are available for testing and light use, but they have rate limits and no SLA.
  • For production dApps, choose a managed RPC provider that offers dedicated nodes, archive data, and WebSocket support.
  • Evaluate providers based on latency, reliability, pricing, and supported methods.
  • OnFinality provides Astar RPC endpoints as part of its multi-chain infrastructure. Visit the supported networks page for more information.

Frequently Asked Questions

Q: What is the Astar chain ID? A: The Astar mainnet chain ID is 592 (0x250).

Q: Can I use MetaMask with Astar? A: Yes, MetaMask supports Astar. Add a custom network with the RPC URL and chain ID 592.

Q: Are there testnet endpoints for Astar? A: Yes, Astar has a testnet called Shibuya. Endpoints are available from the Astar team and other providers.

Q: How do I get an ASTR balance via RPC? A: Use the eth_getBalance method with the address and block parameter. The balance is returned in Wei.

Q: What is the difference between public and private RPC endpoints? A: Public endpoints are free but rate-limited and shared. Private endpoints offer dedicated capacity, higher rate limits, and SLAs.

Q: Does OnFinality support Astar? A: Yes, OnFinality provides public and private Astar RPC endpoints. See the Astar network page for details.

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