Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Drop keyless Ankr from Solana RPC failover, add PublicNode

nirholas40a169dbc42c
diff --git a/api/_lib/solana/connection.js b/api/_lib/solana/connection.js
index fc03e3a95..11d00ada2 100644
--- a/api/_lib/solana/connection.js
+++ b/api/_lib/solana/connection.js
@@ -10,9 +10,10 @@
// safe: Solana dedupes by signature.
//
// Priority (per network): the caller's explicit url (if any) → Helius → Alchemy
-// → Ankr → the keyless public endpoint, always last. We never depend on the
-// public endpoint alone — it is the most aggressively rate-limited (the source of
-// the `getBalance 429` log noise).
+// → Ankr (authenticated only) → PublicNode → the keyless public endpoint, always
+// last. We never depend on the public endpoint alone — it is the most
+// aggressively rate-limited (the source of the `getBalance 429` log noise) — and
+// we never include a keyless Ankr URL, which Ankr now answers with a hard 403.
import { Connection } from '@solana/web3.js';
@@ -87,6 +88,7 @@ function inferNetwork(url) {
export function solanaRpcEndpoints(network = 'mainnet', url = null) {
const key = process.env.HELIUS_API_KEY;
const alch = process.env.ALCHEMY_API_KEY;
+ const ankr = process.env.ANKR_API_KEY;
if (network === 'devnet') {
return dedupe([
url,
@@ -101,7 +103,15 @@ export function solanaRpcEndpoints(network = 'mainnet', url = null) {
process.env.SOLANA_RPC_URL,
key && `https://mainnet.helius-rpc.com/?api-key=${key}`,
alch && `https://solana-mainnet.g.alchemy.com/v2/${alch}`,
- 'https://rpc.ankr.com/solana',
+ // Ankr sunset keyless access — every keyless rpc.ankr.com/<chain> now 403s
+ // ("authenticate with an API key"), so include it only in its authenticated
+ // form when ANKR_API_KEY is set. Mirrors idxRpcUrls() in api/cron/[name].js;
+ // a keyless entry here was a guaranteed 403 + cooldown log every cron tick.
+ ankr && `https://rpc.ankr.com/solana/${ankr}`,
+ // PublicNode — a keyless, un-throttled fallback (the same node mcp-server
+ // uses) so failover lands on a working endpoint instead of depending on the
+ // aggressively rate-limited public mainnet-beta endpoint alone.
+ 'https://solana-rpc.publicnode.com',
PUBLIC_MAINNET,
]);
}
diff --git a/api/_lib/solana/rpc-fallback.js b/api/_lib/solana/rpc-fallback.js
index 07a2acd66..c98671b19 100644
--- a/api/_lib/solana/rpc-fallback.js
+++ b/api/_lib/solana/rpc-fallback.js
@@ -171,9 +171,10 @@ export function createRpcFallback(options) {
}
// Convenience: build a fallback set from env. The endpoint list is the canonical
-// chain (explicit SOLANA_RPC_URL → Helius → Alchemy → Ankr → public), with any
-// extra SOLANA_RPC_FALLBACK_URLS appended. So even with no SOLANA_RPC_URL set,
-// the keyed providers and public endpoint give a real 3+ deep failover set.
+// chain (explicit SOLANA_RPC_URL → Helius → Alchemy → Ankr-when-keyed →
+// PublicNode → public), with any extra SOLANA_RPC_FALLBACK_URLS appended. So even
+// with no SOLANA_RPC_URL set, the keyed providers plus the two keyless endpoints
+// give a real 3+ deep failover set.
export function rpcFallbackFromEnv({ network = 'mainnet', commitment = 'confirmed' } = {}) {
const extra = (process.env.SOLANA_RPC_FALLBACK_URLS || '')
.split(',').map((s) => s.trim()).filter(Boolean);