Summary
peaq is a Polkadot-based Layer-1 blockchain tailored for Decentralized Physical Infrastructure Networks (DePIN) and the machine economy. To interact with the peaq network, developers need reliable RPC endpoints for reading on-chain data, submitting transactions, and monitoring machine identities. This article covers essential chain settings, how to evaluate RPC providers, common debugging tips, and recommended next steps for production deployments.
peaq is a Polkadot-based Layer-1 blockchain designed for Decentralized Physical Infrastructure Networks (DePIN) and the machine economy. It provides on-chain identities, reputation, and payment rails for machines such as robots, vehicles, and sensors. To build on peaq or connect your dApp, you need a reliable RPC endpoint for reading state and sending transactions. This guide covers peaq chain settings, how to choose an RPC provider, common troubleshooting, and production considerations.
peaq RPC Decision Checklist
Before integrating a peaq RPC endpoint, evaluate these factors:
- Latency: Select a provider with geographically distributed nodes and low response times. Peaq's block time is around 8 seconds, so sub-second RPC latency is important for real-time applications.
- Reliability: Check for redundant infrastructure. A single point of failure can cause downtime; look for load-balanced endpoints with SLAs.
- Rate Limits: Understand per-second and per-day limits. Public endpoints often throttle requests, which can block high-frequency querying.
- Archive Support: If you need historical state (e.g., for analytics or machine reputation history), ensure the provider offers archive nodes.
- WebSocket Support: For real-time subscriptions (e.g., machine events), confirm the provider supports WebSocket connections.
- Pricing Model: Compare pay-as-you-go vs. subscription plans. Dedicated nodes offer predictable performance for high-throughput projects.
Chain Settings
| Parameter | Value |
|---|---|
| Network Name | peaq |
| Chain ID | 3338 (0xd0a) |
| Native Currency | PEAQ |
| RPC Endpoint (Example) | https://peaq-rpc.publicnode.com |
| WebSocket Endpoint (Example) | wss://peaq-rpc.publicnode.com |
| Block Explorer | Subscan |
| Consumer | Deployment |
Note: The above public endpoint is one of many options. For production, use a dedicated or premium RPC service to avoid rate limits and ensure uptime.
How to Choose an RPC Provider for peaq
When evaluating RPC providers, consider the criteria in the table below. The right choice depends on your application's scale, data requirements, and budget.
| Criterion | What to check | Why it matters |
|---|---|---|
| Latency | Average response time from multiple regions | Real-time interactions (e.g., machine payments) require fast responses |
| Uptime | Historical uptime percentage and incident logs | Downtime can halt your dApp's operation |
| Archive data | Availability of full historical state | Reputation and identity lookups may need old data |
| WebSocket support | Real-time subscription capability | Machine event monitoring depends on push notifications |
| Rate limits | Requests per second / day allowed | High-frequency queries (e.g., machine fleet polling) need generous limits |
| Pricing | Free tier, pay-as-you-go, or dedicated node cost | Match your budget and traffic patterns |
| Chain coverage | Number of supported networks | If you multi-chain, a single provider simplifies management |
Many developers start with a public endpoint for testing but quickly move to a managed service like OnFinality for production workloads. OnFinality provides scalable RPC APIs and dedicated nodes for multiple blockchains, including peaq and other Polkadot ecosystem chains. Check our supported networks and pricing for details.
Common RPC Methods on peaq
Since peaq is EVM-compatible, standard Ethereum JSON-RPC methods work. Here are a few essential ones:
eth_blockNumber– Get the latest block number.eth_getBalance– Query PEAQ balance of an address.eth_call– Execute a view function on a smart contract.eth_sendRawTransaction– Broadcast a signed transaction.eth_getTransactionReceipt– Check transaction status.
Example using curl:
curl -X POST https://peaq-rpc.publicnode.com \
-H "Content-Type: application/json" \
--data '{
"jsonrpc":"2.0",
"method":"eth_blockNumber",
"params":[],
"id":1
}'
Example using ethers.js:
const { ethers } = require("ethers");
const provider = new ethers.providers.JsonRpcProvider("https://peaq-rpc.publicnode.com");
async function getBlockNumber() {
const blockNumber = await provider.getBlockNumber();
console.log("Latest block:", blockNumber);
}
getBlockNumber();
Debugging Common RPC Issues
Nonce Too Low
When sending multiple transactions from the same account, ensure the nonce increments correctly. Use eth_getTransactionCount with "pending" parameter to get the next nonce.
curl -X POST https://peaq-rpc.publicnode.com \
-H "Content-Type: application/json" \
--data '{
"jsonrpc":"2.0",
"method":"eth_getTransactionCount",
"params":["0xYourAddress", "pending"],
"id":1
}'
Rate Limit Exceeded
Public endpoints often return 429 errors. Switch to a provider with higher rate limits or use a dedicated node.
Timeout Errors
If you see timeouts, the endpoint may be overloaded. Use a provider with load balancing and multiple geographies.
WebSocket Disconnections
For WebSocket subscriptions, implement reconnection logic. Some providers automatically prune idle connections; keep a heartbeat.
Key Takeaways
- peaq is an EVM-compatible Layer-1 for DePIN with chain ID 3338 and native token PEAQ.
- Choose an RPC provider based on latency, reliability, archive support, WebSocket, and pricing.
- Use standard Ethereum JSON-RPC methods for development; many Web3 libraries work out of the box.
- Public endpoints are suitable for testing but not production. Consider a managed service like OnFinality for scalable infrastructure.
- Debug common issues like nonce mismatches, rate limits, and timeout errors with appropriate provider configurations.
Frequently Asked Questions
What is the peaq chain ID?
The peaq mainnet chain ID is 3338 (hex 0xd0a).
Does peaq support WebSocket RPC?
Yes, most RPC providers offer WebSocket endpoints for real-time subscriptions. Example: wss://peaq-rpc.publicnode.com.
Can I use Metamask with peaq?
Yes, peaq is EVM-compatible. Add the network manually using chain ID 3338 and any RPC URL.
Where can I get PEAQ testnet tokens?
peaq has a testnet (chain ID 3338? actually peaq has agung testnet). Check the official peaq docs for faucet details. For mainnet, you'll need to acquire PEAQ via exchanges or bridges.
How do I run my own peaq node?
You can run a full node using the peaq client. However, for most dApps, a managed RPC service is simpler and more reliable. For a complete list of networks and API options, visit our [networks page](/networks) and [RPC pricing](/pricing/rpc).