rpc: /ext/ -> /v1/ in graphd + CLOB indexer endpoints

The CLOB read base is `<node>/v1/bc/D/dex/...`, not /ext/. luxd serves
one prefix (node server/http/server.go baseURL = "/v1").

Measured 2026-07-27 on both fleets, each with a bogus-path control:
  mainnet luxd-1:9630 /v1/bc/C/rpc 200 0x17871 | /ext/ 404 | control 404
  devnet  luxd-2:9650 /v1/bc/C/rpc 200 0x1786f | /ext/ 404 | control 404
Ports come from each net's LuxNetwork CR spec.ports.http — never assume.

go vet ./... clean; go test ./indexer/ -run CLOB -> 3/3 PASS.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-07-27 17:58:17 -07:00
co-authored by Hanzo Dev
parent 84a4bdf91e
commit 2c785b0eb0
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ The `dex` subgraph (markets/fills/orders/orderbook) can be fed from either or bo
trade engine IS the D-Chain (dexvm): a trade is a consensus state transition at
`Block.Verify`, NOT an EVM event, so it NEVER appears on the EVM RPC. `CLOBSource`
(`indexer/clob.go`) polls the committed-state read RPC
`…/ext/bc/<D>/dex/clob_get_{markets,trades,orders}` (GET/JSON, READ-ONLY, zero
`…/v1/bc/<D>/dex/clob_get_{markets,trades,orders}` (GET/JSON, READ-ONLY, zero
consensus impact — see `luxfi/dex pkg/dchain/read.go`) and writes the SAME
Market/Fill/Order entities the resolvers serve. Enabled by `Config.DexRPC` (graph)
/ `dex_rpc:` per-chain (explorer `chains.yaml`); empty = source 1 only.
+1 -1
View File
@@ -7,7 +7,7 @@
// Standalone:
//
// graphd --rpc=http://node:8545 # any EVM
// graphd --rpc=http://node:9650/ext/bc/{chainID}/rpc # any Lux chain
// graphd --rpc=http://node:9650/v1/bc/{chainID}/rpc # any Lux chain
// graphd --config=subgraphs.yaml # multi-subgraph
// graphd --rpc=http://node:8545 --schema=uniswap-v2 # specific schema
//
+3 -3
View File
@@ -4,7 +4,7 @@
// on an EVM chain (C-Chain). That is the cross-chain SETTLEMENT view. The native
// trading engine, however, IS the D-Chain (dexvm): a trade is a consensus state
// transition matched at Block.Verify, not an EVM event. Its committed state is
// served by the read RPC at /ext/bc/D/dex/dex_get_{markets,trades,orders,book}
// served by the read RPC at /v1/bc/D/dex/dex_get_{markets,trades,orders,book}
// (GET, self-describing JSON; see luxfi/dex pkg/dchain/read.go). Nothing on the
// EVM side carries those fills, so without this source the dex subgraph stays
// empty on a native-DEX deployment.
@@ -54,7 +54,7 @@ const clobTradePage = 1000
// trade cursor and writes Market/Fill/Order entities the dex resolvers read.
type CLOBSource struct {
// base is the D-Chain read-RPC root, e.g.
// http://node:9650/ext/bc/D/dex (dex_get_* are appended as /<method>).
// http://node:9650/v1/bc/D/dex (dex_get_* are appended as /<method>).
// Trailing "/" is trimmed on construction so joins are unambiguous.
base string
store *storage.Store
@@ -72,7 +72,7 @@ type CLOBSource struct {
}
// NewCLOBSource builds a CLOB source for a D-Chain read-RPC base URL and a store.
// base is the chain's /ext/bc/<D>/dex root (with or without a trailing slash).
// base is the chain's /v1/bc/<D>/dex root (with or without a trailing slash).
func NewCLOBSource(base string, store *storage.Store) *CLOBSource {
return &CLOBSource{
base: strings.TrimRight(base, "/"),
+1 -1
View File
@@ -208,7 +208,7 @@ func TestCLOB_IncrementalAndIdempotent(t *testing.T) {
// source present but driving only Market/Fill/Order. AMM and DEX never collide.
func TestCLOB_AdditiveToEVM(t *testing.T) {
s := newMemSQLiteStore(t)
idx := NewWithConfig(Config{RPC: "http://unused", DexRPC: "http://node/ext/bc/D/dex"}, s)
idx := NewWithConfig(Config{RPC: "http://unused", DexRPC: "http://node/v1/bc/D/dex"}, s)
if idx.clob == nil {
t.Fatal("DexRPC set must construct a CLOB source")
}
+1 -1
View File
@@ -54,7 +54,7 @@ type Config struct {
// indistinguishable from one that is wedged. Empty => unprefixed.
Label string
// DexRPC, when non-empty, is the native D-Chain (dexvm) CLOB read-RPC root —
// e.g. http://node:9650/ext/bc/D/dex. Setting it runs an ADDITIONAL, orthogonal
// e.g. http://node:9650/v1/bc/D/dex. Setting it runs an ADDITIONAL, orthogonal
// CLOBSource (clob.go) that polls dex_get_{markets,trades,orders} and writes
// the same Market/Fill/Order entities the EVM 0x9999 path writes. This is the
// native trading source: a D-Chain trade is a consensus state transition, not an