mirror of
https://github.com/luxfi/indexer.git
synced 2026-09-24 00:25:37 +00:00
chore: migrate luxd HTTP routes /ext -> /v1
Drop the Avalanche-heritage /ext prefix; /v1 is the single canonical route surface (one way, no backward compat). The node's baseURL is the source of truth; clients, SDKs, CLI, indexer, maker, genesis, netrunner, and the k8s/compose/gateway/explorer configs are updated to match. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -27,7 +27,7 @@ vet:
|
||||
go vet ./...
|
||||
|
||||
dev:
|
||||
go run ./cmd/indexerd --rpc=http://localhost:9630/ext/bc/C/rpc --chain-name="C-Chain" --coin=LUX --chain-id=96369
|
||||
go run ./cmd/indexerd --rpc=http://localhost:9630/v1/bc/C/rpc --chain-name="C-Chain" --coin=LUX --chain-id=96369
|
||||
|
||||
dev-config:
|
||||
go run ./cmd/indexerd --config=chains.example.yaml
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
// TestNew tests adapter creation
|
||||
func TestNew(t *testing.T) {
|
||||
endpoint := "http://localhost:9650/ext/bc/A"
|
||||
endpoint := "http://localhost:9650/v1/bc/A"
|
||||
adapter := New(endpoint)
|
||||
|
||||
if adapter == nil {
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
// TestNew tests adapter creation
|
||||
func TestNew(t *testing.T) {
|
||||
endpoint := "http://localhost:9650/ext/bc/B"
|
||||
endpoint := "http://localhost:9650/v1/bc/B"
|
||||
adapter := New(endpoint)
|
||||
|
||||
if adapter == nil {
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ func TestConfigValidation(t *testing.T) {
|
||||
cfg := Config{
|
||||
ChainType: ChainP,
|
||||
ChainName: "P-Chain",
|
||||
RPCEndpoint: "http://localhost:9630/ext/bc/P",
|
||||
RPCEndpoint: "http://localhost:9630/v1/bc/P",
|
||||
RPCMethod: "pvm",
|
||||
DataDir: "/tmp/test-indexer/pchain",
|
||||
HTTPPort: 4100,
|
||||
|
||||
+15
-15
@@ -19,7 +19,7 @@ chains:
|
||||
name: C-Chain
|
||||
chain_id: 96369
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/C/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/C/rpc
|
||||
coin: LUX
|
||||
enabled: true
|
||||
default: true
|
||||
@@ -31,7 +31,7 @@ chains:
|
||||
- slug: pchain
|
||||
name: P-Chain
|
||||
type: linear
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/P
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/P
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -39,7 +39,7 @@ chains:
|
||||
- slug: xchain
|
||||
name: X-Chain
|
||||
type: dag
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/X
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/X
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -47,7 +47,7 @@ chains:
|
||||
- slug: achain
|
||||
name: A-Chain
|
||||
type: dag
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/A
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/A
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -55,7 +55,7 @@ chains:
|
||||
- slug: bchain
|
||||
name: B-Chain
|
||||
type: dag
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/B
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/B
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -63,7 +63,7 @@ chains:
|
||||
- slug: qchain
|
||||
name: Q-Chain
|
||||
type: dag
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/Q
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/Q
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -71,7 +71,7 @@ chains:
|
||||
- slug: tchain
|
||||
name: T-Chain
|
||||
type: dag
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/T
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/T
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -79,7 +79,7 @@ chains:
|
||||
- slug: zchain
|
||||
name: Z-Chain
|
||||
type: dag
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/Z
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/Z
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -87,7 +87,7 @@ chains:
|
||||
- slug: kchain
|
||||
name: K-Chain
|
||||
type: dag
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/K
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/K
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -99,7 +99,7 @@ chains:
|
||||
name: Zoo
|
||||
chain_id: 200200
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/Zoo/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/Zoo/rpc
|
||||
coin: ZOO
|
||||
enabled: true
|
||||
graph:
|
||||
@@ -110,7 +110,7 @@ chains:
|
||||
name: Hanzo AI
|
||||
chain_id: 36963
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/Hanzo/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/Hanzo/rpc
|
||||
coin: HANZO
|
||||
enabled: true
|
||||
|
||||
@@ -118,7 +118,7 @@ chains:
|
||||
name: SPC
|
||||
chain_id: 36911
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/SPC/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/SPC/rpc
|
||||
coin: SPC
|
||||
enabled: true
|
||||
|
||||
@@ -126,7 +126,7 @@ chains:
|
||||
name: Pars
|
||||
chain_id: 494949
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/Pars/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/Pars/rpc
|
||||
coin: PARS
|
||||
enabled: true
|
||||
|
||||
@@ -135,7 +135,7 @@ chains:
|
||||
name: DEX
|
||||
chain_id: 0
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/ext/bc/D/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/bc/D/rpc
|
||||
coin: LUX
|
||||
enabled: true
|
||||
graph:
|
||||
@@ -202,7 +202,7 @@ chains:
|
||||
name: Avalanche
|
||||
chain_id: 43114
|
||||
type: evm
|
||||
rpc: ${AVAX_RPC:-https://api.avax.network/ext/bc/C/rpc}
|
||||
rpc: ${AVAX_RPC:-https://api.avax.network/v1/bc/C/rpc}
|
||||
coin: AVAX
|
||||
enabled: true
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// frontend.
|
||||
//
|
||||
// indexerd --config=chains.yaml
|
||||
// indexerd --rpc=http://localhost:9650/ext/bc/C/rpc (single chain mode)
|
||||
// indexerd --rpc=http://localhost:9650/v1/bc/C/rpc (single chain mode)
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -134,7 +134,7 @@ func resolveConfig(configFile, rpcFlag, chainName, coinSymbol string, chainID in
|
||||
}
|
||||
|
||||
fmt.Println("Usage:")
|
||||
fmt.Println(" indexerd --rpc=http://localhost:9650/ext/bc/C/rpc (single chain)")
|
||||
fmt.Println(" indexerd --rpc=http://localhost:9650/v1/bc/C/rpc (single chain)")
|
||||
fmt.Println(" indexerd --config=chains.yaml (multi-chain)")
|
||||
os.Exit(1)
|
||||
return daemon.Config{}
|
||||
|
||||
+7
-7
@@ -46,7 +46,7 @@ services:
|
||||
container_name: lux-pchain-indexer
|
||||
command: ["-chain", "pchain", "-port", "4000"]
|
||||
environment:
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/ext/bc/P
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/bc/P
|
||||
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_pchain?sslmode=disable
|
||||
HTTP_PORT: 4000
|
||||
ports:
|
||||
@@ -63,7 +63,7 @@ services:
|
||||
container_name: lux-xchain-indexer
|
||||
command: ["-chain", "xchain", "-port", "4000"]
|
||||
environment:
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/ext/bc/X
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/bc/X
|
||||
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_xchain?sslmode=disable
|
||||
HTTP_PORT: 4000
|
||||
ports:
|
||||
@@ -80,7 +80,7 @@ services:
|
||||
container_name: lux-achain-indexer
|
||||
command: ["-chain", "achain", "-port", "4000"]
|
||||
environment:
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/ext/bc/A
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/bc/A
|
||||
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_achain?sslmode=disable
|
||||
HTTP_PORT: 4000
|
||||
ports:
|
||||
@@ -97,7 +97,7 @@ services:
|
||||
container_name: lux-bchain-indexer
|
||||
command: ["-chain", "bchain", "-port", "4000"]
|
||||
environment:
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/ext/bc/B
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/bc/B
|
||||
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_bchain?sslmode=disable
|
||||
HTTP_PORT: 4000
|
||||
ports:
|
||||
@@ -114,7 +114,7 @@ services:
|
||||
container_name: lux-qchain-indexer
|
||||
command: ["-chain", "qchain", "-port", "4000"]
|
||||
environment:
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/ext/bc/Q
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/bc/Q
|
||||
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_qchain?sslmode=disable
|
||||
HTTP_PORT: 4000
|
||||
ports:
|
||||
@@ -131,7 +131,7 @@ services:
|
||||
container_name: lux-tchain-indexer
|
||||
command: ["-chain", "tchain", "-port", "4000"]
|
||||
environment:
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/ext/bc/T
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/bc/T
|
||||
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_tchain?sslmode=disable
|
||||
HTTP_PORT: 4000
|
||||
ports:
|
||||
@@ -148,7 +148,7 @@ services:
|
||||
container_name: lux-zchain-indexer
|
||||
command: ["-chain", "zchain", "-port", "4000"]
|
||||
environment:
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/ext/bc/Z
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/bc/Z
|
||||
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_zchain?sslmode=disable
|
||||
HTTP_PORT: 4000
|
||||
ports:
|
||||
|
||||
+33
-33
@@ -12,8 +12,8 @@ lux:
|
||||
name: "Lux C-Chain"
|
||||
symbol: "LUX"
|
||||
type: evm
|
||||
rpc: "https://api.lux.network/ext/bc/C/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/C/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/C/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/C/ws"
|
||||
explorer: "https://explore.lux.network"
|
||||
enabled: true
|
||||
protocols:
|
||||
@@ -29,8 +29,8 @@ lux:
|
||||
name: "Lux Testnet"
|
||||
symbol: "LUX"
|
||||
type: evm
|
||||
rpc: "https://api.testnet.lux.network/ext/bc/C/rpc"
|
||||
ws: "wss://api.testnet.lux.network/ext/bc/C/ws"
|
||||
rpc: "https://api.testnet.lux.network/v1/bc/C/rpc"
|
||||
ws: "wss://api.testnet.lux.network/v1/bc/C/ws"
|
||||
explorer: "https://explore.testnet.lux.network"
|
||||
enabled: true
|
||||
|
||||
@@ -40,8 +40,8 @@ lux:
|
||||
name: "Zoo Mainnet"
|
||||
symbol: "ZOO"
|
||||
type: evm
|
||||
rpc: "https://api.zoo.network/ext/bc/C/rpc"
|
||||
ws: "wss://api.zoo.network/ext/bc/C/ws"
|
||||
rpc: "https://api.zoo.network/v1/bc/C/rpc"
|
||||
ws: "wss://api.zoo.network/v1/bc/C/ws"
|
||||
explorer: "https://explore.zoo.network"
|
||||
enabled: true
|
||||
|
||||
@@ -50,7 +50,7 @@ lux:
|
||||
name: "Zoo Testnet"
|
||||
symbol: "ZOO"
|
||||
type: evm
|
||||
rpc: "https://api.testnet.zoo.network/ext/bc/C/rpc"
|
||||
rpc: "https://api.testnet.zoo.network/v1/bc/C/rpc"
|
||||
explorer: "https://explore.testnet.zoo.network"
|
||||
enabled: true
|
||||
|
||||
@@ -60,8 +60,8 @@ lux:
|
||||
name: "Hanzo AI"
|
||||
symbol: "HANZO"
|
||||
type: evm
|
||||
rpc: "https://api.hanzo.ai/ext/bc/C/rpc"
|
||||
ws: "wss://api.hanzo.ai/ext/bc/C/ws"
|
||||
rpc: "https://api.hanzo.ai/v1/bc/C/rpc"
|
||||
ws: "wss://api.hanzo.ai/v1/bc/C/ws"
|
||||
explorer: "https://explore.hanzo.ai"
|
||||
enabled: true
|
||||
|
||||
@@ -70,7 +70,7 @@ lux:
|
||||
name: "Hanzo AI Testnet"
|
||||
symbol: "HANZO"
|
||||
type: evm
|
||||
rpc: "https://api.testnet.hanzo.ai/ext/bc/C/rpc"
|
||||
rpc: "https://api.testnet.hanzo.ai/v1/bc/C/rpc"
|
||||
explorer: "https://explore.testnet.hanzo.ai"
|
||||
enabled: true
|
||||
|
||||
@@ -80,8 +80,8 @@ lux:
|
||||
name: "SPC Mainnet"
|
||||
symbol: "SPC"
|
||||
type: evm
|
||||
rpc: "https://api.sparklepony.club/ext/bc/C/rpc"
|
||||
ws: "wss://api.sparklepony.club/ext/bc/C/ws"
|
||||
rpc: "https://api.sparklepony.club/v1/bc/C/rpc"
|
||||
ws: "wss://api.sparklepony.club/v1/bc/C/ws"
|
||||
explorer: "https://explore.sparklepony.club"
|
||||
enabled: true
|
||||
|
||||
@@ -90,7 +90,7 @@ lux:
|
||||
name: "SPC Testnet"
|
||||
symbol: "SPC"
|
||||
type: evm
|
||||
rpc: "https://api.testnet.sparklepony.club/ext/bc/C/rpc"
|
||||
rpc: "https://api.testnet.sparklepony.club/v1/bc/C/rpc"
|
||||
explorer: "https://explore.testnet.sparklepony.club"
|
||||
enabled: true
|
||||
|
||||
@@ -100,8 +100,8 @@ lux:
|
||||
name: "PARS Mainnet"
|
||||
symbol: "PARS"
|
||||
type: evm
|
||||
rpc: "https://api.pars.network/ext/bc/C/rpc"
|
||||
ws: "wss://api.pars.network/ext/bc/C/ws"
|
||||
rpc: "https://api.pars.network/v1/bc/C/rpc"
|
||||
ws: "wss://api.pars.network/v1/bc/C/ws"
|
||||
explorer: "https://explore.pars.network"
|
||||
enabled: true
|
||||
|
||||
@@ -110,7 +110,7 @@ lux:
|
||||
name: "PARS Testnet"
|
||||
symbol: "PARS"
|
||||
type: evm
|
||||
rpc: "https://api.testnet.pars.network/ext/bc/C/rpc"
|
||||
rpc: "https://api.testnet.pars.network/v1/bc/C/rpc"
|
||||
explorer: "https://explore.testnet.pars.network"
|
||||
enabled: true
|
||||
|
||||
@@ -124,8 +124,8 @@ lux:
|
||||
name: "Lux A-Chain (AI)"
|
||||
symbol: "LUX"
|
||||
type: lux_ai
|
||||
rpc: "https://api.lux.network/ext/bc/A/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/A/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/A/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/A/ws"
|
||||
explorer: "https://explore.lux.network/a-chain"
|
||||
enabled: true
|
||||
|
||||
@@ -135,8 +135,8 @@ lux:
|
||||
name: "Lux B-Chain (Bridge)"
|
||||
symbol: "LUX"
|
||||
type: lux_bridge
|
||||
rpc: "https://api.lux.network/ext/bc/B/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/B/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/B/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/B/ws"
|
||||
explorer: "https://explore.lux.network/b-chain"
|
||||
enabled: true
|
||||
|
||||
@@ -146,8 +146,8 @@ lux:
|
||||
name: "Lux T-Chain (Threshold)"
|
||||
symbol: "LUX"
|
||||
type: lux_threshold
|
||||
rpc: "https://api.lux.network/ext/bc/T/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/T/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/T/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/T/ws"
|
||||
explorer: "https://explore.lux.network/t-chain"
|
||||
enabled: true
|
||||
|
||||
@@ -157,8 +157,8 @@ lux:
|
||||
name: "Lux Z-Chain (ZK)"
|
||||
symbol: "LUX"
|
||||
type: lux_zk
|
||||
rpc: "https://api.lux.network/ext/bc/Z/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/Z/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/Z/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/Z/ws"
|
||||
explorer: "https://explore.lux.network/z-chain"
|
||||
enabled: true
|
||||
|
||||
@@ -168,8 +168,8 @@ lux:
|
||||
name: "Lux G-Chain (Graph)"
|
||||
symbol: "LUX"
|
||||
type: lux_graph
|
||||
rpc: "https://api.lux.network/ext/bc/G/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/G/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/G/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/G/ws"
|
||||
explorer: "https://explore.lux.network/g-chain"
|
||||
enabled: true
|
||||
|
||||
@@ -179,8 +179,8 @@ lux:
|
||||
name: "Lux I-Chain (Identity)"
|
||||
symbol: "LUX"
|
||||
type: lux_identity
|
||||
rpc: "https://api.lux.network/ext/bc/I/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/I/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/I/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/I/ws"
|
||||
explorer: "https://explore.lux.network/i-chain"
|
||||
enabled: true
|
||||
|
||||
@@ -190,8 +190,8 @@ lux:
|
||||
name: "Lux K-Chain (Key)"
|
||||
symbol: "LUX"
|
||||
type: lux_key
|
||||
rpc: "https://api.lux.network/ext/bc/K/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/K/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/K/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/K/ws"
|
||||
explorer: "https://explore.lux.network/k-chain"
|
||||
enabled: true
|
||||
|
||||
@@ -201,8 +201,8 @@ lux:
|
||||
name: "Lux D-Chain (DEX)"
|
||||
symbol: "LUX"
|
||||
type: lux_dex
|
||||
rpc: "https://api.lux.network/ext/bc/D/rpc"
|
||||
ws: "wss://api.lux.network/ext/bc/D/ws"
|
||||
rpc: "https://api.lux.network/v1/bc/D/rpc"
|
||||
ws: "wss://api.lux.network/v1/bc/D/ws"
|
||||
explorer: "https://explore.lux.network/d-chain"
|
||||
enabled: true
|
||||
|
||||
@@ -589,7 +589,7 @@ ethereum:
|
||||
name: "Avalanche C-Chain"
|
||||
symbol: "AVAX"
|
||||
type: evm
|
||||
rpc: "${AVAX_RPC_URL:-https://api.avax.network/ext/bc/C/rpc}"
|
||||
rpc: "${AVAX_RPC_URL:-https://api.avax.network/v1/bc/C/rpc}"
|
||||
explorer: "https://snowtrace.io"
|
||||
enabled: true
|
||||
protocols:
|
||||
|
||||
@@ -10,33 +10,33 @@ chains:
|
||||
name: "Lux C-Chain"
|
||||
chain_id: 96369
|
||||
port: 4000
|
||||
rpc: "${CCHAIN_RPC:-http://luxd-headless.lux-mainnet.svc:9630/ext/bc/C/rpc}"
|
||||
rpc: "${CCHAIN_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/bc/C/rpc}"
|
||||
enabled: true
|
||||
|
||||
- slug: zoo
|
||||
name: "Zoo"
|
||||
chain_id: 200200
|
||||
port: 5000
|
||||
rpc: "${ZOO_RPC:-http://luxd-headless.lux-mainnet.svc:9630/ext/bc/2m7XTBQ1knXzpTd5tD5mKhBoBGfYzLjgWCy4UPBZFrJwJi9PDn/rpc}"
|
||||
rpc: "${ZOO_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/bc/2m7XTBQ1knXzpTd5tD5mKhBoBGfYzLjgWCy4UPBZFrJwJi9PDn/rpc}"
|
||||
enabled: true
|
||||
|
||||
- slug: hanzo
|
||||
name: "Hanzo"
|
||||
chain_id: 36963
|
||||
port: 5100
|
||||
rpc: "${HANZO_RPC:-http://luxd-headless.lux-mainnet.svc:9630/ext/bc/2qGPCad983bniHe6MxKYcHqhGnATAYnY78TiDVSmjGFfmUpoAq/rpc}"
|
||||
rpc: "${HANZO_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/bc/2qGPCad983bniHe6MxKYcHqhGnATAYnY78TiDVSmjGFfmUpoAq/rpc}"
|
||||
enabled: true
|
||||
|
||||
- slug: spc
|
||||
name: "SPC"
|
||||
chain_id: 36911
|
||||
port: 5200
|
||||
rpc: "${SPC_RPC:-http://luxd-headless.lux-mainnet.svc:9630/ext/bc/2GWgFPEeVAoivJdbBfJrmY2DDtn8TCSV7R7diwqVbMDhPkSiYn/rpc}"
|
||||
rpc: "${SPC_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/bc/2GWgFPEeVAoivJdbBfJrmY2DDtn8TCSV7R7diwqVbMDhPkSiYn/rpc}"
|
||||
enabled: true
|
||||
|
||||
- slug: pars
|
||||
name: "Pars"
|
||||
chain_id: 494949
|
||||
port: 5300
|
||||
rpc: "${PARS_RPC:-http://luxd-headless.lux-mainnet.svc:9630/ext/bc/2ouFvjHhVc3qX3wJNBMERvrE9fHBPf3dQd6n1fyxNyhwi52YhY/rpc}"
|
||||
rpc: "${PARS_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/bc/2ouFvjHhVc3qX3wJNBMERvrE9fHBPf3dQd6n1fyxNyhwi52YhY/rpc}"
|
||||
enabled: true
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@ func TestConfigDefaults(t *testing.T) {
|
||||
cfg := Config{
|
||||
ChainType: ChainX,
|
||||
ChainName: "X-Chain",
|
||||
RPCEndpoint: "http://localhost:9630/ext/bc/X",
|
||||
RPCEndpoint: "http://localhost:9630/v1/bc/X",
|
||||
DataDir: "/tmp/test-indexer/xchain",
|
||||
HTTPPort: 4200,
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ data:
|
||||
name: Lux C-Chain
|
||||
chain_id: 96369
|
||||
type: evm
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/ext/bc/C/rpc
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/bc/C/rpc
|
||||
coin: LUX
|
||||
enabled: true
|
||||
default: true
|
||||
@@ -134,40 +134,40 @@ data:
|
||||
name: Zoo
|
||||
chain_id: 200200
|
||||
type: evm
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/ext/bc/Zoo/rpc
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/bc/Zoo/rpc
|
||||
coin: ZOO
|
||||
enabled: true
|
||||
- slug: hanzo
|
||||
name: Hanzo AI
|
||||
chain_id: 36963
|
||||
type: evm
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/ext/bc/Hanzo/rpc
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/bc/Hanzo/rpc
|
||||
coin: HANZO
|
||||
enabled: true
|
||||
- slug: spc
|
||||
name: SPC
|
||||
chain_id: 36911
|
||||
type: evm
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/ext/bc/SPC/rpc
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/bc/SPC/rpc
|
||||
coin: SPC
|
||||
enabled: true
|
||||
- slug: pars
|
||||
name: Pars
|
||||
chain_id: 494949
|
||||
type: evm
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/ext/bc/Pars/rpc
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/bc/Pars/rpc
|
||||
coin: PARS
|
||||
enabled: true
|
||||
# DAG chains
|
||||
- slug: xchain
|
||||
name: X-Chain
|
||||
type: dag
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/ext/bc/X
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/bc/X
|
||||
coin: LUX
|
||||
enabled: true
|
||||
- slug: pchain
|
||||
name: P-Chain
|
||||
type: linear
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/ext/bc/P
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/bc/P
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
// TestNew tests the adapter constructor
|
||||
func TestNew(t *testing.T) {
|
||||
endpoint := "http://localhost:9650/ext/bc/DEX/rpc"
|
||||
endpoint := "http://localhost:9650/v1/bc/DEX/rpc"
|
||||
adapter := New(endpoint)
|
||||
|
||||
if adapter == nil {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ type TestConfig struct {
|
||||
func DefaultConfig() *TestConfig {
|
||||
rpcURL := os.Getenv("LUX_RPC_URL")
|
||||
if rpcURL == "" {
|
||||
rpcURL = "http://127.0.0.1:9650/ext/bc/C/rpc"
|
||||
rpcURL = "http://127.0.0.1:9650/v1/bc/C/rpc"
|
||||
}
|
||||
|
||||
return &TestConfig{
|
||||
|
||||
+18
-18
@@ -195,8 +195,8 @@ func findLuxd() string {
|
||||
// waitForNode waits for the node to be ready
|
||||
func waitForNode(port int, timeout time.Duration) {
|
||||
deadline := time.Now().Add(timeout)
|
||||
// Info API is at /ext/info
|
||||
client := NewRPCClient(fmt.Sprintf("http://127.0.0.1:%d/ext/info", port))
|
||||
// Info API is at /v1/info
|
||||
client := NewRPCClient(fmt.Sprintf("http://127.0.0.1:%d/v1/info", port))
|
||||
|
||||
for time.Now().Before(deadline) {
|
||||
// Check bootstrap status via info API
|
||||
@@ -216,18 +216,18 @@ func GetRPCEndpoint(chain string) string {
|
||||
// Check for external node via LUX_RPC_URL
|
||||
if baseURL := os.Getenv("LUX_RPC_URL"); baseURL != "" {
|
||||
// Extract host:port from base URL
|
||||
// e.g., http://127.0.0.1:9650/ext/bc/C/rpc -> http://127.0.0.1:9650
|
||||
parts := strings.Split(baseURL, "/ext/")
|
||||
// e.g., http://127.0.0.1:9650/v1/bc/C/rpc -> http://127.0.0.1:9650
|
||||
parts := strings.Split(baseURL, "/v1/")
|
||||
host := parts[0]
|
||||
switch strings.ToUpper(chain) {
|
||||
case "C":
|
||||
return host + "/ext/bc/C/rpc"
|
||||
return host + "/v1/bc/C/rpc"
|
||||
case "P":
|
||||
return host + "/ext/bc/P"
|
||||
return host + "/v1/bc/P"
|
||||
case "X":
|
||||
return host + "/ext/bc/X"
|
||||
return host + "/v1/bc/X"
|
||||
default:
|
||||
return host + "/ext/bc/" + chain + "/rpc"
|
||||
return host + "/v1/bc/" + chain + "/rpc"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,38 +238,38 @@ func GetRPCEndpoint(chain string) string {
|
||||
|
||||
switch strings.ToUpper(chain) {
|
||||
case "C":
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/ext/bc/C/rpc", port)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/bc/C/rpc", port)
|
||||
case "P":
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/ext/bc/P", port)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/bc/P", port)
|
||||
case "X":
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/ext/bc/X", port)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/bc/X", port)
|
||||
default:
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/ext/bc/%s/rpc", port, chain)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/bc/%s/rpc", port, chain)
|
||||
}
|
||||
}
|
||||
|
||||
// GetInfoEndpoint returns the info API endpoint
|
||||
func GetInfoEndpoint() string {
|
||||
if baseURL := os.Getenv("LUX_RPC_URL"); baseURL != "" {
|
||||
parts := strings.Split(baseURL, "/ext/")
|
||||
return parts[0] + "/ext/info"
|
||||
parts := strings.Split(baseURL, "/v1/")
|
||||
return parts[0] + "/v1/info"
|
||||
}
|
||||
port := 9650
|
||||
if nodeConfig != nil {
|
||||
port = nodeConfig.HTTPPort
|
||||
}
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/ext/info", port)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/info", port)
|
||||
}
|
||||
|
||||
// GetAdminEndpoint returns the admin API endpoint
|
||||
func GetAdminEndpoint() string {
|
||||
if baseURL := os.Getenv("LUX_RPC_URL"); baseURL != "" {
|
||||
parts := strings.Split(baseURL, "/ext/")
|
||||
return parts[0] + "/ext/admin"
|
||||
parts := strings.Split(baseURL, "/v1/")
|
||||
return parts[0] + "/v1/admin"
|
||||
}
|
||||
port := 9650
|
||||
if nodeConfig != nil {
|
||||
port = nodeConfig.HTTPPort
|
||||
}
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/ext/admin", port)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/admin", port)
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
// TestNew tests the adapter constructor
|
||||
func TestNew(t *testing.T) {
|
||||
endpoint := "http://localhost:9650/ext/bc/C/rpc"
|
||||
endpoint := "http://localhost:9650/v1/bc/C/rpc"
|
||||
adapter := New(endpoint)
|
||||
|
||||
if adapter == nil {
|
||||
|
||||
+10
-10
@@ -19,8 +19,8 @@ var DefaultChains = []ChainConfig{
|
||||
ChainID: ChainIDLuxMainnet,
|
||||
Name: "Lux C-Chain",
|
||||
Symbol: "LUX",
|
||||
RPCEndpoint: "https://api.lux.network/ext/bc/C/rpc",
|
||||
WSEndpoint: "wss://api.lux.network/ext/bc/C/ws",
|
||||
RPCEndpoint: "https://api.lux.network/v1/bc/C/rpc",
|
||||
WSEndpoint: "wss://api.lux.network/v1/bc/C/ws",
|
||||
ExplorerURL: "https://explorer.lux.network",
|
||||
IsTestnet: false,
|
||||
BlockTime: 2000,
|
||||
@@ -33,8 +33,8 @@ var DefaultChains = []ChainConfig{
|
||||
ChainID: ChainIDLuxTestnet,
|
||||
Name: "Lux C-Chain Testnet",
|
||||
Symbol: "LUX",
|
||||
RPCEndpoint: "https://api.testnet.lux.network/ext/bc/C/rpc",
|
||||
WSEndpoint: "wss://api.testnet.lux.network/ext/bc/C/ws",
|
||||
RPCEndpoint: "https://api.testnet.lux.network/v1/bc/C/rpc",
|
||||
WSEndpoint: "wss://api.testnet.lux.network/v1/bc/C/ws",
|
||||
ExplorerURL: "https://explorer.testnet.lux.network",
|
||||
IsTestnet: true,
|
||||
BlockTime: 2000,
|
||||
@@ -47,8 +47,8 @@ var DefaultChains = []ChainConfig{
|
||||
ChainID: ChainIDZooMainnet,
|
||||
Name: "Zoo Network",
|
||||
Symbol: "ZOO",
|
||||
RPCEndpoint: "https://api.zoo.network/ext/bc/zoo/rpc",
|
||||
WSEndpoint: "wss://api.zoo.network/ext/bc/zoo/ws",
|
||||
RPCEndpoint: "https://api.zoo.network/v1/bc/zoo/rpc",
|
||||
WSEndpoint: "wss://api.zoo.network/v1/bc/zoo/ws",
|
||||
ExplorerURL: "https://explorer.zoo.network",
|
||||
IsTestnet: false,
|
||||
BlockTime: 2000,
|
||||
@@ -61,8 +61,8 @@ var DefaultChains = []ChainConfig{
|
||||
ChainID: ChainIDZooTestnet,
|
||||
Name: "Zoo Network Testnet",
|
||||
Symbol: "ZOO",
|
||||
RPCEndpoint: "https://api.testnet.zoo.network/ext/bc/zoo/rpc",
|
||||
WSEndpoint: "wss://api.testnet.zoo.network/ext/bc/zoo/ws",
|
||||
RPCEndpoint: "https://api.testnet.zoo.network/v1/bc/zoo/rpc",
|
||||
WSEndpoint: "wss://api.testnet.zoo.network/v1/bc/zoo/ws",
|
||||
ExplorerURL: "https://explorer.testnet.zoo.network",
|
||||
IsTestnet: true,
|
||||
BlockTime: 2000,
|
||||
@@ -75,8 +75,8 @@ var DefaultChains = []ChainConfig{
|
||||
ChainID: ChainIDHanzoMainnet,
|
||||
Name: "Hanzo AI Chain",
|
||||
Symbol: "AI",
|
||||
RPCEndpoint: "https://api.hanzo.ai/ext/bc/hanzo/rpc",
|
||||
WSEndpoint: "wss://api.hanzo.ai/ext/bc/hanzo/ws",
|
||||
RPCEndpoint: "https://api.hanzo.ai/v1/bc/hanzo/rpc",
|
||||
WSEndpoint: "wss://api.hanzo.ai/v1/bc/hanzo/ws",
|
||||
ExplorerURL: "https://explorer.hanzo.ai",
|
||||
IsTestnet: false,
|
||||
BlockTime: 1000,
|
||||
|
||||
@@ -28,7 +28,7 @@ type RPCCall struct {
|
||||
}
|
||||
|
||||
// New creates a Transport for the given endpoint, auto-detecting ZAP vs HTTP.
|
||||
// ZAP is used when the endpoint contains "/ext/" (luxd node path pattern)
|
||||
// ZAP is used when the endpoint contains "/v1/" (luxd node path pattern)
|
||||
// and a ZAP port is reachable. Falls back to HTTP otherwise.
|
||||
func New(endpoint string) Transport {
|
||||
if isLuxdEndpoint(endpoint) {
|
||||
@@ -44,12 +44,12 @@ func New(endpoint string) Transport {
|
||||
|
||||
// isLuxdEndpoint returns true if the endpoint looks like a luxd node.
|
||||
func isLuxdEndpoint(endpoint string) bool {
|
||||
return strings.Contains(endpoint, "/ext/")
|
||||
return strings.Contains(endpoint, "/v1/")
|
||||
}
|
||||
|
||||
// luxdZAPAddr derives the ZAP TCP address from a luxd HTTP endpoint.
|
||||
// luxd listens for ZAP on HTTP port + 10 by convention.
|
||||
// e.g. http://luxd-0.luxd:9630/ext/bc/C/rpc -> luxd-0.luxd:9640
|
||||
// e.g. http://luxd-0.luxd:9630/v1/bc/C/rpc -> luxd-0.luxd:9640
|
||||
func luxdZAPAddr(endpoint string) string {
|
||||
// Strip scheme
|
||||
addr := endpoint
|
||||
|
||||
@@ -189,9 +189,9 @@ func TestIsLuxdEndpoint(t *testing.T) {
|
||||
endpoint string
|
||||
want bool
|
||||
}{
|
||||
{"http://luxd-0.luxd:9630/ext/bc/C/rpc", true},
|
||||
{"http://localhost:9650/ext/bc/C/rpc", true},
|
||||
{"https://api.lux.network/mainnet/ext/bc/C/rpc", true},
|
||||
{"http://luxd-0.luxd:9630/v1/bc/C/rpc", true},
|
||||
{"http://localhost:9650/v1/bc/C/rpc", true},
|
||||
{"https://api.lux.network/mainnet/v1/bc/C/rpc", true},
|
||||
{"http://localhost:8545", false},
|
||||
{"https://mainnet.infura.io/v3/key", false},
|
||||
}
|
||||
@@ -211,10 +211,10 @@ func TestLuxdZAPAddr(t *testing.T) {
|
||||
endpoint string
|
||||
want string
|
||||
}{
|
||||
{"http://luxd-0.luxd:9630/ext/bc/C/rpc", "luxd-0.luxd:9640"},
|
||||
{"http://localhost:9650/ext/bc/C/rpc", "localhost:9660"},
|
||||
{"https://api.lux.network/mainnet/ext/bc/C/rpc", "api.lux.network:9640"},
|
||||
{"http://10.0.0.1:19630/ext/bc/C/rpc", "10.0.0.1:19640"},
|
||||
{"http://luxd-0.luxd:9630/v1/bc/C/rpc", "luxd-0.luxd:9640"},
|
||||
{"http://localhost:9650/v1/bc/C/rpc", "localhost:9660"},
|
||||
{"https://api.lux.network/mainnet/v1/bc/C/rpc", "api.lux.network:9640"},
|
||||
{"http://10.0.0.1:19630/v1/bc/C/rpc", "10.0.0.1:19640"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
@@ -235,7 +235,7 @@ func TestNewFallsBackToHTTP(t *testing.T) {
|
||||
}
|
||||
|
||||
// luxd endpoint with unreachable ZAP port should fall back to HTTP
|
||||
tr = New("http://localhost:1/ext/bc/C/rpc")
|
||||
tr = New("http://localhost:1/v1/bc/C/rpc")
|
||||
if _, ok := tr.(*HTTP); !ok {
|
||||
t.Errorf("expected *HTTP fallback for unreachable ZAP, got %T", tr)
|
||||
}
|
||||
@@ -378,7 +378,7 @@ func TestZAPCall(t *testing.T) {
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
z, err := NewZAP(addr, "http://localhost/ext/bc/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/bc/C/rpc")
|
||||
if err != nil {
|
||||
t.Fatalf("NewZAP: %v", err)
|
||||
}
|
||||
@@ -407,7 +407,7 @@ func TestZAPCallWithParams(t *testing.T) {
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
z, err := NewZAP(addr, "http://localhost/ext/bc/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/bc/C/rpc")
|
||||
if err != nil {
|
||||
t.Fatalf("NewZAP: %v", err)
|
||||
}
|
||||
@@ -444,7 +444,7 @@ func TestZAPBatchCall(t *testing.T) {
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
z, err := NewZAP(addr, "http://localhost/ext/bc/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/bc/C/rpc")
|
||||
if err != nil {
|
||||
t.Fatalf("NewZAP: %v", err)
|
||||
}
|
||||
@@ -472,7 +472,7 @@ func TestZAPCallRPCError(t *testing.T) {
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
z, err := NewZAP(addr, "http://localhost/ext/bc/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/bc/C/rpc")
|
||||
if err != nil {
|
||||
t.Fatalf("NewZAP: %v", err)
|
||||
}
|
||||
@@ -490,7 +490,7 @@ func TestZAPClose(t *testing.T) {
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
z, err := NewZAP(addr, "http://localhost/ext/bc/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/bc/C/rpc")
|
||||
if err != nil {
|
||||
t.Fatalf("NewZAP: %v", err)
|
||||
}
|
||||
@@ -507,7 +507,7 @@ func TestZAPClose(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestZAPConnectFail(t *testing.T) {
|
||||
_, err := NewZAP("127.0.0.1:1", "http://localhost/ext/bc/C/rpc")
|
||||
_, err := NewZAP("127.0.0.1:1", "http://localhost/v1/bc/C/rpc")
|
||||
if err == nil {
|
||||
t.Fatal("expected error connecting to closed port")
|
||||
}
|
||||
@@ -521,7 +521,7 @@ func TestZAPCallContextTimeout(t *testing.T) {
|
||||
})
|
||||
defer cleanup()
|
||||
|
||||
z, err := NewZAP(addr, "http://localhost/ext/bc/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/bc/C/rpc")
|
||||
if err != nil {
|
||||
t.Fatalf("NewZAP: %v", err)
|
||||
}
|
||||
|
||||
+2
-2
@@ -284,8 +284,8 @@ func TestChainConfigSerialization(t *testing.T) {
|
||||
ChainID: 96369,
|
||||
Name: "Lux C-Chain",
|
||||
Symbol: "LUX",
|
||||
RPCEndpoint: "https://api.lux.network/ext/bc/C/rpc",
|
||||
WSEndpoint: "wss://api.lux.network/ext/bc/C/ws",
|
||||
RPCEndpoint: "https://api.lux.network/v1/bc/C/rpc",
|
||||
WSEndpoint: "wss://api.lux.network/v1/bc/C/ws",
|
||||
ExplorerURL: "https://explorer.lux.network",
|
||||
IsTestnet: false,
|
||||
BlockTime: 2000,
|
||||
|
||||
@@ -46,7 +46,7 @@ type Config struct {
|
||||
CoinDecimals int
|
||||
|
||||
// GChainEndpoint is the G-Chain GraphQL endpoint on the node.
|
||||
// Default: http://localhost:9650/ext/bc/G/graphql
|
||||
// Default: http://localhost:9650/v1/bc/G/graphql
|
||||
// Set via GCHAIN_ENDPOINT env var.
|
||||
GChainEndpoint string
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultGChainEndpoint = "http://localhost:9650/ext/bc/G/graphql"
|
||||
defaultGChainEndpoint = "http://localhost:9650/v1/bc/G/graphql"
|
||||
graphqlProxyTimeout = 30 * time.Second
|
||||
)
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ func TestGraphqlErrorResponse(t *testing.T) {
|
||||
|
||||
func TestNewGraphQLProxy(t *testing.T) {
|
||||
t.Run("valid endpoint", func(t *testing.T) {
|
||||
proxy, err := newGraphQLProxy("http://localhost:9650/ext/bc/G/graphql")
|
||||
proxy, err := newGraphQLProxy("http://localhost:9650/v1/bc/G/graphql")
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
// TestNew tests the adapter constructor
|
||||
func TestNew(t *testing.T) {
|
||||
endpoint := "http://localhost:9650/ext/bc/K/rpc"
|
||||
endpoint := "http://localhost:9650/v1/bc/K/rpc"
|
||||
adapter := New(endpoint)
|
||||
|
||||
if adapter == nil {
|
||||
|
||||
@@ -26,11 +26,11 @@ CREATE TABLE chains (
|
||||
);
|
||||
|
||||
INSERT INTO chains (chain_id, name, symbol, rpc_url) VALUES
|
||||
(96369, 'Lux C-Chain', 'LUX', 'http://localhost:9630/ext/bc/C/rpc'),
|
||||
(96368, 'Lux Testnet', 'LUX', 'http://localhost:9640/ext/bc/C/rpc'),
|
||||
(200200, 'Zoo Mainnet', 'ZOO', 'http://localhost:9630/ext/bc/Zoo/rpc'),
|
||||
(200201, 'Zoo Testnet', 'ZOO', 'http://localhost:9640/ext/bc/Zoo/rpc'),
|
||||
(36963, 'Hanzo AI', 'HANZO', 'http://localhost:9630/ext/bc/Hanzo/rpc');
|
||||
(96369, 'Lux C-Chain', 'LUX', 'http://localhost:9630/v1/bc/C/rpc'),
|
||||
(96368, 'Lux Testnet', 'LUX', 'http://localhost:9640/v1/bc/C/rpc'),
|
||||
(200200, 'Zoo Mainnet', 'ZOO', 'http://localhost:9630/v1/bc/Zoo/rpc'),
|
||||
(200201, 'Zoo Testnet', 'ZOO', 'http://localhost:9640/v1/bc/Zoo/rpc'),
|
||||
(36963, 'Hanzo AI', 'HANZO', 'http://localhost:9630/v1/bc/Hanzo/rpc');
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Blocks (Partitioned by chain_id)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultRPCEndpoint = "http://localhost:9650/ext/bc/P"
|
||||
DefaultRPCEndpoint = "http://localhost:9650/v1/bc/P"
|
||||
DefaultHTTPPort = 4100
|
||||
)
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ func TestNew(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "custom endpoint",
|
||||
endpoint: "http://localhost:9650/ext/bc/P",
|
||||
expected: "http://localhost:9650/ext/bc/P",
|
||||
endpoint: "http://localhost:9650/v1/bc/P",
|
||||
expected: "http://localhost:9650/v1/bc/P",
|
||||
},
|
||||
{
|
||||
name: "empty endpoint uses default",
|
||||
@@ -52,7 +52,7 @@ func TestNew(t *testing.T) {
|
||||
|
||||
// TestConstants tests package constants
|
||||
func TestConstants(t *testing.T) {
|
||||
if DefaultRPCEndpoint != "http://localhost:9650/ext/bc/P" {
|
||||
if DefaultRPCEndpoint != "http://localhost:9650/v1/bc/P" {
|
||||
t.Errorf("unexpected DefaultRPCEndpoint: %s", DefaultRPCEndpoint)
|
||||
}
|
||||
if DefaultHTTPPort != 4100 {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import (
|
||||
|
||||
const (
|
||||
// DefaultRPCEndpoint is the default Q-Chain RPC endpoint
|
||||
DefaultRPCEndpoint = "http://localhost:9650/ext/bc/Q/rpc"
|
||||
DefaultRPCEndpoint = "http://localhost:9650/v1/bc/Q/rpc"
|
||||
// DefaultHTTPPort is the default API port for Q-Chain indexer
|
||||
DefaultHTTPPort = 4300
|
||||
)
|
||||
|
||||
@@ -59,7 +59,7 @@ func TestConstants(t *testing.T) {
|
||||
value interface{}
|
||||
want interface{}
|
||||
}{
|
||||
{"DefaultRPCEndpoint", DefaultRPCEndpoint, "http://localhost:9650/ext/bc/Q/rpc"},
|
||||
{"DefaultRPCEndpoint", DefaultRPCEndpoint, "http://localhost:9650/v1/bc/Q/rpc"},
|
||||
{"DefaultHTTPPort", DefaultHTTPPort, 4300},
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
|
||||
const (
|
||||
// DefaultRPCEndpoint for T-Chain on port 4700
|
||||
DefaultRPCEndpoint = "http://localhost:9650/ext/bc/T/rpc"
|
||||
DefaultRPCEndpoint = "http://localhost:9650/v1/bc/T/rpc"
|
||||
// DefaultHTTPPort for T-Chain indexer API
|
||||
DefaultHTTPPort = 4700
|
||||
)
|
||||
|
||||
@@ -59,7 +59,7 @@ func TestConstants(t *testing.T) {
|
||||
value interface{}
|
||||
want interface{}
|
||||
}{
|
||||
{"DefaultRPCEndpoint", DefaultRPCEndpoint, "http://localhost:9650/ext/bc/T/rpc"},
|
||||
{"DefaultRPCEndpoint", DefaultRPCEndpoint, "http://localhost:9650/v1/bc/T/rpc"},
|
||||
{"DefaultHTTPPort", DefaultHTTPPort, 4700},
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
// TestNew tests adapter creation
|
||||
func TestNew(t *testing.T) {
|
||||
endpoint := "http://localhost:9650/ext/bc/X"
|
||||
endpoint := "http://localhost:9650/v1/bc/X"
|
||||
adapter := New(endpoint)
|
||||
|
||||
if adapter == nil {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
const (
|
||||
// DefaultRPCEndpoint for Z-Chain
|
||||
DefaultRPCEndpoint = "http://localhost:9650/ext/bc/Z/rpc"
|
||||
DefaultRPCEndpoint = "http://localhost:9650/v1/bc/Z/rpc"
|
||||
// DefaultHTTPPort for Z-Chain indexer API
|
||||
DefaultHTTPPort = 4400
|
||||
// DefaultDatabase for Z-Chain explorer
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ func TestConstants(t *testing.T) {
|
||||
value interface{}
|
||||
want interface{}
|
||||
}{
|
||||
{"DefaultRPCEndpoint", DefaultRPCEndpoint, "http://localhost:9650/ext/bc/Z/rpc"},
|
||||
{"DefaultRPCEndpoint", DefaultRPCEndpoint, "http://localhost:9650/v1/bc/Z/rpc"},
|
||||
{"DefaultHTTPPort", DefaultHTTPPort, 4400},
|
||||
{"DefaultDatabase", DefaultDatabase, "explorer_zchain"},
|
||||
{"RPCMethod", RPCMethod, "zvm"},
|
||||
|
||||
Reference in New Issue
Block a user