Skip to content

Commit 7b0f3d4

Browse files
authored
Merge pull request #129 from skip-mev/staging
chore: sync staging -> main
2 parents 454226e + 649618f commit 7b0f3d4

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Diff for: src/constants/rpc.ts

+5
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ export const CHAIN_IDS_L5_NODES = [
22
"secret-4",
33
//
44
];
5+
6+
export const CHAIN_IDS_POLKACHU_BACKUP_NODES = [
7+
"osmosis-1",
8+
//
9+
]

Diff for: src/pages/api/nodes/[$chainID]/[[...$args]].ts

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { PageConfig } from "next";
22
import { NextRequest } from "next/server";
33

4-
import { CHAIN_IDS_L5_NODES } from "@/constants/rpc";
4+
import { CHAIN_IDS_L5_NODES, CHAIN_IDS_POLKACHU_BACKUP_NODES } from "@/constants/rpc";
55
import { getCorsDomains } from "@/lib/edge-config";
66
import { getPolkachuAuthHeader } from "@/utils/api";
77
import { raise } from "@/utils/assert";
@@ -51,11 +51,19 @@ export default async function handler(req: NextRequest) {
5151
searchParams.delete("$args");
5252

5353
const shouldUseL5 = CHAIN_IDS_L5_NODES.includes(chainID);
54+
const shouldUsePolkachuBackup = CHAIN_IDS_POLKACHU_BACKUP_NODES.includes(chainID);
5455

5556
const headers = new Headers();
56-
const rpcURL = shouldUseL5
57-
? `https://skip-secretnetwork-rpc.lavenderfive.com`
58-
: `https://${chainID}-skip-rpc.polkachu.com`;
57+
58+
var rpcURL = '';
59+
60+
if (shouldUseL5) {
61+
rpcURL = `https://skip-secretnetwork-rpc.lavenderfive.com`;
62+
} else if (shouldUsePolkachuBackup) {
63+
rpcURL = `https://${chainID}-skip-rpc-1.polkachu.com`;
64+
} else {
65+
rpcURL = `https://${chainID}-skip-rpc.polkachu.com`;
66+
}
5967

6068
if (!shouldUseL5) {
6169
headers.set("authorization", getPolkachuAuthHeader());

0 commit comments

Comments
 (0)