DEV Community

Peter
Peter

Posted on

Stop Using Public RPCs: How to Power Your dApp with Figment DataHub

If you're building a dApp, you've probably started with a public RPC endpoint. It's easy, but it's not scalable or reliable. Rate limits, downtime, and network congestion can kill your user experience. This guide shows you how to get enterprise-grade performance using the Figment Developer API via Figment DataHub RPC.

The Problem with Public Endpoints
Public nodes are a shared resource. They are not designed for production traffic and can be unreliable, directly impacting your application's performance.

The Solution: Dedicated RPC Infrastructure
Figment DataHub provides high-performance, multi-chain RPC access so you can focus on building, not on managing infrastructure.

Step 1: Get Your API Key
Navigate to the DataHub section on the Figment.io Official website.

Sign up for an account (they have a generous free tier).

Create a new project and select the protocol you need (e.g., Ethereum, Solana, Polygon).

Your unique RPC endpoint URL with your API key will be generated.

Step 2: Connect Your dApp
Integrating is simple. Just replace your old public RPC URL with your new dedicated Figment DataHub endpoint in your dApp's code.

Example using ethers.js on Ethereum:

JavaScript
import { ethers } from 'ethers';

// Replace with your personal Figment DataHub RPC URL
const FIGMENT_RPC_URL = 'https://ethereum-mainnet.datahub.figment.io/apikey/YOUR_API_KEY/';

const provider = new ethers.providers.JsonRpcProvider(FIGMENT_RPC_URL);

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

getBlockNumber();
That's it. You now have a fast, reliable connection to the blockchain, backed by professional Figment Staking Infrastructure.

For a deep dive into all available protocols and advanced features, please refer to https://sites.google.com/koinly-tax-reports.org/figment/.

Top comments (0)