Astar RPC Guide
Production-ready JSON-RPC guide for Astar Network, covering endpoints, network specs, integration patterns, and troubleshooting for builders targeting Polkadot parachain 2006.
Astar RPC
With Dwellir, you get access to our global Astar network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.
Get your API keyWhy Build on Astar?
Multichain smart-contract hub
- Dual EVM + WASM runtimes let teams deploy Solidity and ink! contracts side by side while inheriting Polkadot relay-chain security (Astar build docs).
- Build2Earn dApp staking shares block rewards with developers who attract stakers, turning usage into sustainable funding (Astar dApp staking guide).
Optimized for Polkadot 2.0
- Astar adopted Agile Coretime so parachain capacity scales with demand instead of multi-year lease slots, reducing operating costs for long-lived apps (Polkadot Ecosystem update, Aug 13 2025).
- Asynchronous Backing on mainnet brings ~6-second block production with larger block weight limits for latency-sensitive DeFi and gaming flows (Astar mainnet upgrade announcement).
Enterprise-ready infrastructure
- Dwellir, Chainstack, and other managed providers expose archive-grade RPC endpoints so teams can launch without running collators on day one (Dwellir Astar network page, Chainstack support announcement).
Quick Start with Astar
Connect to Astar, Shibuya testnet, or Shiden canary through Dwellir-managed endpoints.
curl -sS -X POST https://api-astar.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots> \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"chain_getBlockHash","params":[0],"id":1}'import { ApiPromise, WsProvider } from '@polkadot/api';const provider = new WsProvider('wss://api-astar.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>');const api = await ApiPromise.create({ provider });const hash = await api.rpc.chain.getBlockHash(0);console.log(hash.toHex());from substrateinterface import SubstrateInterfacesubstrate = SubstrateInterface(url='wss://api-astar.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>')block_hash = substrate.get_block_hash(block_id=0)print(block_hash)package mainimport ( "bytes" "fmt" "io" "net/http")func main() { url := "https://api-astar.n.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>" payload := []byte(`{"jsonrpc":"2.0","id":1,"method":"chain_getBlockHash","params":[0]}`) resp, err := http.Post(url, "application/json", bytes.NewBuffer(payload)) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body))}Get your API key
Sign up with Dwellir or your preferred infrastructure partner to replace YOUR_API_KEY before sending requests.
Installation & Setup
Network Information
| Parameter | Astar Mainnet | Shiden Canary | Shibuya Testnet |
|---|---|---|---|
| Relay chain | Polkadot | Kusama | Tokyo (Astar-managed) |
| Parachain ID | 2006 | 2007 | 1000 |
| Genesis hash | 0x9eb76c5184c4ab8679d2d5d819fdf90b9c001403e9e17da2e14b6d8aec4029c6 | ||
| Runtime (2025-10-03) | specVersion 1700, transactionVersion 3 | specVersion 1700 | specVersion 1700 |
| Unit symbol | ASTR | SDN | SBY |
| Decimals | 18 | 18 | 18 |
| SS58 prefix | 5 | 5 | 5 |
| Explorer | astar.subscan.io | shiden.subscan.io | shibuya.subscan.io |
Notes
| Parameter | Value | Details |
|---|---|---|
| Genesis Hash Verification | Recorded via chain_getBlockHash(0) on 2025-10-03 | |
| Canary & Testnet Role | Shiden (Kusama canary) and Shibuya (public testnet) provide staging environments for runtime upgrades before they reach mainnet | Astar network overview |
API Reference
Astar exposes the full Substrate RPC surface for block data, storage, extrinsics, and fee estimation, with Frontier also enabling Ethereum-compatible eth_*, net_*, and web3_* endpoints for EVM tooling.
Common Integration Patterns
Subscribe to new heads for live indexing
import { ApiPromise, WsProvider } from '@polkadot/api';
const provider = new WsProvider('wss://api-astar.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });
api.rpc.chain.subscribeNewHeads((header) => {
console.log(`Astar block #${header.number.toString()} => ${header.hash.toHex()}`);
});Fetch native balances via raw storage key
# System.Account for 5-digit treasury account
curl https://api-astar.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "state_getStorage",
"params": [
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e3a5c81a65b0e6ba8e72e48e58704482922ee694ea772dc63a575845fa57a0c5ea93dfdc2a93ec631d9e426962f1e311"
],
"id": 42
}'Decode the SCALE-encoded result with polkadot.js or py-substrate-interface to access data.free, data.reserved, and staking locks.
Pre-flight fees before submitting extrinsics
import { ApiPromise, WsProvider } from '@polkadot/api';
const api = await ApiPromise.create({ provider: new WsProvider('wss://api-astar.n.dwellir.com/YOUR_API_KEY') });
const tx = api.tx.balances.transferKeepAlive(
'5DAAnrj7VHTz5xy1mJQp7vR8J33ePZ8WqWnVfHfV9bPp7PPV',
1_000_000_000_000
);
const info = await api.rpc.payment.queryInfo(tx.toHex());
console.log(info.toHuman());Performance Best Practices
- Prefer WebSocket connections for subscriptions and batched queries; fall back to HTTPS for stateless workloads.
- Cache runtime metadata keyed by the latest
specVersionto avoid re-fetching on every request. - Use
state_getKeysPagedorstate_getStoragePagedwith bounded page sizes when crawling large maps such as staking ledgers. - Track upgrade announcements on the Astar forum and rehearse changes on Shiden before promoting them to mainnet.
- Implement exponential backoff around
author_submitExtrinsic; Frontier queues may temporarily reject payloads when Ethereum traffic spikes.
Troubleshooting
| Symptom | Likely Cause | Resolution |
|---|---|---|
API key does not exist errors | Misconfigured Dwellir endpoint or expired key | Re-issue the key via the Dwellir dashboard and update environment variables. |
| WebSocket disconnects on idle workloads | Provider closes idle connections | Enable heartbeat pings or reconnect logic every 30 seconds. |
Smoke Tests
Run these checks before promoting to production:
- system_health: Expect
isSyncing: falseand peer count > 8. - chain_getHeader: Confirm block numbers advance every ~6 seconds.
- state_getStorage(System.Account): Verify SCALE decoding of balances for a known treasury or team account.
- payment_queryInfo on a signed extrinsic: Validate the fee model before broadcasting from CI/CD.
Resources & Tools
- Astar Documentation: network architecture, node operations, and dApp staking guides.
- Astar GitHub Releases: runtime and client binaries.
- Dwellir Astar Network Page: managed endpoints and quick-start snippets.
- Astar Subscan Explorer: block, extrinsic, and account analytics for monitoring deployments.
Ready to deploy? Spin up a staging environment on Shibuya, soak test on Shiden, then cut over to Astar mainnet with confidence.
rpc_methods
List all available RPC methods on Asset Hub. Essential for API discovery, capability detection, and building dynamic tooling for Substrate-based chains.
chain_getBlock
Retrieve block data by hash on Astar. Essential for accessing block headers and extrinsics on Polkadot's leading dApp hub supporting EVM, WASM, and upcoming PolkaVM environments.

