Peaq RPC: How to Connect to the DePIN Layer 1
Key Takeaways
- Peaq is a Substrate-based Layer 1 and Polkadot parachain for DePIN and machine economy applications.
- Peaq supports both EVM (Solidity) and Substrate (Rust) development environments.
- The Peaq mainnet chain ID is 3338, and the native token is PEAQ.
- Public RPC endpoints are available but may have rate limits and reliability issues for production use.
- Dedicated node services offer higher reliability, lower latency, and dedicated throughput for demanding applications.
- When selecting an RPC provider, consider uptime, geographic distribution, and support for both JSON-RPC and Substrate APIs.
- OnFinality provides managed RPC endpoints and dedicated nodes for Peaq, suitable for production workloads.
What is Peaq?
Peaq is a Layer 1 blockchain built on Substrate, operating as a parachain within the Polkadot ecosystem. It is designed specifically for Decentralized Physical Infrastructure Networks (DePIN) and the Machine Economy, enabling machines, vehicles, and devices to autonomously interact, transact, and provide services. Peaq's architecture supports dual execution environments: EVM-compatible smart contracts (Solidity) and Substrate pallets (Rust), giving developers flexibility. The network uses parallelized block production and asynchronous backing for efficient transaction processing, and it communicates with other parachains via Polkadot's Cross-Consensus Messaging (XCM) protocol.
- Chain ID: 3338 (0xd0a)
- Native Token: PEAQ
- Consensus: Nominated Proof-of-Stake (NPoS) via Polkadot relay chain
- Block Time: Approximately 12 seconds
- Explorer: Subscan (https://peaq.subscan.io)
Peaq RPC Endpoints
For production applications, it is recommended to use a managed RPC provider that offers high availability, low latency, and dedicated throughput. OnFinality provides Peaq RPC endpoints as part of its API service, with options for dedicated nodes to meet the demands of DePIN applications.
| Criterion | What to check | Why it matters |
|---|---|---|
| Provider | Endpoint URL | Reliability & Features |
| PublicNode | https://peaq-rpc.publicnode.com | Free, public endpoint with rate limits; good for testing |
| QuickNode | https://quicknode1.peaq.xyz (example) | Managed service with global distribution; requires API key |
| Dwellir | https://api-peaq.dwellir.com/{api-key} | Dedicated clusters available; paid plans |
| OnFinality | Available via /networks/peaq | Managed RPC with dedicated node options; reliable for production |
How to Connect to Peaq RPC
Connecting to Peaq RPC is straightforward. You can use standard Web3 libraries like ethers.js, web3.js, or Polkadot.js depending on your development environment. Below are examples for both EVM and Substrate interactions.
- For EVM: Use the Ethereum JSON-RPC endpoint with chain ID 3338. Example with ethers.js: new ethers.providers.JsonRpcProvider('https://peaq-rpc.publicnode.com')
- For Substrate: Use the Substrate JSON-RPC endpoint with Polkadot.js. Example: const { ApiPromise, WsProvider } = require('@polkadot/api'); const api = await ApiPromise.create({ provider: new WsProvider('wss://peaq-rpc.publicnode.com') });
- Always verify the endpoint URL and ensure it supports the methods you need (e.g., eth_call, eth_getLogs for EVM; chain_getBlock for Substrate).
Choosing a Peaq RPC Provider
OnFinality offers a managed Peaq RPC service with competitive pricing, global endpoints, and support for both EVM and Substrate APIs. For high-traffic DePIN projects, dedicated nodes provide isolated resources and predictable performance.
| Criterion | What to check | Why it matters |
|---|---|---|
| Uptime SLA | Provider's historical uptime and guarantees | Downtime can disrupt your dApp; look for 99.9%+ SLA |
| Latency | Geographic distribution of nodes | Lower latency improves user experience; global nodes help |
| Rate Limits | Requests per second (RPS) and monthly limits | Public endpoints may throttle; dedicated plans offer higher limits |
| API Support | Both EVM and Substrate JSON-RPC methods | Peaq's dual environment requires both; ensure provider supports both |
| Pricing | Free tier vs. paid plans | Match your budget and usage; free tiers are good for development |
Common Use Cases for Peaq RPC
Peaq's focus on DePIN and machine economy opens up several use cases that rely on RPC infrastructure:
- Machine Identity & Data: Register and manage machine identities (peaq IDs) and store machine-generated data on-chain.
- Pay-per-Use Payments: Enable autonomous payments for services like charging, parking, or data sharing.
- Tokenization of Real-World Assets: Represent physical assets (e.g., vehicles, energy units) as tokens.
- Cross-Chain Communication: Use XCM to interact with other Polkadot parachains for interoperability.
- dApp Backends: Power DePIN applications that require reliable, low-latency access to on-chain state.
Troubleshooting Peaq RPC Connections
If you encounter issues connecting to Peaq RPC, consider these common solutions:
- Check Chain ID: Ensure your wallet or dApp uses chain ID 3338 for Peaq mainnet.
- Verify Endpoint URL: Confirm the RPC URL is correct and includes the proper protocol (https for HTTP, wss for WebSocket).
- Rate Limiting: If you receive 429 errors, reduce request frequency or upgrade to a paid plan.
- Method Not Supported: Some public endpoints may not support debug or trace methods; use a dedicated provider if needed.
- Network Congestion: During high traffic, block times may increase; consider using a provider with higher throughput.
Conclusion
Peaq is a promising Layer 1 for DePIN and machine economy applications, offering dual execution environments and Polkadot interoperability. Choosing the right RPC provider is crucial for building reliable and scalable dApps. Whether you are prototyping with public endpoints or deploying production applications with dedicated nodes, OnFinality provides flexible infrastructure options to support your Peaq development journey.
Frequently Asked Questions
What is the Peaq chain ID?
The Peaq mainnet chain ID is 3338 (0xd0a in hexadecimal).
What is the native token of Peaq?
The native token is PEAQ, used for transaction fees and network participation.
Does Peaq support EVM?
Yes, Peaq is EVM-compatible, allowing you to deploy Solidity smart contracts using standard Ethereum tooling.
Can I use Polkadot.js with Peaq?
Yes, Peaq supports Substrate JSON-RPC, so you can use Polkadot.js for native interactions.
Where can I find a reliable Peaq RPC endpoint?
OnFinality offers managed Peaq RPC endpoints. Visit /networks/peaq for details.