Skip to content
Chapters

Infrastructure

RPC: your own, not the public one

Why the public endpoint fails during the demo, and how to configure your own without leaking the key.

Solana's public endpoint exists for trying things, not for demonstrating them: it rate-limits you (429) exactly when somebody is watching — a demo, a user, an investor.

How to get an endpoint, in order:

  1. You are in a Superteam Argentina programme (the local hackathon, Path to Solana, a cohort): there is a Triton One API key for your team. Ask the mentors or the programme's channel for it. Do not push it to GitHub.
  2. You want your own Triton account: triton.one — pay-as-you-go, no free tier, with a US$125 minimum deposit that lasts 12 months and covers every product.
  3. You want to start free: the free plan at Helius or QuickNode is enough for the first weeks. The configuration below is the same; only the URL changes.

The next page compares what each provider offers.

Endpoint format (you get it with the key):

HTTPS:  https://<your-endpoint>.rpcpool.com/<API_KEY>
WSS:    wss://<your-endpoint>.rpcpool.com/<API_KEY>

Where to put it

.env.local (frontend) — and add it to .gitignore:

NEXT_PUBLIC_SOLANA_RPC=https://<your-endpoint>.rpcpool.com/<API_KEY>
NEXT_PUBLIC_SOLANA_WSS=wss://<your-endpoint>.rpcpool.com/<API_KEY>

Careful with NEXT_PUBLIC_: anything that starts with it ships to every visitor's browser, API key included. For the hackathon that is fine — the key is rate-limited and gets rotated afterwards — but in production the keyed endpoint sits behind your backend, or you use a domain-restricted key from the Triton dashboard.

Anchor.toml gets committed, so the key does not go there. Leave cluster = "devnet" and pass the keyed URL from outside:

anchor deploy --provider.cluster "https://<your-endpoint>.rpcpool.com/<API_KEY>"
ANCHOR_PROVIDER_URL=https://<your-endpoint>.rpcpool.com/<API_KEY> anchor test --skip-local-validator --skip-deploy

CLI:

solana config set --url https://<your-endpoint>.rpcpool.com/<API_KEY>

Client with @solana/kit:

import { createSolanaRpc, createSolanaRpcSubscriptions } from "@solana/kit";

const rpc = createSolanaRpc(process.env.NEXT_PUBLIC_SOLANA_RPC!);
const rpcSubscriptions = createSolanaRpcSubscriptions(process.env.NEXT_PUBLIC_SOLANA_WSS!);

Reading history (every transaction of an account, the tokens in a wallet, your program's events): do not iterate over blocks. Use your RPC provider's APIs (Triton has Yellowstone gRPC for streams; Helius has DAS and webhooks) or an indexer. Reading the onchain past is not a SELECT.

Docs: docs.triton.one · alternatives with hackathon discounts: Helius, FluxRPC, QuickNode.