reach chains at /v1/chain; the node deleted /v1/bc

This commit is contained in:
2026-08-30 20:39:52 -07:00
parent c287fa46b3
commit 408138f895
5 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
// Standalone:
//
// graphd --rpc=http://node:8545 # any EVM
// graphd --rpc=http://node:9650/v1/bc/{chainID}/rpc # any Lux chain
// graphd --rpc=http://node:9650/v1/chain/{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 /v1/bc/D/dex/dex_get_{markets,trades,orders,book}
// served by the read RPC at /v1/chain/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/v1/bc/D/dex (dex_get_* are appended as /<method>).
// http://node:9650/v1/chain/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 /v1/bc/<D>/dex root (with or without a trailing slash).
// base is the chain's /v1/chain/<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/v1/bc/D/dex"}, s)
idx := NewWithConfig(Config{RPC: "http://unused", DexRPC: "http://node/v1/chain/D/dex"}, s)
if idx.clob == nil {
t.Fatal("DexRPC set must construct a CLOB source")
}
+1 -1
View File
@@ -62,7 +62,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/v1/bc/D/dex. Setting it runs an ADDITIONAL, orthogonal
// e.g. http://node:9650/v1/chain/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
+2 -2
View File
@@ -52,8 +52,8 @@ func TestNoStakeMeansAllCirculates(t *testing.T) {
// derived rather than configured — nothing to set, nothing to drift.
func TestPlatformEndpointDerivesFromEVM(t *testing.T) {
for _, c := range []struct{ in, want string }{
{"https://api.lux.network/v1/bc/C/rpc", "https://api.lux.network/v1/bc/P"},
{"http://luxd:9630/v1/bc/C/rpc", "http://luxd:9630/v1/bc/P"},
{"https://api.lux.network/v1/chain/C/rpc", "https://api.lux.network/v1/chain/P"},
{"http://luxd:9630/v1/chain/C/rpc", "http://luxd:9630/v1/chain/P"},
} {
got, ok := platformEndpoint(c.in)
if !ok || got != c.want {