mirror of
https://github.com/luxfi/indexer.git
synced 2026-09-24 00:25:37 +00:00
chain letters are lowercase
The primary-network chains answer to either case; one spelling beats two. /v1/chain/c/rpc, /v1/chain/p, /v1/chain/x across the estate. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -24,7 +24,7 @@ explorer
|
||||
go build -o explorer ./cmd/explorer/
|
||||
|
||||
# Run — indexes chain, serves API + frontend on :8090
|
||||
./explorer --rpc=http://localhost:9650/v1/chain/C/rpc
|
||||
./explorer --rpc=http://localhost:9650/v1/chain/c/rpc
|
||||
|
||||
# That's it. Open http://localhost:8090
|
||||
```
|
||||
@@ -34,7 +34,7 @@ go build -o explorer ./cmd/explorer/
|
||||
```bash
|
||||
docker build -f Dockerfile.explorer -t explorer .
|
||||
docker run -p 8090:8090 -v explorer-data:/data \
|
||||
-e RPC_ENDPOINT=http://node:9650/v1/chain/C/rpc \
|
||||
-e RPC_ENDPOINT=http://node:9650/v1/chain/c/rpc \
|
||||
explorer
|
||||
```
|
||||
|
||||
@@ -194,7 +194,7 @@ explorer --chain-name="My Chain" --coin=MYC --chain-id=12345
|
||||
|
||||
```bash
|
||||
# Required
|
||||
RPC_ENDPOINT=http://localhost:9650/v1/chain/C/rpc
|
||||
RPC_ENDPOINT=http://localhost:9650/v1/chain/c/rpc
|
||||
|
||||
# Optional
|
||||
DATA_DIR=~/.explorer/data
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ func TestConfigValidation(t *testing.T) {
|
||||
cfg := Config{
|
||||
ChainType: ChainP,
|
||||
ChainName: "P-Chain",
|
||||
RPCEndpoint: "http://localhost:9630/v1/chain/P",
|
||||
RPCEndpoint: "http://localhost:9630/v1/chain/p",
|
||||
RPCMethod: "pvm",
|
||||
DataDir: "/tmp/test-indexer/pchain",
|
||||
HTTPPort: 4100,
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ chains:
|
||||
name: C-Chain
|
||||
chain_id: 96369
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/C/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/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}/v1/chain/P
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/p
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
@@ -39,7 +39,7 @@ chains:
|
||||
- slug: xchain
|
||||
name: X-Chain
|
||||
type: dag
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/X
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/x
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// frontend.
|
||||
//
|
||||
// indexerd --config=chains.yaml
|
||||
// indexerd --rpc=http://localhost:9650/v1/chain/C/rpc (single chain mode)
|
||||
// indexerd --rpc=http://localhost:9650/v1/chain/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/v1/chain/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)")
|
||||
os.Exit(1)
|
||||
return daemon.Config{}
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ services:
|
||||
container_name: lux-pchain-indexer
|
||||
command: ["-chain", "pchain", "-port", "4000"]
|
||||
environment:
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/chain/P
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/chain/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/v1/chain/X
|
||||
RPC_ENDPOINT: http://host.docker.internal:9630/v1/chain/x
|
||||
DATABASE_URL: postgresql://explorer:explorer@postgres:5432/explorer_xchain?sslmode=disable
|
||||
HTTP_PORT: 4000
|
||||
ports:
|
||||
|
||||
+16
-16
@@ -12,8 +12,8 @@ lux:
|
||||
name: "Lux C-Chain"
|
||||
symbol: "LUX"
|
||||
type: evm
|
||||
rpc: "https://api.lux.network/v1/chain/C/rpc"
|
||||
ws: "wss://api.lux.network/v1/chain/C/ws"
|
||||
rpc: "https://api.lux.network/v1/chain/c/rpc"
|
||||
ws: "wss://api.lux.network/v1/chain/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/v1/chain/C/rpc"
|
||||
ws: "wss://api.testnet.lux.network/v1/chain/C/ws"
|
||||
rpc: "https://api.testnet.lux.network/v1/chain/c/rpc"
|
||||
ws: "wss://api.testnet.lux.network/v1/chain/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/v1/chain/C/rpc"
|
||||
ws: "wss://api.zoo.network/v1/chain/C/ws"
|
||||
rpc: "https://api.zoo.network/v1/chain/c/rpc"
|
||||
ws: "wss://api.zoo.network/v1/chain/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/v1/chain/C/rpc"
|
||||
rpc: "https://api.testnet.zoo.network/v1/chain/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/v1/chain/C/rpc"
|
||||
ws: "wss://api.hanzo.ai/v1/chain/C/ws"
|
||||
rpc: "https://api.hanzo.ai/v1/chain/c/rpc"
|
||||
ws: "wss://api.hanzo.ai/v1/chain/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/v1/chain/C/rpc"
|
||||
rpc: "https://api.testnet.hanzo.ai/v1/chain/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/v1/chain/C/rpc"
|
||||
ws: "wss://api.sparklepony.club/v1/chain/C/ws"
|
||||
rpc: "https://api.sparklepony.club/v1/chain/c/rpc"
|
||||
ws: "wss://api.sparklepony.club/v1/chain/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/v1/chain/C/rpc"
|
||||
rpc: "https://api.testnet.sparklepony.club/v1/chain/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/v1/chain/C/rpc"
|
||||
ws: "wss://api.pars.network/v1/chain/C/ws"
|
||||
rpc: "https://api.pars.network/v1/chain/c/rpc"
|
||||
ws: "wss://api.pars.network/v1/chain/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/v1/chain/C/rpc"
|
||||
rpc: "https://api.testnet.pars.network/v1/chain/c/rpc"
|
||||
explorer: "https://explore.testnet.pars.network"
|
||||
enabled: true
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ chains:
|
||||
name: "Lux C-Chain"
|
||||
chain_id: 96369
|
||||
port: 4000
|
||||
rpc: "${CCHAIN_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/chain/C/rpc}"
|
||||
rpc: "${CCHAIN_RPC:-http://luxd-headless.lux-mainnet.svc:9630/v1/chain/c/rpc}"
|
||||
enabled: true
|
||||
|
||||
- slug: zoo
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@ func TestConfigDefaults(t *testing.T) {
|
||||
cfg := Config{
|
||||
ChainType: ChainX,
|
||||
ChainName: "X-Chain",
|
||||
RPCEndpoint: "http://localhost:9630/v1/chain/X",
|
||||
RPCEndpoint: "http://localhost:9630/v1/chain/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/v1/chain/C/rpc
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/c/rpc
|
||||
coin: LUX
|
||||
enabled: true
|
||||
default: true
|
||||
@@ -162,12 +162,12 @@ data:
|
||||
- slug: xchain
|
||||
name: X-Chain
|
||||
type: dag
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/X
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/x
|
||||
coin: LUX
|
||||
enabled: true
|
||||
- slug: pchain
|
||||
name: P-Chain
|
||||
type: linear
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/P
|
||||
rpc: http://luxd-0.luxd-headless.lux-mainnet.svc:9630/v1/chain/p
|
||||
coin: LUX
|
||||
enabled: true
|
||||
|
||||
+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/v1/chain/C/rpc"
|
||||
rpcURL = "http://127.0.0.1:9650/v1/chain/c/rpc"
|
||||
}
|
||||
|
||||
return &TestConfig{
|
||||
|
||||
+7
-7
@@ -216,16 +216,16 @@ 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/v1/chain/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/")
|
||||
host := parts[0]
|
||||
switch strings.ToUpper(chain) {
|
||||
case "C":
|
||||
return host + "/v1/chain/C/rpc"
|
||||
return host + "/v1/chain/c/rpc"
|
||||
case "P":
|
||||
return host + "/v1/chain/P"
|
||||
return host + "/v1/chain/p"
|
||||
case "X":
|
||||
return host + "/v1/chain/X"
|
||||
return host + "/v1/chain/x"
|
||||
default:
|
||||
return host + "/v1/chain/" + chain + "/rpc"
|
||||
}
|
||||
@@ -238,11 +238,11 @@ func GetRPCEndpoint(chain string) string {
|
||||
|
||||
switch strings.ToUpper(chain) {
|
||||
case "C":
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/C/rpc", port)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/c/rpc", port)
|
||||
case "P":
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/P", port)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/p", port)
|
||||
case "X":
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/X", port)
|
||||
return fmt.Sprintf("http://127.0.0.1:%d/v1/chain/x", port)
|
||||
default:
|
||||
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
|
||||
func TestNew(t *testing.T) {
|
||||
endpoint := "http://localhost:9650/v1/chain/C/rpc"
|
||||
endpoint := "http://localhost:9650/v1/chain/c/rpc"
|
||||
adapter := New(endpoint)
|
||||
|
||||
if adapter == nil {
|
||||
|
||||
+4
-4
@@ -19,8 +19,8 @@ var DefaultChains = []ChainConfig{
|
||||
ChainID: ChainIDLuxMainnet,
|
||||
Name: "Lux C-Chain",
|
||||
Symbol: "LUX",
|
||||
RPCEndpoint: "https://api.lux.network/v1/chain/C/rpc",
|
||||
WSEndpoint: "wss://api.lux.network/v1/chain/C/ws",
|
||||
RPCEndpoint: "https://api.lux.network/v1/chain/c/rpc",
|
||||
WSEndpoint: "wss://api.lux.network/v1/chain/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/v1/chain/C/rpc",
|
||||
WSEndpoint: "wss://api.testnet.lux.network/v1/chain/C/ws",
|
||||
RPCEndpoint: "https://api.testnet.lux.network/v1/chain/c/rpc",
|
||||
WSEndpoint: "wss://api.testnet.lux.network/v1/chain/c/ws",
|
||||
ExplorerURL: "https://explorer.testnet.lux.network",
|
||||
IsTestnet: true,
|
||||
BlockTime: 2000,
|
||||
|
||||
@@ -49,7 +49,7 @@ func isLuxdEndpoint(endpoint string) bool {
|
||||
|
||||
// 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/v1/chain/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 {
|
||||
// Strip scheme
|
||||
addr := endpoint
|
||||
|
||||
@@ -189,9 +189,9 @@ func TestIsLuxdEndpoint(t *testing.T) {
|
||||
endpoint string
|
||||
want bool
|
||||
}{
|
||||
{"http://luxd-0.luxd:9630/v1/chain/C/rpc", true},
|
||||
{"http://localhost:9650/v1/chain/C/rpc", true},
|
||||
{"https://api.lux.network/mainnet/v1/chain/C/rpc", true},
|
||||
{"http://luxd-0.luxd:9630/v1/chain/c/rpc", true},
|
||||
{"http://localhost:9650/v1/chain/c/rpc", true},
|
||||
{"https://api.lux.network/mainnet/v1/chain/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/v1/chain/C/rpc", "luxd-0.luxd:9640"},
|
||||
{"http://localhost:9650/v1/chain/C/rpc", "localhost:9660"},
|
||||
{"https://api.lux.network/mainnet/v1/chain/C/rpc", "api.lux.network:9640"},
|
||||
{"http://10.0.0.1:19630/v1/chain/C/rpc", "10.0.0.1:19640"},
|
||||
{"http://luxd-0.luxd:9630/v1/chain/c/rpc", "luxd-0.luxd:9640"},
|
||||
{"http://localhost:9650/v1/chain/c/rpc", "localhost:9660"},
|
||||
{"https://api.lux.network/mainnet/v1/chain/c/rpc", "api.lux.network:9640"},
|
||||
{"http://10.0.0.1:19630/v1/chain/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/v1/chain/C/rpc")
|
||||
tr = New("http://localhost:1/v1/chain/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/v1/chain/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/chain/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/v1/chain/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/chain/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/v1/chain/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/chain/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/v1/chain/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/chain/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/v1/chain/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/chain/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/v1/chain/C/rpc")
|
||||
_, err := NewZAP("127.0.0.1:1", "http://localhost/v1/chain/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/v1/chain/C/rpc")
|
||||
z, err := NewZAP(addr, "http://localhost/v1/chain/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/v1/chain/C/rpc",
|
||||
WSEndpoint: "wss://api.lux.network/v1/chain/C/ws",
|
||||
RPCEndpoint: "https://api.lux.network/v1/chain/c/rpc",
|
||||
WSEndpoint: "wss://api.lux.network/v1/chain/c/ws",
|
||||
ExplorerURL: "https://explorer.lux.network",
|
||||
IsTestnet: false,
|
||||
BlockTime: 2000,
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultRPCEndpoint = "http://localhost:9650/v1/chain/P"
|
||||
DefaultRPCEndpoint = "http://localhost:9650/v1/chain/p"
|
||||
DefaultHTTPPort = 4100
|
||||
)
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ func TestNew(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "custom endpoint",
|
||||
endpoint: "http://localhost:9650/v1/chain/P",
|
||||
expected: "http://localhost:9650/v1/chain/P",
|
||||
endpoint: "http://localhost:9650/v1/chain/p",
|
||||
expected: "http://localhost:9650/v1/chain/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/v1/chain/P" {
|
||||
if DefaultRPCEndpoint != "http://localhost:9650/v1/chain/p" {
|
||||
t.Errorf("unexpected DefaultRPCEndpoint: %s", DefaultRPCEndpoint)
|
||||
}
|
||||
if DefaultHTTPPort != 4100 {
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
// TestNew tests adapter creation
|
||||
func TestNew(t *testing.T) {
|
||||
endpoint := "http://localhost:9650/v1/chain/X"
|
||||
endpoint := "http://localhost:9650/v1/chain/x"
|
||||
adapter := New(endpoint)
|
||||
|
||||
if adapter == nil {
|
||||
|
||||
Reference in New Issue
Block a user