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