mirror of
https://github.com/luxfi/indexer.git
synced 2026-09-24 00:25:37 +00:00
feat(indexer): update RPC endpoints to /v1/chain
This commit is contained in:
@@ -27,7 +27,7 @@ vet:
|
||||
go vet ./...
|
||||
|
||||
dev:
|
||||
go run ./cmd/indexerd --rpc=http://localhost:9630/v1/chain/C/rpc --chain-name="C-Chain" --coin=LUX --chain-id=96369
|
||||
go run ./cmd/indexerd --rpc=http://localhost:9630/v1/chain/c --chain-name="C-Chain" --coin=LUX --chain-id=96369
|
||||
|
||||
dev-config:
|
||||
go run ./cmd/indexerd --config=chains.example.yaml
|
||||
|
||||
+6
-5
@@ -99,7 +99,7 @@ chains:
|
||||
name: Zoo
|
||||
chain_id: 200200
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/Zoo/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/zoo
|
||||
coin: ZOO
|
||||
enabled: true
|
||||
graph:
|
||||
@@ -110,7 +110,7 @@ chains:
|
||||
name: Hanzo AI
|
||||
chain_id: 36963
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/Hanzo/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/hanzo
|
||||
coin: HANZO
|
||||
enabled: true
|
||||
|
||||
@@ -118,7 +118,7 @@ chains:
|
||||
name: SPC
|
||||
chain_id: 36911
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/SPC/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/spc
|
||||
coin: SPC
|
||||
enabled: true
|
||||
|
||||
@@ -126,7 +126,7 @@ chains:
|
||||
name: Pars
|
||||
chain_id: 494949
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/Pars/rpc
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/pars
|
||||
coin: PARS
|
||||
enabled: true
|
||||
|
||||
@@ -136,6 +136,7 @@ chains:
|
||||
chain_id: 0
|
||||
type: evm
|
||||
rpc: ${LUX_RPC:-http://localhost:9650}/v1/chain/D/rpc
|
||||
|
||||
coin: LUX
|
||||
enabled: true
|
||||
graph:
|
||||
@@ -202,7 +203,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/chain/c}
|
||||
coin: AVAX
|
||||
enabled: true
|
||||
|
||||
|
||||
+1
-1
@@ -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/chain/c}"
|
||||
explorer: "https://snowtrace.io"
|
||||
enabled: true
|
||||
protocols:
|
||||
|
||||
@@ -13,9 +13,9 @@ The Lux Indexer can be configured through environment variables, configuration f
|
||||
|
||||
```bash
|
||||
# RPC endpoints for each chain
|
||||
LUX_C_RPC=http://127.0.0.1:9630/v1/chain/C/rpc
|
||||
LUX_P_RPC=http://127.0.0.1:9630/v1/chain/P
|
||||
LUX_X_RPC=http://127.0.0.1:9630/v1/chain/X
|
||||
LUX_C_RPC=http://127.0.0.1:9630/v1/chain/c
|
||||
LUX_P_RPC=http://127.0.0.1:9630/v1/chain/p
|
||||
LUX_X_RPC=http://127.0.0.1:9630/v1/chain/x
|
||||
|
||||
# Database configuration
|
||||
LUX_DB_BACKEND=sqlite # sqlite, postgres, or memory
|
||||
@@ -45,9 +45,9 @@ Create a `config.yaml` file:
|
||||
|
||||
```yaml
|
||||
rpc:
|
||||
c_chain: http://127.0.0.1:9630/v1/chain/C/rpc
|
||||
p_chain: http://127.0.0.1:9630/v1/chain/P
|
||||
x_chain: http://127.0.0.1:9630/v1/chain/X
|
||||
c_chain: http://127.0.0.1:9630/v1/chain/c
|
||||
p_chain: http://127.0.0.1:9630/v1/chain/p
|
||||
x_chain: http://127.0.0.1:9630/v1/chain/x
|
||||
|
||||
storage:
|
||||
backend: sqlite
|
||||
@@ -131,7 +131,7 @@ LUX_NETWORK=testnet
|
||||
|
||||
```bash
|
||||
LUX_NETWORK=local
|
||||
LUX_C_RPC=http://127.0.0.1:9650/v1/chain/C/rpc
|
||||
LUX_C_RPC=http://127.0.0.1:9650/v1/chain/c
|
||||
```
|
||||
|
||||
## Performance Tuning
|
||||
|
||||
@@ -22,10 +22,10 @@ A Go-based unified indexer for all Lux Network chains. Clean-room implementation
|
||||
go install github.com/luxfi/indexer/cmd/indexer@latest
|
||||
|
||||
# Run against local node
|
||||
indexer -chain evm -rpc http://localhost:9650/v1/chain/C/rpc
|
||||
indexer -chain evm -rpc http://localhost:9650/v1/chain/c
|
||||
|
||||
# Run against mainnet
|
||||
indexer -chain evm -rpc https://api.lux.network/v1/chain/C/rpc
|
||||
indexer -chain evm -rpc https://api.lux.network/v1/chain/c
|
||||
```
|
||||
|
||||
## Chain Support
|
||||
|
||||
@@ -58,6 +58,7 @@ type Config struct {
|
||||
// Set via GCHAIN_ENDPOINT env var.
|
||||
GChainEndpoint string
|
||||
|
||||
|
||||
// ChainDBPaths maps chain names to their SQLite DB paths for cross-chain search.
|
||||
// Example: {"C": "/data/cchain/indexer.db", "Zoo": "/data/zoo/indexer.db"}
|
||||
// When empty, cross-chain search only queries the local IndexerDBPath.
|
||||
|
||||
@@ -17,6 +17,7 @@ const (
|
||||
graphqlProxyTimeout = 30 * time.Second
|
||||
)
|
||||
|
||||
|
||||
// graphqlProxy is a reverse proxy to the G-Chain GraphQL endpoint on the node.
|
||||
type graphqlProxy struct {
|
||||
target *url.URL
|
||||
|
||||
@@ -28,9 +28,10 @@ CREATE TABLE chains (
|
||||
INSERT INTO chains (chain_id, name, symbol, rpc_url) VALUES
|
||||
(96369, 'Lux C-Chain', 'LUX', 'http://localhost:9630/v1/chain/C/rpc'),
|
||||
(96368, 'Lux Testnet', 'LUX', 'http://localhost:9640/v1/chain/C/rpc'),
|
||||
(200200, 'Zoo Mainnet', 'ZOO', 'http://localhost:9630/v1/chain/Zoo/rpc'),
|
||||
(200201, 'Zoo Testnet', 'ZOO', 'http://localhost:9640/v1/chain/Zoo/rpc'),
|
||||
(36963, 'Hanzo AI', 'HANZO', 'http://localhost:9630/v1/chain/Hanzo/rpc');
|
||||
(200200, 'Zoo Mainnet', 'ZOO', 'http://localhost:9630/v1/chain/zoo'),
|
||||
(200201, 'Zoo Testnet', 'ZOO', 'http://localhost:9640/v1/chain/zoo'),
|
||||
(36963, 'Hanzo AI', 'HANZO', 'http://localhost:9630/v1/chain/hanzo');
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Blocks (Partitioned by chain_id)
|
||||
|
||||
Reference in New Issue
Block a user