From 51a304804c51f522c245551aff3ee5b7fb96b62b Mon Sep 17 00:00:00 2001 From: zeekay Date: Wed, 1 Jul 2026 11:40:13 -0700 Subject: [PATCH] chore: migrate luxd HTTP routes /ext -> /v1 Drop the Avalanche-heritage /ext prefix; /v1 is the single canonical route surface (one way, no backward compat). The node's baseURL is the source of truth; clients, SDKs, CLI, indexer, maker, genesis, netrunner, and the k8s/compose/gateway/explorer configs are updated to match. Co-authored-by: Hanzo Dev --- Dockerfile | 4 +- LAUNCH_CHECKLIST.md | 2 +- LLM.md | 14 ++-- Makefile | 2 +- RELEASES.md | 2 +- chains/bootstrap_sync.go | 6 +- chains/bootstrap_sync_test.go | 2 +- chains/manager.go | 16 ++-- chains/rpc/debug_tool.go | 14 ++-- chains/rpc/integration_example.go | 4 +- compose.yml | 2 +- docker/DOCKER.md | 10 +-- docker/docker-entrypoint.sh | 8 +- docs/app/page.tsx | 2 +- docs/content/docs/api/admin.mdx | 40 +++++----- docs/content/docs/api/health.mdx | 24 +++--- docs/content/docs/api/info.mdx | 46 +++++------ docs/content/docs/api/platform.mdx | 46 +++++------ .../docs/getting-started/installation.mdx | 6 +- docs/content/docs/getting-started/running.mdx | 6 +- .../docs/getting-started/validator.mdx | 34 ++++---- docs/content/docs/index.mdx | 14 ++-- docs/content/docs/networking/p2p-protocol.mdx | 4 +- docs/content/docs/operations/monitoring.mdx | 18 ++--- .../docs/operations/troubleshooting.mdx | 18 ++--- import-chain-rlp.sh | 2 +- indexer/client.go | 4 +- indexer/examples/p-chain/main.go | 2 +- indexer/examples/x-chain-blocks/main.go | 2 +- indexer/service.md | 26 +++---- k8s/base/statefulset.yaml | 6 +- node/node.go | 10 +-- scripts/dev-instance.sh | 10 +-- scripts/run_prometheus.sh | 2 +- server/http/router.go | 22 +++--- server/http/server.go | 9 ++- server/http/zap_listener.go | 2 +- server/http/zap_listener_test.go | 4 +- service/auth/auth_test.go | 24 +++--- service/auth/service.go | 2 +- service/health/service.md | 18 ++--- service/info/service.md | 30 +++---- service/info/service_test.go | 8 +- service/keystore/client.go | 2 +- service/keystore/service.md | 12 +-- service/metrics/client.go | 2 +- service/metrics/service.md | 4 +- service/security/service.go | 18 ++--- service/security/service_test.go | 4 +- service/security/types.go | 10 +-- tests/http.go | 2 +- vms/example/xsvm/README.md | 2 +- .../GetAllValidatorsAt_API_Example.md | 6 +- vms/platformvm/api/static_client.go | 2 +- vms/platformvm/client.go | 4 +- vms/platformvm/service.md | 72 ++++++++--------- vms/platformvm/txs/bench/README.md | 2 +- vms/proposervm/API_EXAMPLE.md | 4 +- vms/proposervm/service.go | 2 +- vms/proposervm/service.md | 6 +- vms/xvm/service.md | 78 +++++++++---------- vms/xvm/static_client.go | 2 +- wallet/network/primary/api.go | 2 +- .../primary/examples/heartbeat-tx/main.go | 4 +- 64 files changed, 386 insertions(+), 381 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6cd48d0ae..cad0df899 100644 --- a/Dockerfile +++ b/Dockerfile @@ -367,7 +367,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ # accelerator in pkg/lx is a separate concern gated by its own cuda/metal tags and # is NOT linked here. v1.5.10 is the first tag whose cmd/dchain builds CGO=0 # (drops the phantom dchain+cgo gate); v1.5.11 wires CLOB order ingestion over the -# node HTTP router (VM.CreateHandlers -> /ext/bc/D/dex/, pkg/dchain/ingest.go) +# node HTTP router (VM.CreateHandlers -> /v1/bc/D/dex/, pkg/dchain/ingest.go) # so an order POSTed to the node flows submitTx -> mempool -> consensus -> Verify # (match) -> Accept; v1.5.12 persists the head block so the VM survives a restart # once advanced past genesis (GetBlock(lastAccepted) no longer ErrNotFound); @@ -379,7 +379,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ # DB (every plugin VM via vm/rpc) — that stranded the native D-Chain order book # (rebuildBookFromDB folded empty -> 0 fills despite committed asks). v1.5.15 adds # the committed-state READ surface (clob_get_trades/orders/markets/book over -# /ext/bc/D/dex/, pkg/dchain/read.go): read-only JSON of the durable trade +# /v1/bc/D/dex/, pkg/dchain/read.go): read-only JSON of the durable trade # log / resting book / markets, served beside the writes with ZERO consensus # impact. Needed to VERIFY a fill replicated identically across validators (query # every node, diff the trade rows + head root) and to feed markets-display (native diff --git a/LAUNCH_CHECKLIST.md b/LAUNCH_CHECKLIST.md index c4ed43a04..cb9b52833 100644 --- a/LAUNCH_CHECKLIST.md +++ b/LAUNCH_CHECKLIST.md @@ -52,7 +52,7 @@ Target: validate all consensus, EVM, and staking behavior with K=11 validators. - [ ] Verify all precompile activation timestamps are after 2025-12-25 - [ ] Deploy via PaaS (platform.hanzo.ai), not manual kubectl - [ ] Verify all 11 pods reach Running state -- [ ] Verify all 11 nodes report healthy via `/ext/health/liveness` +- [ ] Verify all 11 nodes report healthy via `/v1/health/liveness` ### 1.2 Bootstrap and Connectivity diff --git a/LLM.md b/LLM.md index acf8d5038..378a91e5c 100644 --- a/LLM.md +++ b/LLM.md @@ -65,10 +65,10 @@ selection, and EVM contract auth. ### Where to look for X - Profile resolve at boot: `node/node.go:initSecurityProfile` - Profile RPC + REST + metrics: `service/security/` - - JSON-RPC namespace: `security` at `POST /ext/security` + - JSON-RPC namespace: `security` at `POST /v1/security` (methods `securityProfile`, `blockSecurity`) - - REST sidecars: `GET /ext/security/profile`, `GET /ext/security/block/{n}` - - Prometheus gauges: `/ext/metrics` under the `security_*` family + - REST sidecars: `GET /v1/security/profile`, `GET /v1/security/block/{n}` + - Prometheus gauges: `/v1/metrics` under the `security_*` family - Peer scheme gate: `network/peer/scheme_gate.go` - Classical-compat registry: `vms/txs/auth/policy.go` - Mempool gate (P-Chain): `vms/platformvm/mempool/*.go` @@ -659,7 +659,7 @@ When CGO disabled, these use CPU fallbacks: ```bash curl -s -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \ - http://localhost:9640/ext/bc/C/rpc + http://localhost:9640/v1/bc/C/rpc # Returns: {"jsonrpc":"2.0","id":1,"result":"0x17870"} ``` @@ -668,7 +668,7 @@ curl -s -X POST -H "Content-Type: application/json" \ **Behavior**: - **GET /**: Returns JSON node information (nodeId, networkId, version, chains, endpoints) -- **POST /**: Proxies JSON-RPC requests directly to C-chain `/ext/bc/C/rpc` +- **POST /**: Proxies JSON-RPC requests directly to C-chain `/v1/bc/C/rpc` - **OPTIONS /**: Returns CORS preflight headers **Files Modified**: `server/http/router.go`, `server/http/server.go` @@ -735,7 +735,7 @@ if s.validators.NumNets() != 0 { **Verification**: ```bash -curl -s http://localhost:9650/ext/health | jq '.checks.bls' +curl -s http://localhost:9650/v1/health | jq '.checks.bls' # Should show: "message": "node has the correct BLS key" ``` @@ -769,7 +769,7 @@ Testing conducted on a single Lux validator node (testnet mode, macOS): **Benchmark Command:** ```bash cd ~/work/lux/benchmarks -NODE_ENDPOINT="http://localhost:9640/ext/bc/C/rpc" \ +NODE_ENDPOINT="http://localhost:9640/v1/bc/C/rpc" \ PRIVATE_KEY="" \ ./bin/bench tps --chains=lux --duration=60s --concurrency=5 ``` diff --git a/Makefile b/Makefile index fdd1e0a36..ded7c9413 100644 --- a/Makefile +++ b/Makefile @@ -212,7 +212,7 @@ run-testnet: build-fips init-chains node-status: @echo "$(GREEN)Checking node status...$(NC)" @curl -s -X POST --data '{"jsonrpc":"2.0","id":1,"method":"info.isBootstrapped","params":{}}' \ - -H 'content-type:application/json;' http://localhost:9630/ext/info | jq + -H 'content-type:application/json;' http://localhost:9630/v1/info | jq stop-node: @echo "$(YELLOW)Stopping Lux node...$(NC)" diff --git a/RELEASES.md b/RELEASES.md index e091b5598..a1c39e5cb 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3066,7 +3066,7 @@ This version is backwards compatible to [v1.9.0](https://github.com/luxfi/node/r - Fixed `x/merkledb.ChangeProof#getLargestKey` to correctly handle no changes - Added test for `xvm/txs/executor.SemanticVerifier#verifyFxUsage` with multiple valid fxs - Fixed CPU + bandwidth performance regression during vertex processing -- Added example usage of the `/ext/index/X/block` API +- Added example usage of the `/v1/index/X/block` API - Reduced the default value of `--consensus-optimal-processing` from `50` to `10` - Updated the year in the license header diff --git a/chains/bootstrap_sync.go b/chains/bootstrap_sync.go index b0c35865f..05aa46d49 100644 --- a/chains/bootstrap_sync.go +++ b/chains/bootstrap_sync.go @@ -816,7 +816,7 @@ func (b *blockHandler) BootstrapFailure() error { // is correctly failing safe DOWN (VM in Bootstrapping, serving nothing as head) and waiting for the // quorum to return; the network cannot make progress without it. monitorBootstrap's no-progress // watchdog polls this so it does NOT force-STOP a node that is deliberately waiting — which, given -// the K8s probes only poll the always-green /ext/health/liveness, would be a permanent brick. It is +// the K8s probes only poll the always-green /v1/health/liveness, would be a permanent brick. It is // the discriminator between "stuck on a served gap" (a real stall → stop) and "waiting for the // quorum" (self-heal → keep waiting). Distinct from BootstrapFailed (a terminal/structural fail). func (b *blockHandler) BootstrapConnecting() bool { return b.bootstrapConnecting.Load() } @@ -921,7 +921,7 @@ func (b *blockHandler) runBootstrapThenPoll(ctx context.Context) { // no-progress watchdog treats it as a deliberate WAIT, not a stall: the node stays in Bootstrapping // (serving nothing as head, NEVER live at the stale height) and CONVERGES the instant the quorum // returns — the in-process self-heal the K8s probes do NOT provide (they poll the always-green -// /ext/health/liveness, so a fail-safe-DOWN node is never restarted). A STRUCTURAL failure (deep gap +// /v1/health/liveness, so a fail-safe-DOWN node is never restarted). A STRUCTURAL failure (deep gap // → state-sync) or an exhausted attempt bound returns false WITHOUT going Ready, bootstrapFailed // recording the reason so monitorBootstrap surfaces it. The node NEVER false-completes at its stale // height, and a transient outage NEVER becomes a permanent brick. @@ -963,7 +963,7 @@ func (b *blockHandler) runInitialSync(ctx context.Context) bool { // (eclipse / partition / a majority co-restart still in flight) is RE-ATTEMPTED — the node stays // in Bootstrapping (engine alive, VM serving nothing as head, never live at the stale height) // and CONVERGES the instant the quorum returns. This is the recovery the K8s probes do NOT - // provide (they all poll the always-green /ext/health/liveness, so a fail-safe-DOWN node is + // provide (they all poll the always-green /v1/health/liveness, so a fail-safe-DOWN node is // never restarted). bootstrapMaxAttempts ≤ 0 ⇒ retry until the quorum returns or shutdown; a // test pins it to 1 to assert the single-attempt terminal fail-safe. A STRUCTURAL failure (deep // gap → state-sync) is NOT retried — a retry cannot fix it; it is surfaced for the operator. diff --git a/chains/bootstrap_sync_test.go b/chains/bootstrap_sync_test.go index 59546876e..41b7b666c 100644 --- a/chains/bootstrap_sync_test.go +++ b/chains/bootstrap_sync_test.go @@ -1528,7 +1528,7 @@ func TestRED_TipHolderCoRestartGoesReadyAtOwnTip(t *testing.T) { // It must NOT go live at its stale height (safety) and must NOT permanently give up (liveness): it // stays in Bootstrapping, RE-ATTEMPTS (bootstrapMaxAttempts ≤ 0 ⇒ until the quorum returns), and // CONVERGES the instant the quorum comes back — all IN-PROCESS, with no pod restart (the K8s probes -// poll the always-green /ext/health/liveness and would never restart it). This is the bounded +// poll the always-green /v1/health/liveness and would never restart it). This is the bounded // re-bootstrap retry that closes the "permanent brick" RED flagged. func TestRED_MajorityOutageSelfHealsWhenQuorumReturns(t *testing.T) { const N, K = 30, 16 // stale at N; the live frontier (once the quorum returns) is N+K diff --git a/chains/manager.go b/chains/manager.go index fd3dd5c8e..6b0f54ccf 100644 --- a/chains/manager.go +++ b/chains/manager.go @@ -219,7 +219,7 @@ type ChainParameters struct { FxIDs []ids.ID // Invariant: Only used when [ID] is the P-chain ID. CustomBeacons validators.Manager - // Name of the chain (used for HTTP routing alias, e.g., /ext/bc/zoo/rpc) + // Name of the chain (used for HTTP routing alias, e.g., /v1/bc/zoo/rpc) Name string } @@ -743,7 +743,7 @@ func (m *manager) createChain(chainParams ChainParameters) { // plugin shows up later (e.g. via lpm install). // // The old behavior (always register a failing health check) made - // /ext/health return 503 for any opted-out chain, which made + // /v1/health return 503 for any opted-out chain, which made // kubelet liveness probes kill the validator pod. That made // chain participation effectively all-or-nothing per validator. // Now: validators participate per-plugin, opt-in. @@ -855,7 +855,7 @@ func (m *manager) createChain(chainParams ChainParameters) { m.Server.AddRoute(handler, chainIDBase, endpoint) } - // Also register with chain name alias for user-friendly routing (e.g., /ext/bc/zoo/rpc) + // Also register with chain name alias for user-friendly routing (e.g., /v1/bc/zoo/rpc) if chainParams.Name != "" { nameLower := strings.ToLower(chainParams.Name) nameBase := fmt.Sprintf("bc/%s", nameLower) @@ -928,9 +928,9 @@ func (m *manager) createChain(chainParams ChainParameters) { m.Log.Info("║ VM ID:", log.Stringer("vmID", chainParams.VMID)) m.Log.Info("║ Network ID:", log.Stringer("chainID", chainParams.ChainID)) m.Log.Info("║ Endpoints available at:") - m.Log.Info("║ → /ext/bc/" + chainParams.ID.String()) + m.Log.Info("║ → /v1/bc/" + chainParams.ID.String()) if chainAlias != chainParams.ID.String() { - m.Log.Info("║ → /ext/bc/" + chainAlias) + m.Log.Info("║ → /v1/bc/" + chainAlias) } m.Log.Info("╚══════════════════════════════════════════════════════════════════╝") @@ -2080,7 +2080,7 @@ func (m *manager) monitorBootstrap(engine Engine, h handler.Handler, sb nets.Net // this true. The no-progress watchdog treats it as a deliberate quorum WAIT, not a stall: it must // NOT force-STOP a node that is correctly failing safe DOWN and waiting for its quorum to return // (the network cannot progress without the quorum, and the K8s probes — all polling the - // always-green /ext/health/liveness — would never restart it, so a stop here is a permanent + // always-green /v1/health/liveness — would never restart it, so a stop here is a permanent // brick). The node stays in Bootstrapping (serving nothing as head) and converges when the quorum // returns. nil for degenerate handlers (legacy behavior). type bootstrapConnector interface{ BootstrapConnecting() bool } @@ -2723,7 +2723,7 @@ type blockHandler struct { // tells monitorBootstrap's no-progress watchdog this is a deliberate WAIT for the quorum to // return (the network cannot make progress without it), NOT a stall — so the watchdog does not // force-STOP a node that is correctly failing safe and waiting, which (given the K8s probes only - // poll the always-green /ext/health/liveness) would otherwise be a permanent brick. + // poll the always-green /v1/health/liveness) would otherwise be a permanent brick. bootstrapConnecting gatomic.Bool bsActive gatomic.Bool // true while the bootstrap loop is driving bsMu sync.Mutex // guards bsFrontierCh + bsAncestorCh @@ -2826,7 +2826,7 @@ type blockHandler struct { // DOWN — never live at a stale height) and CONVERGES the instant the quorum returns. ≤0 ⇒ // UNLIMITED (retry until the quorum returns or shutdown) — the production default, because a // node without a quorum must keep trying to rejoin and the K8s liveness probe does NOT restart - // it (all luxd probes poll the always-green /ext/health/liveness). A STRUCTURAL failure (deep + // it (all luxd probes poll the always-green /v1/health/liveness). A STRUCTURAL failure (deep // gap → state-sync) is never retried regardless. Tests pin it to 1 to assert the single-attempt // terminal fail-safe in isolation. bootstrapMaxAttempts int diff --git a/chains/rpc/debug_tool.go b/chains/rpc/debug_tool.go index 79c524270..b9df92d15 100644 --- a/chains/rpc/debug_tool.go +++ b/chains/rpc/debug_tool.go @@ -68,20 +68,20 @@ func (d *DebugTool) DiagnoseEndpoint(chainID ids.ID, alias string) *DiagnosticRe // getURLPatterns returns all possible URL patterns to test. func (d *DebugTool) getURLPatterns(chainID ids.ID, alias string) []string { patterns := []string{ - fmt.Sprintf("%s/ext/bc/%s/rpc", d.baseURL, chainID.String()), - fmt.Sprintf("%s/ext/bc/%s/ws", d.baseURL, chainID.String()), - fmt.Sprintf("%s/ext/bc/%s", d.baseURL, chainID.String()), + fmt.Sprintf("%s/v1/bc/%s/rpc", d.baseURL, chainID.String()), + fmt.Sprintf("%s/v1/bc/%s/ws", d.baseURL, chainID.String()), + fmt.Sprintf("%s/v1/bc/%s", d.baseURL, chainID.String()), } if alias != "" && alias != chainID.String() { patterns = append(patterns, - fmt.Sprintf("%s/ext/bc/%s/rpc", d.baseURL, alias), - fmt.Sprintf("%s/ext/bc/%s/ws", d.baseURL, alias), - fmt.Sprintf("%s/ext/bc/%s", d.baseURL, alias), + fmt.Sprintf("%s/v1/bc/%s/rpc", d.baseURL, alias), + fmt.Sprintf("%s/v1/bc/%s/ws", d.baseURL, alias), + fmt.Sprintf("%s/v1/bc/%s", d.baseURL, alias), ) } - // Also test without /ext prefix (some setups might differ) + // Also test without /v1 prefix (some setups might differ) patterns = append(patterns, fmt.Sprintf("%s/bc/%s/rpc", d.baseURL, chainID.String()), ) diff --git a/chains/rpc/integration_example.go b/chains/rpc/integration_example.go index 863149876..4dc4719c2 100644 --- a/chains/rpc/integration_example.go +++ b/chains/rpc/integration_example.go @@ -80,9 +80,9 @@ func IntegrationExample( fmt.Printf("\n✅ Chain %s RPC endpoints ready:\n", chainID) for _, endpoint := range info.Endpoints { if info.ChainAlias != "" { - fmt.Printf(" %s/ext/bc/%s%s\n", baseURL, info.ChainAlias, endpoint) + fmt.Printf(" %s/v1/bc/%s%s\n", baseURL, info.ChainAlias, endpoint) } - fmt.Printf(" %s/ext/bc/%s%s\n", baseURL, chainID, endpoint) + fmt.Printf(" %s/v1/bc/%s%s\n", baseURL, chainID, endpoint) } fmt.Println() } diff --git a/compose.yml b/compose.yml index 26ea11618..3502db71d 100644 --- a/compose.yml +++ b/compose.yml @@ -19,7 +19,7 @@ services: LUXD_CONSENSUS_QUORUM_SIZE: "1" LUXD_LOG_LEVEL: "info" healthcheck: - test: ["CMD", "curl", "-sf", "http://localhost:9630/ext/health"] + test: ["CMD", "curl", "-sf", "http://localhost:9630/v1/health"] interval: 30s timeout: 10s retries: 5 diff --git a/docker/DOCKER.md b/docker/DOCKER.md index c6daa308e..a6d059fd0 100644 --- a/docker/DOCKER.md +++ b/docker/DOCKER.md @@ -133,12 +133,12 @@ deploy: ### Prometheus Metrics -The node exposes metrics at `http://localhost:9630/ext/metrics` +The node exposes metrics at `http://localhost:9630/v1/metrics` ### Health Checks -- Liveness: `http://localhost:9630/ext/health` -- Readiness: `http://localhost:9630/ext/info` +- Liveness: `http://localhost:9630/v1/health` +- Readiness: `http://localhost:9630/v1/info` ### Grafana Dashboard @@ -178,12 +178,12 @@ docker exec -it luxd /bin/bash # Check if bootstrapped curl -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"info.isBootstrapped","params":{"chain":"C"}}' \ - http://localhost:9630/ext/info + http://localhost:9630/v1/info # Get block number curl -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' \ - http://localhost:9630/ext/bc/C/rpc + http://localhost:9630/v1/bc/C/rpc ``` ## CI/CD diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 69cd604bc..8c4a73259 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -287,10 +287,10 @@ echo "📝 Starting with command:" echo " $CMD" echo "" echo "📡 API Endpoints:" -echo " - JSON-RPC: http://$HTTP_HOST:$HTTP_PORT/ext/bc/C/rpc" -echo " - WebSocket: ws://$HTTP_HOST:$HTTP_PORT/ext/bc/C/ws" -echo " - Health: http://$HTTP_HOST:$HTTP_PORT/ext/health" -echo " - Info: http://$HTTP_HOST:$HTTP_PORT/ext/info" +echo " - JSON-RPC: http://$HTTP_HOST:$HTTP_PORT/v1/bc/C/rpc" +echo " - WebSocket: ws://$HTTP_HOST:$HTTP_PORT/v1/bc/C/ws" +echo " - Health: http://$HTTP_HOST:$HTTP_PORT/v1/health" +echo " - Info: http://$HTTP_HOST:$HTTP_PORT/v1/info" echo "" # Execute diff --git a/docs/app/page.tsx b/docs/app/page.tsx index e6bf21782..2aef5daf0 100644 --- a/docs/app/page.tsx +++ b/docs/app/page.tsx @@ -346,7 +346,7 @@ export default function HomePage() {

                 
-                  curl -X POST --data '{"jsonrpc":"2.0","method":"health.health","id":1}' \{"\n"}  -H 'content-type:application/json' \{"\n"}  127.0.0.1:9650/ext/health
+                  curl -X POST --data '{"jsonrpc":"2.0","method":"health.health","id":1}' \{"\n"}  -H 'content-type:application/json' \{"\n"}  127.0.0.1:9650/v1/health
                 
               
diff --git a/docs/content/docs/api/admin.mdx b/docs/content/docs/api/admin.mdx index 94ea0140e..efabcd8e8 100644 --- a/docs/content/docs/api/admin.mdx +++ b/docs/content/docs/api/admin.mdx @@ -31,7 +31,7 @@ Or in configuration: ## Endpoint ``` -http://localhost:9630/ext/admin +http://localhost:9630/v1/admin ``` ## Methods @@ -54,7 +54,7 @@ curl -X POST --data '{ "chain":"2S53R2ub94CV5vmSRAjqPYmRxvuiFunCb1gN2CAw3DQBfPWghX" }, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` --- @@ -85,7 +85,7 @@ curl -X POST --data '{ "chain":"2S53R2ub94CV5vmSRAjqPYmRxvuiFunCb1gN2CAw3DQBfPWghX" }, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` **Response:** @@ -114,7 +114,7 @@ curl -X POST --data '{ "method":"admin.getLogLevel", "params":{}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` **Response:** @@ -146,7 +146,7 @@ curl -X POST --data '{ "logLevel":"debug" }, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` --- @@ -181,7 +181,7 @@ curl -X POST --data '{ "method":"admin.loadVMs", "params":{}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` **Response:** @@ -214,7 +214,7 @@ curl -X POST --data '{ "method":"admin.startCPUProfiler", "params":{}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` --- @@ -232,7 +232,7 @@ curl -X POST --data '{ "method":"admin.stopCPUProfiler", "params":{}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` --- @@ -250,7 +250,7 @@ curl -X POST --data '{ "method":"admin.memoryProfile", "params":{}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` --- @@ -276,7 +276,7 @@ curl -X POST --data '{ "method":"admin.getConfig", "params":{}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` **Response:** @@ -311,7 +311,7 @@ curl -X POST --data '{ "method":"admin.shutdown", "params":{}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` --- @@ -330,7 +330,7 @@ curl -X POST --data '{ "method":"admin.db.commit", "params":{}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/admin +}' -H 'content-type:application/json;' http://localhost:9630/v1/admin ``` ## Profiling and Debugging @@ -344,7 +344,7 @@ curl -X POST --data '{ "method":"admin.startCPUProfiler", "params":{}, "id":1 -}' http://localhost:9630/ext/admin +}' http://localhost:9630/v1/admin # Let it run for 30 seconds sleep 30 @@ -355,7 +355,7 @@ curl -X POST --data '{ "method":"admin.stopCPUProfiler", "params":{}, "id":2 -}' http://localhost:9630/ext/admin +}' http://localhost:9630/v1/admin # Analyze profile go tool pprof cpu.prof @@ -370,7 +370,7 @@ curl -X POST --data '{ "method":"admin.memoryProfile", "params":{}, "id":1 -}' http://localhost:9630/ext/admin +}' http://localhost:9630/v1/admin # Analyze go tool pprof mem.prof @@ -401,7 +401,7 @@ set_log_level() { \"method\":\"admin.setLogLevel\", \"params\":{\"logLevel\":\"$LEVEL\"}, \"id\":1 - }" http://localhost:9630/ext/admin + }" http://localhost:9630/v1/admin } # Increase verbosity for debugging @@ -476,7 +476,7 @@ Enable audit logging for admin operations: # auto_restart.sh check_health() { - curl -s http://localhost:9630/ext/health | jq -r '.healthy' + curl -s http://localhost:9630/v1/health | jq -r '.healthy' } restart_node() { @@ -488,7 +488,7 @@ restart_node() { "method":"admin.shutdown", "params":{}, "id":1 - }' http://localhost:9630/ext/admin + }' http://localhost:9630/v1/admin sleep 10 @@ -514,7 +514,7 @@ CURRENT=$(curl -s -X POST --data '{ "method":"admin.getConfig", "params":{}, "id":1 -}' http://localhost:9630/ext/admin) +}' http://localhost:9630/v1/admin) echo "Current configuration:" echo $CURRENT | jq . @@ -525,7 +525,7 @@ curl -X POST --data '{ "method":"admin.setLogLevel", "params":{"logLevel":"debug"}, "id":2 -}' http://localhost:9630/ext/admin +}' http://localhost:9630/v1/admin ``` ## Troubleshooting diff --git a/docs/content/docs/api/health.mdx b/docs/content/docs/api/health.mdx index c2357b913..e5a6afb85 100644 --- a/docs/content/docs/api/health.mdx +++ b/docs/content/docs/api/health.mdx @@ -10,7 +10,7 @@ The Health API provides endpoints to monitor the health and readiness of your Lu ## Endpoint ``` -http://localhost:9630/ext/health +http://localhost:9630/v1/health ``` ## Health Check Types @@ -20,7 +20,7 @@ http://localhost:9630/ext/health Get the overall health status of the node: ```bash -curl http://localhost:9630/ext/health +curl http://localhost:9630/v1/health ``` **Response:** @@ -61,7 +61,7 @@ curl http://localhost:9630/ext/health Check if the node is ready to serve requests: ```bash -curl http://localhost:9630/ext/health/readiness +curl http://localhost:9630/v1/health/readiness ``` Returns: @@ -73,7 +73,7 @@ Returns: Check if the node is alive and running: ```bash -curl http://localhost:9630/ext/health/liveness +curl http://localhost:9630/v1/health/liveness ``` Returns: @@ -92,7 +92,7 @@ curl -X POST --data '{ "id": 1, "method": "health.health", "params": {} -}' -H 'content-type:application/json;' http://localhost:9630/ext/health +}' -H 'content-type:application/json;' http://localhost:9630/v1/health ``` **Response:** @@ -175,7 +175,7 @@ Configure per-chain health parameters: Export health metrics in Prometheus format: ```bash -curl http://localhost:9630/ext/metrics | grep health +curl http://localhost:9630/v1/metrics | grep health ``` Metrics: @@ -208,13 +208,13 @@ spec: image: luxfi/node:latest livenessProbe: httpGet: - path: /ext/health/liveness + path: /v1/health/liveness port: 9630 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: - path: /ext/health/readiness + path: /v1/health/readiness port: 9630 initialDelaySeconds: 60 periodSeconds: 5 @@ -229,7 +229,7 @@ spec: # health_monitor.sh while true; do - HEALTH=$(curl -s http://localhost:9630/ext/health | jq -r '.healthy') + HEALTH=$(curl -s http://localhost:9630/v1/health | jq -r '.healthy') if [ "$HEALTH" != "true" ]; then echo "ALERT: Node unhealthy at $(date)" @@ -248,7 +248,7 @@ done # health_analysis.sh # Get detailed health -RESPONSE=$(curl -s http://localhost:9630/ext/health) +RESPONSE=$(curl -s http://localhost:9630/v1/health) # Parse each chain for CHAIN in P X C Q; do @@ -271,7 +271,7 @@ done ``` backend lux_nodes - option httpchk GET /ext/health + option httpchk GET /v1/health http-check expect status 200 server node1 192.168.1.10:9630 check @@ -289,7 +289,7 @@ upstream lux_nodes { } location /health_check { - proxy_pass http://lux_nodes/ext/health; + proxy_pass http://lux_nodes/v1/health; proxy_connect_timeout 1s; proxy_read_timeout 1s; } diff --git a/docs/content/docs/api/info.mdx b/docs/content/docs/api/info.mdx index 98452897f..7793353ce 100644 --- a/docs/content/docs/api/info.mdx +++ b/docs/content/docs/api/info.mdx @@ -10,7 +10,7 @@ The Info API provides general information about the node and network status. Thi ## Endpoint ``` -http://localhost:9630/ext/info +http://localhost:9630/v1/info ``` ## Format @@ -23,7 +23,7 @@ curl -X POST --data '{ "method": "info.", "params": {...}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` ## Methods @@ -41,7 +41,7 @@ curl -X POST --data '{ "method": "info.getNodeVersion", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -78,7 +78,7 @@ curl -X POST --data '{ "method": "info.getNodeID", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -111,7 +111,7 @@ curl -X POST --data '{ "method": "info.getNodeIP", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -140,7 +140,7 @@ curl -X POST --data '{ "method": "info.getNetworkID", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -175,7 +175,7 @@ curl -X POST --data '{ "method": "info.getNetworkName", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -207,7 +207,7 @@ curl -X POST --data '{ "alias": "P" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -239,7 +239,7 @@ curl -X POST --data '{ "chain": "P" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -269,7 +269,7 @@ curl -X POST --data '{ "method": "info.peers", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -313,7 +313,7 @@ curl -X POST --data '{ "method": "info.getTxFee", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -348,7 +348,7 @@ curl -X POST --data '{ "method": "info.uptime", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response (Validator):** @@ -390,7 +390,7 @@ curl -X POST --data '{ "method": "info.getVMs", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -424,7 +424,7 @@ curl -X POST --data '{ "method": "info.getUpgrades", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` **Example Response:** @@ -468,7 +468,7 @@ VERSION=$(curl -s -X POST --data '{ "method": "info.getNodeVersion", "params": {}, "id": 1 -}' -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.version') +}' -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.version') echo "Version: $VERSION" @@ -478,7 +478,7 @@ NODE_ID=$(curl -s -X POST --data '{ "method": "info.getNodeID", "params": {}, "id": 1 -}' -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.nodeID') +}' -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.nodeID') echo "Node ID: $NODE_ID" @@ -488,7 +488,7 @@ PEERS=$(curl -s -X POST --data '{ "method": "info.peers", "params": {}, "id": 1 -}' -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.numPeers') +}' -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.numPeers') echo "Connected Peers: $PEERS" @@ -499,7 +499,7 @@ for CHAIN in P X C Q; do \"method\": \"info.isBootstrapped\", \"params\": {\"chain\": \"$CHAIN\"}, \"id\": 1 - }" -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.isBootstrapped') + }" -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.isBootstrapped') echo "$CHAIN-Chain Bootstrapped: $STATUS" done @@ -510,7 +510,7 @@ UPTIME=$(curl -s -X POST --data '{ "method": "info.uptime", "params": {}, "id": 1 -}' -H 'content-type:application/json;' $NODE_URL/ext/info 2>/dev/null | jq -r '.result.rewardingStakePercentage' 2>/dev/null) +}' -H 'content-type:application/json;' $NODE_URL/v1/info 2>/dev/null | jq -r '.result.rewardingStakePercentage' 2>/dev/null) if [ "$UPTIME" != "null" ] && [ -n "$UPTIME" ]; then echo "Validator Uptime: $UPTIME%" @@ -531,7 +531,7 @@ PEERS=$(curl -s -X POST --data '{ "method": "info.peers", "params": {}, "id": 1 -}' -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.peers[]') +}' -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.peers[]') echo "=== Peer Connection Quality ===" echo "Node ID | Latency (ms) | Uptime % | Version" @@ -560,7 +560,7 @@ while true; do \"method\": \"info.isBootstrapped\", \"params\": {\"chain\": \"$CHAIN\"}, \"id\": 1 - }" -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.isBootstrapped') + }" -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.isBootstrapped') if [ "$STATUS" == "true" ]; then echo "✅ $CHAIN-Chain: Bootstrapped" @@ -575,7 +575,7 @@ while true; do "method": "info.peers", "params": {}, "id": 1 - }' -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.numPeers') + }' -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.numPeers') echo "" echo "Connected Peers: $PEERS" @@ -588,7 +588,7 @@ while true; do \"method\": \"info.isBootstrapped\", \"params\": {\"chain\": \"$CHAIN\"}, \"id\": 1 - }" -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.isBootstrapped') + }" -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.isBootstrapped') if [ "$STATUS" != "true" ]; then ALL_BOOTSTRAPPED=false diff --git a/docs/content/docs/api/platform.mdx b/docs/content/docs/api/platform.mdx index f0d720ae4..531656857 100644 --- a/docs/content/docs/api/platform.mdx +++ b/docs/content/docs/api/platform.mdx @@ -10,7 +10,7 @@ The Platform Chain (P-Chain) is responsible for staking, validators, and chain m ## Endpoint ``` -http://localhost:9630/ext/bc/P +http://localhost:9630/v1/bc/P ``` ## Format @@ -23,7 +23,7 @@ curl -X POST --data '{ "method": "platform.", "params": {...}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` ## Methods @@ -41,7 +41,7 @@ curl -X POST --data '{ "method": "platform.getHeight", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` **Example Response:** @@ -73,7 +73,7 @@ curl -X POST --data '{ "addresses": ["P-lux1q8tgunsf7sxpl2qp9fz0xjs36kstm7vdjvpzcc"] }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` **Example Response:** @@ -114,7 +114,7 @@ curl -X POST --data '{ "limit": 100 }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -134,7 +134,7 @@ curl -X POST --data '{ "method": "platform.getCurrentValidators", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` **Example Response:** @@ -190,7 +190,7 @@ curl -X POST --data '{ "method": "platform.getPendingValidators", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -212,7 +212,7 @@ curl -X POST --data '{ "height": 365000 }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -233,7 +233,7 @@ curl -X POST --data '{ "height": 365000 }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -255,7 +255,7 @@ curl -X POST --data '{ "addresses": ["P-lux1q8tgunsf7sxpl2qp9fz0xjs36kstm7vdjvpzcc"] }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -274,7 +274,7 @@ curl -X POST --data '{ "method": "platform.getMinStake", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` **Example Response:** @@ -305,7 +305,7 @@ curl -X POST --data '{ "method": "platform.getTotalStake", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -327,7 +327,7 @@ curl -X POST --data '{ "txID": "2nmH8LithVbdjaXsxVQCQfXtzN9hBbmebrsaEYnLM9T32Uy3Y5" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -345,7 +345,7 @@ curl -X POST --data '{ "method": "platform.getTimestamp", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -363,7 +363,7 @@ curl -X POST --data '{ "method": "platform.getBlockchains", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` **Example Response:** @@ -409,7 +409,7 @@ curl -X POST --data '{ "blockID": "vXSY7FK7NR65Y8BrJDKQH4a6vBdJuqAMvVzWj3Zxcap5J4ZE3" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -431,7 +431,7 @@ curl -X POST --data '{ "txID": "2nmH8LithVbdjaXsxVQCQfXtzN9hBbmebrsaEYnLM9T32Uy3Y5" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -452,7 +452,7 @@ curl -X POST --data '{ "txID": "2nmH8LithVbdjaXsxVQCQfXtzN9hBbmebrsaEYnLM9T32Uy3Y5" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` **Example Response:** @@ -488,7 +488,7 @@ curl -X POST --data '{ "method": "platform.getCurrentSupply", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -507,7 +507,7 @@ curl -X POST --data '{ "method": "platform.getChains", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -544,7 +544,7 @@ curl -X POST --data '{ "password": "mypassword" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` --- @@ -694,7 +694,7 @@ curl -s -X POST --data "{ \"nodeIDs\": [\"$NODE_ID\"] }, \"id\": 1 -}" -H 'content-type:application/json;' http://localhost:9630/ext/bc/P | jq '.result.validators[0]' +}" -H 'content-type:application/json;' http://localhost:9630/v1/bc/P | jq '.result.validators[0]' ``` ### Monitor Staking Rewards @@ -711,7 +711,7 @@ STAKE=$(curl -s -X POST --data "{ \"addresses\": [\"$ADDRESS\"] }, \"id\": 1 -}" -H 'content-type:application/json;' http://localhost:9630/ext/bc/P) +}" -H 'content-type:application/json;' http://localhost:9630/v1/bc/P) echo "Current stake: $(echo $STAKE | jq -r '.result.staked')" echo "Stakeable: $(echo $STAKE | jq -r '.result.stakeable')" diff --git a/docs/content/docs/getting-started/installation.mdx b/docs/content/docs/getting-started/installation.mdx index 827e12a9c..fb3a038ee 100644 --- a/docs/content/docs/getting-started/installation.mdx +++ b/docs/content/docs/getting-started/installation.mdx @@ -210,14 +210,14 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id": 1, "method": "health.health" -}' -H 'content-type:application/json;' http://localhost:9630/ext/health +}' -H 'content-type:application/json;' http://localhost:9630/v1/health # Get node info curl -X POST --data '{ "jsonrpc":"2.0", "id": 1, "method": "info.getNodeVersion" -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info # Check bootstrap status curl -X POST --data '{ @@ -227,7 +227,7 @@ curl -X POST --data '{ "params": { "chain": "P" } -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` ## Troubleshooting diff --git a/docs/content/docs/getting-started/running.mdx b/docs/content/docs/getting-started/running.mdx index 84fdc4152..8e56d7052 100644 --- a/docs/content/docs/getting-started/running.mdx +++ b/docs/content/docs/getting-started/running.mdx @@ -308,7 +308,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id": 1, "method": "health.health" -}' -H 'content-type:application/json;' http://localhost:9630/ext/health +}' -H 'content-type:application/json;' http://localhost:9630/v1/health ``` ### Bootstrap Status @@ -320,7 +320,7 @@ curl -X POST --data '{ "id": 1, "method": "info.isBootstrapped", "params": {"chain": "P"} -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` ### Metrics @@ -328,7 +328,7 @@ curl -X POST --data '{ Access Prometheus metrics: ```bash -curl http://localhost:9630/ext/metrics +curl http://localhost:9630/v1/metrics ``` Key metrics to monitor: diff --git a/docs/content/docs/getting-started/validator.mdx b/docs/content/docs/getting-started/validator.mdx index 97bf21591..b7b476815 100644 --- a/docs/content/docs/getting-started/validator.mdx +++ b/docs/content/docs/getting-started/validator.mdx @@ -58,7 +58,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id": 1, "method": "platform.getHeight" -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P # Check bootstrap status for all chains curl -X POST --data '{ @@ -66,7 +66,7 @@ curl -X POST --data '{ "id": 1, "method": "info.isBootstrapped", "params": {"chain": "P"} -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` ### Configure Public IP @@ -90,7 +90,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id": 1, "method": "info.getNodeID" -}' -H 'content-type:application/json;' http://localhost:9630/ext/info +}' -H 'content-type:application/json;' http://localhost:9630/v1/info ``` Response: @@ -155,7 +155,7 @@ curl -X POST --data '{ "password": "mypassword" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/keystore +}' -H 'content-type:application/json;' http://localhost:9630/v1/keystore # Create P-Chain address curl -X POST --data '{ @@ -166,7 +166,7 @@ curl -X POST --data '{ "password": "mypassword" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` ### Transfer LUX to P-Chain @@ -185,7 +185,7 @@ curl -X POST --data '{ "amount": 2000000000000 }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/X +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/X # Import to P-Chain curl -X POST --data '{ @@ -197,7 +197,7 @@ curl -X POST --data '{ "sourceChain": "X" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` ## Step 4: Add as Validator @@ -221,7 +221,7 @@ curl -X POST --data '{ "delegationFeeRate": 10 }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` Parameters: @@ -243,7 +243,7 @@ curl -X POST --data '{ "method": "platform.getPendingValidators", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P # Get current validators curl -X POST --data '{ @@ -251,7 +251,7 @@ curl -X POST --data '{ "method": "platform.getCurrentValidators", "params": {}, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` ## Step 5: Monitor Your Validator @@ -268,7 +268,7 @@ curl -X POST --data '{ "nodeID": "NodeID-5KqnQfaFQxY9rsFBAa68377qWSherYLQ7" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` ### Monitor Performance Metrics @@ -277,10 +277,10 @@ Key metrics to track: ```bash # Node health -curl http://localhost:9630/ext/health +curl http://localhost:9630/v1/health # Prometheus metrics -curl http://localhost:9630/ext/metrics | grep -E "uptime|stake|validator" +curl http://localhost:9630/v1/metrics | grep -E "uptime|stake|validator" ``` Important metrics: @@ -308,7 +308,7 @@ NODE_URL="http://localhost:9630" WEBHOOK_URL="your-webhook-url" # Check if node is responsive -if ! curl -s "$NODE_URL/ext/health" > /dev/null; then +if ! curl -s "$NODE_URL/v1/health" > /dev/null; then curl -X POST "$WEBHOOK_URL" -d '{"text":"ALERT: Node is not responding!"}' fi @@ -318,7 +318,7 @@ UPTIME=$(curl -s -X POST --data '{ "method":"platform.getValidator", "params":{"nodeID":"NodeID-xxx"}, "id":1 -}' "$NODE_URL/ext/bc/P" | jq -r '.result.uptime') +}' "$NODE_URL/v1/bc/P" | jq -r '.result.uptime') if [ "$UPTIME" -lt "80" ]; then curl -X POST "$WEBHOOK_URL" -d "{\"text\":\"WARNING: Uptime is $UPTIME%\"}" @@ -349,7 +349,7 @@ curl -X POST --data '{ "nodeID": "NodeID-5KqnQfaFQxY9rsFBAa68377qWSherYLQ7" }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` ## Chain Validation @@ -373,7 +373,7 @@ curl -X POST --data '{ "weight": 1000 }, "id": 1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` ### Chain Requirements diff --git a/docs/content/docs/index.mdx b/docs/content/docs/index.mdx index 725212e27..472c3918a 100644 --- a/docs/content/docs/index.mdx +++ b/docs/content/docs/index.mdx @@ -104,14 +104,14 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id": 1, "method": "info.getNetworkInfo" -}' -H 'content-type:application/json;' http://localhost:9650/ext/info +}' -H 'content-type:application/json;' http://localhost:9650/v1/info # Get node ID curl -X POST --data '{ "jsonrpc":"2.0", "id": 1, "method": "info.getNodeID" -}' -H 'content-type:application/json;' http://localhost:9650/ext/info +}' -H 'content-type:application/json;' http://localhost:9650/v1/info ``` ## Chain Management @@ -130,7 +130,7 @@ curl -X POST --data '{ "genesisData": "...", "netID": "network-id" } -}' -H 'content-type:application/json;' http://localhost:9650/ext/P +}' -H 'content-type:application/json;' http://localhost:9650/v1/P ``` ### Validator Management @@ -147,7 +147,7 @@ curl -X POST --data '{ "endTime": ..., "stakeAmount": ... } -}' -H 'content-type:application/json;' http://localhost:9650/ext/P +}' -H 'content-type:application/json;' http://localhost:9650/v1/P ``` ## Configuration Reference @@ -175,10 +175,10 @@ curl -X POST --data '{ ```bash # Prometheus metrics endpoint -curl http://localhost:9650/ext/metrics +curl http://localhost:9650/v1/metrics # Health check -curl http://localhost:9650/ext/health +curl http://localhost:9650/v1/health ``` ### Logs @@ -193,7 +193,7 @@ curl -X POST --data '{ "id": 1, "method": "admin.setLogLevel", "params": {"logLevel": "debug"} -}' http://localhost:9650/ext/admin +}' http://localhost:9650/v1/admin ``` ## Testing diff --git a/docs/content/docs/networking/p2p-protocol.mdx b/docs/content/docs/networking/p2p-protocol.mdx index d1ba12d17..756cda9fc 100644 --- a/docs/content/docs/networking/p2p-protocol.mdx +++ b/docs/content/docs/networking/p2p-protocol.mdx @@ -595,10 +595,10 @@ curl -X POST --data '{ "jsonrpc":"2.0", "method":"info.peers", "id":1 -}' http://localhost:9630/ext/info +}' http://localhost:9630/v1/info # Check network metrics -curl http://localhost:9630/ext/metrics | grep network +curl http://localhost:9630/v1/metrics | grep network # Monitor connections netstat -an | grep 9631 diff --git a/docs/content/docs/operations/monitoring.mdx b/docs/content/docs/operations/monitoring.mdx index 3713fb288..55c906a46 100644 --- a/docs/content/docs/operations/monitoring.mdx +++ b/docs/content/docs/operations/monitoring.mdx @@ -39,7 +39,7 @@ scrape_configs: - job_name: 'lux-node' static_configs: - targets: ['localhost:9630'] - metrics_path: '/ext/metrics' + metrics_path: '/v1/metrics' - job_name: 'node-exporter' static_configs: @@ -56,7 +56,7 @@ alerting: ### Available Metrics -The Lux node exposes 400+ Prometheus metrics at `http://localhost:9630/ext/metrics`. +The Lux node exposes 400+ Prometheus metrics at `http://localhost:9630/v1/metrics`. #### Key Metric Categories @@ -419,11 +419,11 @@ groups: ```bash # Basic health check -curl http://localhost:9630/ext/health +curl http://localhost:9630/v1/health # Detailed health with readiness/liveness -curl http://localhost:9630/ext/health/readiness -curl http://localhost:9630/ext/health/liveness +curl http://localhost:9630/v1/health/readiness +curl http://localhost:9630/v1/health/liveness ``` ### Custom Health Script @@ -443,7 +443,7 @@ send_alert() { } # Check if node is responsive -if ! curl -s "$NODE_URL/ext/health" > /dev/null; then +if ! curl -s "$NODE_URL/v1/health" > /dev/null; then send_alert "Node is not responding!" exit 1 fi @@ -455,7 +455,7 @@ for CHAIN in P X C Q; do \"method\": \"info.isBootstrapped\", \"params\": {\"chain\": \"$CHAIN\"}, \"id\": 1 - }" -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.isBootstrapped') + }" -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.isBootstrapped') if [ "$STATUS" != "true" ]; then send_alert "$CHAIN-Chain is not bootstrapped!" @@ -468,7 +468,7 @@ PEERS=$(curl -s -X POST --data '{ "method": "info.peers", "params": {}, "id": 1 -}' -H 'content-type:application/json;' $NODE_URL/ext/info | jq -r '.result.numPeers') +}' -H 'content-type:application/json;' $NODE_URL/v1/info | jq -r '.result.numPeers') if [ "$PEERS" -lt 4 ]; then send_alert "Low peer count: $PEERS" @@ -619,7 +619,7 @@ Create runbooks for common issues: ```bash # Real-time metrics -watch -n 1 'curl -s http://localhost:9630/ext/metrics | grep -E "chain_height|network_peers"' +watch -n 1 'curl -s http://localhost:9630/v1/metrics | grep -E "chain_height|network_peers"' # Log streaming tail -f ~/.luxd/logs/*.log | grep --line-buffered ERROR diff --git a/docs/content/docs/operations/troubleshooting.mdx b/docs/content/docs/operations/troubleshooting.mdx index 049f682d1..4eb4cef15 100644 --- a/docs/content/docs/operations/troubleshooting.mdx +++ b/docs/content/docs/operations/troubleshooting.mdx @@ -26,7 +26,7 @@ else fi # Check API responsiveness -if curl -s http://localhost:9630/ext/health > /dev/null 2>&1; then +if curl -s http://localhost:9630/v1/health > /dev/null 2>&1; then echo "✅ API is responsive" else echo "❌ API is NOT responsive" @@ -53,7 +53,7 @@ PEERS=$(curl -s -X POST --data '{ "jsonrpc":"2.0", "method":"info.peers", "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/info 2>/dev/null | jq -r '.result.numPeers') +}' -H 'content-type:application/json;' http://localhost:9630/v1/info 2>/dev/null | jq -r '.result.numPeers') if [ -n "$PEERS" ] && [ "$PEERS" -gt 0 ]; then echo "✅ Connected peers: $PEERS" @@ -225,7 +225,7 @@ curl -X POST --data '{ "method":"platform.getCurrentValidators", "params":{"nodeIDs":[""]}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P # Verify staking transaction curl -X POST --data '{ @@ -233,7 +233,7 @@ curl -X POST --data '{ "method":"platform.getTx", "params":{"txID":""}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` #### Issue: Low uptime percentage @@ -275,7 +275,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "method":"platform.getHeight", "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P # Reduce consensus participation ./build/node --consensus-gossip-concurrent=2 @@ -334,7 +334,7 @@ grep "api" ~/.luxd/configs/node-config.json ./build/node --http-host=0.0.0.0 # Check for rate limiting -curl -I http://localhost:9630/ext/info +curl -I http://localhost:9630/v1/info ``` ### Staking Issues @@ -369,7 +369,7 @@ curl -X POST --data '{ "method":"platform.getBalance", "params":{"addresses":["P-lux1..."]}, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P # Import funds from X-Chain curl -X POST --data '{ @@ -381,7 +381,7 @@ curl -X POST --data '{ "sourceChain":"X" }, "id":1 -}' -H 'content-type:application/json;' http://localhost:9630/ext/bc/P +}' -H 'content-type:application/json;' http://localhost:9630/v1/bc/P ``` ## Log Analysis @@ -518,7 +518,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "method":"info.getNodeID", "id":1 -}' http://localhost:9630/ext/info +}' http://localhost:9630/v1/info ``` ### Support Channels diff --git a/import-chain-rlp.sh b/import-chain-rlp.sh index 422068ae4..5921e9b91 100755 --- a/import-chain-rlp.sh +++ b/import-chain-rlp.sh @@ -70,4 +70,4 @@ esac echo "" echo "Import complete! Verify with:" -echo " curl -s -X POST --data '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_blockNumber\",\"params\":[]}' -H 'content-type:application/json' \$RPC_URL/ext/bc//rpc" +echo " curl -s -X POST --data '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_blockNumber\",\"params\":[]}' -H 'content-type:application/json' \$RPC_URL/v1/bc//rpc" diff --git a/indexer/client.go b/indexer/client.go index bc03ab32f..fc4d35c74 100644 --- a/indexer/client.go +++ b/indexer/client.go @@ -21,8 +21,8 @@ type Client struct { // calls. // [uri] is the path to make API calls to. // For example: -// - http://1.2.3.4:9650/ext/index/C/block -// - http://1.2.3.4:9650/ext/index/X/tx +// - http://1.2.3.4:9650/v1/index/C/block +// - http://1.2.3.4:9650/v1/index/X/tx func NewClient(uri string) *Client { return &Client{ Requester: rpc.NewEndpointRequester(uri), diff --git a/indexer/examples/p-chain/main.go b/indexer/examples/p-chain/main.go index ed4b5f60e..702131d78 100644 --- a/indexer/examples/p-chain/main.go +++ b/indexer/examples/p-chain/main.go @@ -20,7 +20,7 @@ import ( // and prints the ID of the block and its transactions. func main() { var ( - uri = primary.LocalAPIURI + "/ext/index/P/block" + uri = primary.LocalAPIURI + "/v1/index/P/block" client = indexer.NewClient(uri) ctx = context.Background() nextIndex uint64 diff --git a/indexer/examples/x-chain-blocks/main.go b/indexer/examples/x-chain-blocks/main.go index ca6554688..1a24d1609 100644 --- a/indexer/examples/x-chain-blocks/main.go +++ b/indexer/examples/x-chain-blocks/main.go @@ -19,7 +19,7 @@ import ( // and prints the ID of the block and its transactions. func main() { var ( - uri = primary.LocalAPIURI + "/ext/index/X/block" + uri = primary.LocalAPIURI + "/v1/index/X/block" xChainID = ids.FromStringOrPanic("2eNy1mUFdmaxXNj1eQHUe7Np4gju9sJsEtWQ4MX3ToiNKuADed") client = indexer.NewClient(uri) ctx = context.Background() diff --git a/indexer/service.md b/indexer/service.md index b68c0f5a4..2d1cd3edc 100644 --- a/indexer/service.md +++ b/indexer/service.md @@ -25,29 +25,29 @@ Each chain has one or more index. To see if a C-Chain block is accepted, for exa ### C-Chain Blocks ``` -/ext/index/C/block +/v1/index/C/block ``` ### P-Chain Blocks ``` -/ext/index/P/block +/v1/index/P/block ``` ### X-Chain Transactions ``` -/ext/index/X/tx +/v1/index/X/tx ``` ### X-Chain Blocks ``` -/ext/index/X/block +/v1/index/X/block ``` -To ensure historical data can be accessed, the `/ext/index/X/vtx` is still accessible, even though it is no longer populated with chain data since the X-Chain block linearization landed. If you are using `V1.10.0` or higher, you need to migrate to using the `/ext/index/X/block` endpoint. +To ensure historical data can be accessed, the `/v1/index/X/vtx` is still accessible, even though it is no longer populated with chain data since the X-Chain block linearization landed. If you are using `V1.10.0` or higher, you need to migrate to using the `/v1/index/X/block` endpoint. ## Methods @@ -87,7 +87,7 @@ index.getContainerByID({ **Example Call**: ```sh -curl --location --request POST 'localhost:9630/ext/index/X/tx' \ +curl --location --request POST 'localhost:9630/v1/index/X/tx' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", @@ -151,7 +151,7 @@ index.getContainerByIndex({ **Example Call**: ```sh -curl --location --request POST 'localhost:9630/ext/index/X/tx' \ +curl --location --request POST 'localhost:9630/v1/index/X/tx' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", @@ -223,7 +223,7 @@ index.getContainerRange({ **Example Call**: ```sh -curl --location --request POST 'localhost:9630/ext/index/X/tx' \ +curl --location --request POST 'localhost:9630/v1/index/X/tx' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", @@ -282,7 +282,7 @@ index.getIndex({ **Example Call**: ```sh -curl --location --request POST 'localhost:9630/ext/index/X/tx' \ +curl --location --request POST 'localhost:9630/v1/index/X/tx' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", @@ -339,7 +339,7 @@ index.getLastAccepted({ **Example Call**: ```sh -curl --location --request POST 'localhost:9630/ext/index/X/tx' \ +curl --location --request POST 'localhost:9630/v1/index/X/tx' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", @@ -394,7 +394,7 @@ index.isAccepted({ **Example Call**: ```sh -curl --location --request POST 'localhost:9630/ext/index/X/tx' \ +curl --location --request POST 'localhost:9630/v1/index/X/tx' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", @@ -430,7 +430,7 @@ To get an X-Chain transaction by its index (the order it was accepted in), use I For example, to get the second transaction (note that `"index":1`) accepted on the X-Chain, do: ```sh -curl --location --request POST 'https://indexer-demo.lux.network/ext/index/X/tx' \ +curl --location --request POST 'https://indexer-demo.lux.network/v1/index/X/tx' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", @@ -474,7 +474,7 @@ curl -X POST --data '{ "txID":"ZGYTSU8w3zUP6VFseGC798vA2Vnxnfj6fz1QPfA9N93bhjJvo", "encoding": "json" } -}' -H 'content-type:application/json;' https://api.lux.network/ext/bc/X +}' -H 'content-type:application/json;' https://api.lux.network/v1/bc/X ``` **Response**: diff --git a/k8s/base/statefulset.yaml b/k8s/base/statefulset.yaml index b46cdb4b3..b1cbaf9ba 100644 --- a/k8s/base/statefulset.yaml +++ b/k8s/base/statefulset.yaml @@ -79,7 +79,7 @@ spec: cpu: "4" livenessProbe: httpGet: - path: /ext/health + path: /v1/health port: 9630 initialDelaySeconds: 120 periodSeconds: 30 @@ -87,7 +87,7 @@ spec: timeoutSeconds: 10 readinessProbe: httpGet: - path: /ext/health + path: /v1/health port: 9630 initialDelaySeconds: 30 periodSeconds: 10 @@ -95,7 +95,7 @@ spec: timeoutSeconds: 5 startupProbe: httpGet: - path: /ext/health + path: /v1/health port: 9630 initialDelaySeconds: 10 periodSeconds: 10 diff --git a/node/node.go b/node/node.go index f94117982..399d6c255 100644 --- a/node/node.go +++ b/node/node.go @@ -1825,18 +1825,18 @@ func (n *Node) initInfoAPI() error { // initSecurityAPI exposes the chain-wide ChainSecurityProfile as a // read-only API surface. Three endpoints share one handler: // -// - JSON-RPC: POST /ext/security with methods securityProfile and +// - JSON-RPC: POST /v1/security with methods securityProfile and // blockSecurity (dispatched on the wire as security_securityProfile // / security_blockSecurity per gorilla/rpc namespace convention) -// - REST: GET /ext/security/profile -// - REST: GET /ext/security/block/{n} +// - REST: GET /v1/security/profile +// - REST: GET /v1/security/block/{n} // // All three share the same Service receiver; the shape returned is // the SCREAMING_SNAKE canonical profile JSON consumed by audit tooling, // wallet posture banners, and block explorers. // // Prometheus gauges for the active profile are stamped onto the -// node-wide metrics gatherer here so /ext/metrics carries the profile +// node-wide metrics gatherer here so /v1/metrics carries the profile // posture immediately after boot. // // Closes F102 follow-ups (securityProfile RPC + profile metrics). @@ -1844,7 +1844,7 @@ func (n *Node) initSecurityAPI() error { n.Log.Info("initializing security API") // Register profile metrics under the "security" namespace on the - // node-wide gatherer so /ext/metrics carries them alongside the + // node-wide gatherer so /v1/metrics carries them alongside the // existing process / api / chain metric families. securityMetricsReg, err := metric.MakeAndRegister( n.MetricsGatherer, diff --git a/scripts/dev-instance.sh b/scripts/dev-instance.sh index 2999ed861..c942e7647 100755 --- a/scripts/dev-instance.sh +++ b/scripts/dev-instance.sh @@ -72,7 +72,7 @@ echo "" # Wait for RPC to be ready echo -n "Waiting for RPC..." for _ in {1..30}; do - if curl -s "http://127.0.0.1:$HTTP_PORT/ext/info" >/dev/null 2>&1; then + if curl -s "http://127.0.0.1:$HTTP_PORT/v1/info" >/dev/null 2>&1; then echo " ready!" break fi @@ -83,10 +83,10 @@ done # Show status echo "" echo "=== Instance Ready ===" -echo " C-Chain RPC: http://127.0.0.1:$HTTP_PORT/ext/bc/C/rpc" -echo " X-Chain RPC: http://127.0.0.1:$HTTP_PORT/ext/bc/X" -echo " P-Chain RPC: http://127.0.0.1:$HTTP_PORT/ext/bc/P" -echo " Info API: http://127.0.0.1:$HTTP_PORT/ext/info" +echo " C-Chain RPC: http://127.0.0.1:$HTTP_PORT/v1/bc/C/rpc" +echo " X-Chain RPC: http://127.0.0.1:$HTTP_PORT/v1/bc/X" +echo " P-Chain RPC: http://127.0.0.1:$HTTP_PORT/v1/bc/P" +echo " Info API: http://127.0.0.1:$HTTP_PORT/v1/info" echo "" echo " Logs: tail -f $LOG_FILE" echo " Stop: kill $(cat "$PID_FILE")" diff --git a/scripts/run_prometheus.sh b/scripts/run_prometheus.sh index 0741913a0..169de812c 100755 --- a/scripts/run_prometheus.sh +++ b/scripts/run_prometheus.sh @@ -101,7 +101,7 @@ global: scrape_configs: - job_name: "node" - metrics_path: "/ext/metrics" + metrics_path: "/v1/metrics" file_sd_configs: - files: - '${FILE_SD_PATH}/*.json' diff --git a/server/http/router.go b/server/http/router.go index ce3be5fa7..72a8f57c6 100644 --- a/server/http/router.go +++ b/server/http/router.go @@ -147,9 +147,9 @@ func (r *router) handleRootGET(w http.ResponseWriter, _ *http.Request) { P string `json:"p"` X string `json:"x"` }{ - C: "/ext/bc/C/rpc", - P: "/ext/bc/P", - X: "/ext/bc/X", + C: baseURL + "/bc/C/rpc", + P: baseURL + "/bc/P", + X: baseURL + "/bc/X", }, Endpoints: struct { RPC string `json:"rpc"` @@ -157,10 +157,10 @@ func (r *router) handleRootGET(w http.ResponseWriter, _ *http.Request) { Info string `json:"info"` Health string `json:"health"` }{ - RPC: "/ext/bc/C/rpc", - Websocket: "/ext/bc/C/ws", - Info: "/ext/info", - Health: "/ext/health", + RPC: baseURL + "/bc/C/rpc", + Websocket: baseURL + "/bc/C/ws", + Info: baseURL + "/info", + Health: baseURL + "/health", }, } } @@ -173,10 +173,10 @@ func (r *router) handleRootGET(w http.ResponseWriter, _ *http.Request) { // handleRootPOST proxies JSON-RPC requests to the C-chain func (r *router) handleRootPOST(w http.ResponseWriter, req *http.Request) { // Look up the C-chain RPC handler - handler, err := r.GetHandler("/ext/bc/C", "/rpc") + handler, err := r.GetHandler(baseURL+"/bc/C", "/rpc") if err != nil { // Try alternate path formats - handler, err = r.GetHandler("/ext/bc/C/rpc", "") + handler, err = r.GetHandler(baseURL+"/bc/C/rpc", "") if err != nil { // Return proper JSON-RPC error w.Header().Set("Content-Type", "application/json") @@ -198,10 +198,10 @@ func (r *router) SetRootInfoProvider(provider RootInfoProvider) { } // handleHealthz returns a minimal health response for K8s probes. -// This delegates to the full /ext/health handler when available, +// This delegates to the full /v1/health handler when available, // falling back to a static 200 response during early startup. func (r *router) handleHealthz(w http.ResponseWriter, req *http.Request) { - if handler, err := r.GetHandler("/ext/health", "/health"); err == nil { + if handler, err := r.GetHandler(baseURL+"/health", "/health"); err == nil { handler.ServeHTTP(w, req) return } diff --git a/server/http/server.go b/server/http/server.go index 356ce1114..d6852851b 100644 --- a/server/http/server.go +++ b/server/http/server.go @@ -25,7 +25,12 @@ import ( ) const ( - baseURL = "/ext" + // baseURL is the canonical — and only — prefix for every luxd HTTP route + // (/v1/bc/C/rpc, /v1/info, /v1/health, ...). Single source of truth: + // AddRoute/AddAliases and the root/health helpers in router.go all derive + // their paths from it. The legacy Avalanche-heritage /ext prefix is gone; + // one way, no backward compatibility (activation Dec 25 2025). + baseURL = "/v1" maxConcurrentStreams = 64 ) @@ -95,7 +100,7 @@ type server struct { listener net.Listener // handler is the fully-wrapped API handler chain (CORS + host-filter + - // /ext/* router). Held here so the optional ZAP-RPC listener serves the + // /v1/* router). Held here so the optional ZAP-RPC listener serves the // exact same handler as the HTTP listener. handler http.Handler diff --git a/server/http/zap_listener.go b/server/http/zap_listener.go index dce728cbd..fedbefa39 100644 --- a/server/http/zap_listener.go +++ b/server/http/zap_listener.go @@ -2,7 +2,7 @@ // See the file LICENSE for licensing terms. // ZAP-RPC listener — serves the EXACT same fully-wrapped API handler chain -// (CORS + host-filter + /ext/* router) as the HTTP listener, but over the +// (CORS + host-filter + /v1/* router) as the HTTP listener, but over the // github.com/zap-proto/http binary protocol. This is what makes luxd a // first-class citizen of the ZAP service mesh: the api. gateway can // proxy to luxd over native ZAP instead of HTTP/1.1. diff --git a/server/http/zap_listener_test.go b/server/http/zap_listener_test.go index d4b4486e1..f37c57287 100644 --- a/server/http/zap_listener_test.go +++ b/server/http/zap_listener_test.go @@ -60,7 +60,7 @@ func TestStartZapRPCListener_RoundTrip(t *testing.T) { const body = `{"jsonrpc":"2.0","result":"0x2a","id":1}` mux := http.NewServeMux() - mux.HandleFunc("/ext/bc/C/rpc", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/v1/bc/C/rpc", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") _, _ = io.WriteString(w, body) }) @@ -75,7 +75,7 @@ func TestStartZapRPCListener_RoundTrip(t *testing.T) { time.Sleep(150 * time.Millisecond) client := &http.Client{Transport: zaphttp.NewTransport(addr)} - resp, err := client.Post("http://"+addr+"/ext/bc/C/rpc", "application/json", nil) + resp, err := client.Post("http://"+addr+"/v1/bc/C/rpc", "application/json", nil) if err != nil { t.Fatalf("ZAP round-trip POST failed: %v", err) } diff --git a/service/auth/auth_test.go b/service/auth/auth_test.go index 8a7668a4c..09902f6c6 100644 --- a/service/auth/auth_test.go +++ b/service/auth/auth_test.go @@ -143,7 +143,7 @@ func TestRevokeToken(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword).(*auth) // Make a token - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics"} tokenStr, err := auth.NewToken(testPassword, defaultTokenLifespan, endpoints) require.NoError(err) @@ -157,7 +157,7 @@ func TestWrapHandlerHappyPath(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword) // Make a token - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics"} tokenStr, err := auth.NewToken(testPassword, defaultTokenLifespan, endpoints) require.NoError(err) @@ -178,7 +178,7 @@ func TestWrapHandlerRevokedToken(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword) // Make a token - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics"} tokenStr, err := auth.NewToken(testPassword, defaultTokenLifespan, endpoints) require.NoError(err) @@ -205,7 +205,7 @@ func TestWrapHandlerExpiredToken(t *testing.T) { auth.clock.Set(time.Now().Add(-2 * defaultTokenLifespan)) // Make a token that expired well in the past - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics"} tokenStr, err := auth.NewToken(testPassword, defaultTokenLifespan, endpoints) require.NoError(err) @@ -227,7 +227,7 @@ func TestWrapHandlerNoAuthToken(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword) - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics"} wrappedHandler := auth.WrapHandler(dummyHandler) for _, endpoint := range endpoints { req := httptest.NewRequest(http.MethodPost, fmt.Sprintf("http://127.0.0.1:9630%s", endpoint), strings.NewReader("")) @@ -245,11 +245,11 @@ func TestWrapHandlerUnauthorizedEndpoint(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword) // Make a token - endpoints := []string{"/ext/info"} + endpoints := []string{"/v1/info"} tokenStr, err := auth.NewToken(testPassword, defaultTokenLifespan, endpoints) require.NoError(err) - unauthorizedEndpoints := []string{"/ext/bc/X", "/ext/metrics", "", "/foo", "/ext/info/foo"} + unauthorizedEndpoints := []string{"/v1/bc/X", "/v1/metrics", "", "/foo", "/v1/info/foo"} wrappedHandler := auth.WrapHandler(dummyHandler) for _, endpoint := range unauthorizedEndpoints { @@ -269,12 +269,12 @@ func TestWrapHandlerAuthEndpoint(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword) // Make a token - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics", "", "/foo", "/ext/info/foo"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics", "", "/foo", "/v1/info/foo"} tokenStr, err := auth.NewToken(testPassword, defaultTokenLifespan, endpoints) require.NoError(err) wrappedHandler := auth.WrapHandler(dummyHandler) - req := httptest.NewRequest(http.MethodPost, "http://127.0.0.1:9630/ext/auth", strings.NewReader("")) + req := httptest.NewRequest(http.MethodPost, "http://127.0.0.1:9630/v1/auth", strings.NewReader("")) req.Header.Add("Authorization", headerValStart+tokenStr) rr := httptest.NewRecorder() wrappedHandler.ServeHTTP(rr, req) @@ -287,7 +287,7 @@ func TestWrapHandlerAccessAll(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword) // Make a token that allows access to all endpoints - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics", "", "/foo", "/ext/foo/info"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics", "", "/foo", "/v1/foo/info"} tokenStr, err := auth.NewToken(testPassword, defaultTokenLifespan, []string{"*"}) require.NoError(err) @@ -316,7 +316,7 @@ func TestWrapHandlerMutatedRevokedToken(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword) // Make a token - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics"} tokenStr, err := auth.NewToken(testPassword, defaultTokenLifespan, endpoints) require.NoError(err) @@ -339,7 +339,7 @@ func TestWrapHandlerInvalidSigningMethod(t *testing.T) { auth := NewFromHash(log.NewNoOpLogger(), "auth", hashedPassword).(*auth) // Make a token - endpoints := []string{"/ext/info", "/ext/bc/X", "/ext/metrics"} + endpoints := []string{"/v1/info", "/v1/bc/X", "/v1/metrics"} idBytes := [tokenIDByteLen]byte{} _, err := rand.Read(idBytes[:]) require.NoError(err) diff --git a/service/auth/service.go b/service/auth/service.go index dde71fdc9..ca19ed4de 100644 --- a/service/auth/service.go +++ b/service/auth/service.go @@ -22,7 +22,7 @@ type Password struct { type NewTokenArgs struct { Password // Endpoints that may be accessed with this token e.g. if endpoints is - // ["/ext/bc/X", "/ext/admin"] then the token holder can hit the X-Chain API + // ["/v1/bc/X", "/v1/admin"] then the token holder can hit the X-Chain API // and the admin API. If [Endpoints] contains an element "*" then the token // allows access to all API endpoints. [Endpoints] must have between 1 and // [maxEndpoints] elements diff --git a/service/health/service.md b/service/health/service.md index 5d0fd2f61..edffe5128 100644 --- a/service/health/service.md +++ b/service/health/service.md @@ -23,7 +23,7 @@ To get an HTTP status code response that indicates the node's health, make a `GE To filter GET health checks, add a `tag` query parameter to the request. The `tag` parameter is a string. For example, to filter health results by netID `29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL`, use the following query: ```sh -curl 'http://localhost:9630/ext/health?tag=29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL' +curl 'http://localhost:9630/v1/health?tag=29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL' ``` In this example returned results will contain global health checks and health checks that are related to netID `29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL`. @@ -33,7 +33,7 @@ In this example returned results will contain global health checks and health ch In order to filter results by multiple tags, use multiple `tag` query parameters. For example, to filter health results by netID `29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL` and `28nrH5T2BMvNrWecFcV3mfccjs6axM1TVyqe79MCv2Mhs8kxiY` use the following query: ```sh -curl 'http://localhost:9630/ext/health?tag=29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL&tag=28nrH5T2BMvNrWecFcV3mfccjs6axM1TVyqe79MCv2Mhs8kxiY' +curl 'http://localhost:9630/v1/health?tag=29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL&tag=28nrH5T2BMvNrWecFcV3mfccjs6axM1TVyqe79MCv2Mhs8kxiY' ``` The returned results will include health checks for both netIDs as well as global health checks. @@ -42,10 +42,10 @@ The returned results will include health checks for both netIDs as well as globa The available endpoints for GET requests are: -- `/ext/health` returns a holistic report of the status of the node. **Most operators should monitor this status.** -- `/ext/health/health` is the same as `/ext/health`. -- `/ext/health/readiness` returns healthy once the node has finished initializing. -- `/ext/health/liveness` returns healthy once the endpoint is available. +- `/v1/health` returns a holistic report of the status of the node. **Most operators should monitor this status.** +- `/v1/health/health` is the same as `/v1/health`. +- `/v1/health/readiness` returns healthy once the node has finished initializing. +- `/v1/health/liveness` returns healthy once the endpoint is available. ## JSON RPC Request @@ -71,7 +71,7 @@ curl -H 'Content-Type: application/json' --data '{ "params": { "tags": ["11111111111111111111111111111111LpoYY", "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL"] } -}' 'http://localhost:9630/ext/health' +}' 'http://localhost:9630/v1/health' ``` **Example Response**: @@ -203,7 +203,7 @@ curl -H 'Content-Type: application/json' --data '{ "params": { "tags": ["11111111111111111111111111111111LpoYY", "29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL"] } -}' 'http://localhost:9630/ext/health' +}' 'http://localhost:9630/v1/health' ``` **Example Response**: @@ -249,7 +249,7 @@ curl -H 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "id" :1, "method" :"health.liveness" -}' 'http://localhost:9630/ext/health' +}' 'http://localhost:9630/v1/health' ``` **Example Response**: diff --git a/service/info/service.md b/service/info/service.md index 14a818f7d..233d3bf12 100644 --- a/service/info/service.md +++ b/service/info/service.md @@ -7,7 +7,7 @@ This API uses the `json 2.0` RPC format. For more information on making JSON RPC ## Endpoint ``` -/ext/info +/v1/info ``` ## Methods @@ -38,7 +38,7 @@ curl -sX POST --data '{ "id" :1, "method" :"info.lps", "params" :{} -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -125,7 +125,7 @@ curl -X POST --data '{ "params": { "chain":"X" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -160,7 +160,7 @@ curl -X POST --data '{ "params": { "alias":"X" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -192,7 +192,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"info.getNetworkID" -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -226,7 +226,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"info.getNetworkName" -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -273,7 +273,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"info.getNodeID" -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -313,7 +313,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"info.getNodeIP" -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -359,7 +359,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"info.getNodeVersion" -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -426,7 +426,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"info.getTxFee" -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -473,7 +473,7 @@ curl -X POST --data '{ "id" :1, "method" :"info.getVMs", "params" :{} -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -540,7 +540,7 @@ curl -X POST --data '{ "params": { "nodeIDs": [] } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -619,7 +619,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"info.uptime" -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` **Example Response**: @@ -645,7 +645,7 @@ curl -X POST --data '{ "params" :{ "netID":"29uVeLPJB1eQJkzRemU8g8wZDw5uJRqpab5U2mX9euieVwiEbL" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/info ``` #### Example Lux L1 Response @@ -672,7 +672,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"info.upgrades" -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/info ``` **Example Response**: diff --git a/service/info/service_test.go b/service/info/service_test.go index 7783e8cfe..c268ec182 100644 --- a/service/info/service_test.go +++ b/service/info/service_test.go @@ -64,7 +64,7 @@ func TestGetNodeVersionConsensusRoundtrip(t *testing.T) { log: log.NewNoOpLogger(), } - req := httptest.NewRequest("POST", "/ext/info", nil) + req := httptest.NewRequest("POST", "/v1/info", nil) reply := apiinfo.GetNodeVersionReply{} require.NoError(info.GetNodeVersion(req, nil, &reply)) require.NotNil(reply.Consensus) @@ -114,7 +114,7 @@ func TestGetVMsSuccess(t *testing.T) { id2: []string{alias2}, } - req := httptest.NewRequest("POST", "/ext/info", nil) + req := httptest.NewRequest("POST", "/v1/info", nil) resources.mockVMManager.EXPECT().ListFactories(req.Context()).Times(1).Return(vmIDs, nil) resources.mockVMManager.EXPECT().PrimaryAlias(req.Context(), id1).Times(1).Return(alias1, nil) resources.mockVMManager.EXPECT().PrimaryAlias(req.Context(), id2).Times(1).Return(alias2, nil) @@ -128,7 +128,7 @@ func TestGetVMsSuccess(t *testing.T) { func TestGetVMsVMsListFactoriesFails(t *testing.T) { resources := initGetVMsTest(t) - req := httptest.NewRequest("POST", "/ext/info", nil) + req := httptest.NewRequest("POST", "/v1/info", nil) resources.mockVMManager.EXPECT().ListFactories(req.Context()).Times(1).Return(nil, errTest) reply := apiinfo.GetVMsReply{} @@ -146,7 +146,7 @@ func TestGetVMsGetAliasesFails(t *testing.T) { vmIDs := []ids.ID{id1, id2} alias1 := "vm1-alias-1" - req := httptest.NewRequest("POST", "/ext/info", nil) + req := httptest.NewRequest("POST", "/v1/info", nil) resources.mockVMManager.EXPECT().ListFactories(req.Context()).Times(1).Return(vmIDs, nil) resources.mockVMManager.EXPECT().PrimaryAlias(req.Context(), id1).Times(1).Return(alias1, nil) resources.mockVMManager.EXPECT().PrimaryAlias(req.Context(), id2).Times(1).Return("", errTest) diff --git a/service/keystore/client.go b/service/keystore/client.go index 76a8ec20c..7f1de8030 100644 --- a/service/keystore/client.go +++ b/service/keystore/client.go @@ -38,7 +38,7 @@ type client struct { // instead. func NewClient(uri string) Client { return &client{requester: rpc.NewEndpointRequester( - uri + "/ext/keystore", + uri + "/v1/keystore", )} } diff --git a/service/keystore/service.md b/service/keystore/service.md index 630c6c99c..81c2fb79d 100644 --- a/service/keystore/service.md +++ b/service/keystore/service.md @@ -48,7 +48,7 @@ This API uses the `json 2.0` API format. For more information on making JSON RPC ## Endpoint ```text -/ext/keystore +/v1/keystore ``` ## Methods @@ -89,7 +89,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/keystore +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/keystore ``` **Example Response:** @@ -129,7 +129,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/keystore +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/keystore ``` **Example Response:** @@ -183,7 +183,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/keystore +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/keystore ``` **Example Response:** @@ -238,7 +238,7 @@ curl -X POST --data '{ "password":"myPassword", "user" :"0x7655a29df6fc2747b0874e1148b423b954a25fcdb1f170d0ec8eb196430f7001942ce55b02a83b1faf50a674b1e55bfc000000008cf2d869" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/keystore +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/keystore ``` **Example Response:** @@ -274,7 +274,7 @@ curl -X POST --data '{ "jsonrpc":"2.0", "id" :1, "method" :"keystore.listUsers" -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/keystore +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/keystore ``` **Example Response:** diff --git a/service/metrics/client.go b/service/metrics/client.go index aac61cede..a22f91d1a 100644 --- a/service/metrics/client.go +++ b/service/metrics/client.go @@ -32,7 +32,7 @@ type Client struct { // NewClient returns a new Metrics API Client func NewClient(uri string) *Client { return &Client{ - uri: uri + "/ext/metrics", + uri: uri + "/v1/metrics", } } diff --git a/service/metrics/service.md b/service/metrics/service.md index b0d4eedd8..c28ffb8fc 100644 --- a/service/metrics/service.md +++ b/service/metrics/service.md @@ -7,7 +7,7 @@ This API set is for a specific node, it is unavailable on the [public server](ht ## Endpoint ``` -/ext/metrics +/v1/metrics ``` ## Usage @@ -15,7 +15,7 @@ This API set is for a specific node, it is unavailable on the [public server](ht To get the node metrics: ```sh -curl -X POST 127.0.0.1:9630/ext/metrics +curl -X POST 127.0.0.1:9630/v1/metrics ``` ## Format diff --git a/service/security/service.go b/service/security/service.go index f03ad7b80..0c4a1d4b7 100644 --- a/service/security/service.go +++ b/service/security/service.go @@ -27,7 +27,7 @@ var ErrNoProfile = errors.New( "(genesis carries no SecurityProfile{} block); RPC unavailable") // Service is the JSON-RPC handler set registered under the security -// namespace at /ext/security. Methods are read-only; the underlying +// namespace at /v1/security. Methods are read-only; the underlying // profile pointer is set once at construction and never mutated. // // Exposed methods: @@ -37,7 +37,7 @@ var ErrNoProfile = errors.New( // // On the wire, gorilla/rpc dispatches these as security_securityProfile // and security_blockSecurity (namespace_method). Callers using the REST -// sidecars hit /ext/security/profile and /ext/security/block/{n} +// sidecars hit /v1/security/profile and /v1/security/block/{n} // directly. One namespace, two transports, one shape. // // The "block" method returns the chain-wide envelope; per-block @@ -53,13 +53,13 @@ type Service struct { // namespace. Profile may be nil — see ErrNoProfile. // // The returned handler is suitable for APIServer.AddRoute(handler, -// "security", "") so it lands at /ext/security on the node's HTTP +// "security", "") so it lands at /v1/security on the node's HTTP // listener. REST sidecars are mounted at /profile and /block/{n} on // the same handler so the full external surface is: // -// POST /ext/security (JSON-RPC, methods above) -// GET /ext/security/profile (REST sidecar) -// GET /ext/security/block/{n} (REST sidecar) +// POST /v1/security (JSON-RPC, methods above) +// GET /v1/security/profile (REST sidecar) +// GET /v1/security/block/{n} (REST sidecar) func NewHandler(logger log.Logger, profile *consensusconfig.ChainSecurityProfile) (http.Handler, error) { server := rpc.NewServer() codec := avajson.NewCodec() @@ -71,7 +71,7 @@ func NewHandler(logger log.Logger, profile *consensusconfig.ChainSecurityProfile } // REST sidecars share the Service receiver so the two transports // stay byte-identical in semantics (one and only one way to - // compute the shape). Paths relative to /ext/security: + // compute the shape). Paths relative to /v1/security: // /profile → restProfile // /block/{n} → restBlockSecurity mux := http.NewServeMux() @@ -133,7 +133,7 @@ func (s *Service) BlockSecurity(_ *http.Request, _ *BlockSecurityArgs, reply *Bl return nil } -// restProfile is the GET /profile sidecar (full path /ext/security/profile). +// restProfile is the GET /profile sidecar (full path /v1/security/profile). // Same body as the securityProfile JSON-RPC method; useful for // explorers that don't speak JSON-RPC. Refuses every non-GET method so // callers can't smuggle state through the read-only endpoint. @@ -151,7 +151,7 @@ func (s *Service) restProfile(w http.ResponseWriter, r *http.Request) { } // restBlockSecurity is the GET /block/{n} sidecar (full path -// /ext/security/block/{n}). The path suffix is taken as the block +// /v1/security/block/{n}). The path suffix is taken as the block // number; chain alias defaults to the platform chain (callers can // re-route per-chain at the chain-manager layer if needed). func (s *Service) restBlockSecurity(w http.ResponseWriter, r *http.Request) { diff --git a/service/security/service_test.go b/service/security/service_test.go index d7b34c894..d2b010637 100644 --- a/service/security/service_test.go +++ b/service/security/service_test.go @@ -203,7 +203,7 @@ func TestRPC_blockSecurity_StrictPQ(t *testing.T) { } // TestREST_securityProfile_GET proves the /profile sidecar (full path -// /ext/security/profile when mounted on APIServer) returns the same +// /v1/security/profile when mounted on APIServer) returns the same // JSON shape as the JSON-RPC handler. One shape, two transports — no // per-transport drift. func TestREST_securityProfile_GET(t *testing.T) { @@ -262,7 +262,7 @@ func TestREST_securityProfile_MethodNotAllowed(t *testing.T) { } // TestREST_blockSecurity_GET proves the /block/{n} sidecar (full path -// /ext/security/block/{n} when mounted on APIServer) returns the same +// /v1/security/block/{n} when mounted on APIServer) returns the same // JSON shape as the JSON-RPC handler. One shape, two transports — no // per-transport drift. func TestREST_blockSecurity_GET(t *testing.T) { diff --git a/service/security/types.go b/service/security/types.go index f4a1a5181..5076270a6 100644 --- a/service/security/types.go +++ b/service/security/types.go @@ -3,8 +3,8 @@ // Package security exposes the chain-wide ChainSecurityProfile to operators, // dApps, and auditors through the security JSON-RPC namespace at -// /ext/security and two REST sidecars at /ext/security/profile and -// /ext/security/block/{n}. +// /v1/security and two REST sidecars at /v1/security/profile and +// /v1/security/block/{n}. // // The handlers in this package are read-only: every shape is derived from // the immutable *consensusconfig.ChainSecurityProfile resolved at node @@ -22,7 +22,7 @@ import ( ) // ProfileReply is the JSON body returned by the securityProfile RPC -// (POST /ext/security) and the REST sidecar (GET /ext/security/profile). +// (POST /v1/security) and the REST sidecar (GET /v1/security/profile). // // Stable shape: every field has a fixed JSON tag, no embedded structs. // Adding a new field requires bumping the major version of the security @@ -99,8 +99,8 @@ type ProfileReply struct { } // BlockSecurityReply is the JSON body returned by the blockSecurity -// RPC (POST /ext/security) and the REST endpoint -// /ext/security/block/{n}. It enriches a block lookup with the +// RPC (POST /v1/security) and the REST endpoint +// /v1/security/block/{n}. It enriches a block lookup with the // chain-wide security envelope so explorers can show "this block was // finalised under profile X with backend Y" without reimplementing // profile lookup. diff --git a/tests/http.go b/tests/http.go index 44b5d8c05..cf7304474 100644 --- a/tests/http.go +++ b/tests/http.go @@ -31,7 +31,7 @@ type SimpleNodesMetrics map[string]SimpleNodeMetrics // GetSimpleNodeMetrics retrieves the specified metrics the provided node URI. func GetSimpleNodeMetrics(nodeURI string, metricNames ...string) (SimpleNodeMetrics, error) { - uri := nodeURI + "/ext/metrics" + uri := nodeURI + "/v1/metrics" return GetMetricsValue(uri, metricNames...) } diff --git a/vms/example/xsvm/README.md b/vms/example/xsvm/README.md index 9417b1bfb..dc2d316ea 100644 --- a/vms/example/xsvm/README.md +++ b/vms/example/xsvm/README.md @@ -149,7 +149,7 @@ type Client interface { For example: ```bash -curl --location --request POST 'http://34.235.54.228:9630/ext/bc/28iioW2fYMBnKv24VG5nw9ifY2PsFuwuhxhyzxZB5MmxDd3rnT' \ +curl --location --request POST 'http://34.235.54.228:9630/v1/bc/28iioW2fYMBnKv24VG5nw9ifY2PsFuwuhxhyzxZB5MmxDd3rnT' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", diff --git a/vms/platformvm/GetAllValidatorsAt_API_Example.md b/vms/platformvm/GetAllValidatorsAt_API_Example.md index afff7160a..9c2651586 100644 --- a/vms/platformvm/GetAllValidatorsAt_API_Example.md +++ b/vms/platformvm/GetAllValidatorsAt_API_Example.md @@ -5,7 +5,7 @@ The `GetAllValidatorsAt` endpoint returns the validator sets of all networks (in ## Endpoint ``` -POST /ext/bc/P +POST /v1/bc/P ``` ## Request Format @@ -71,7 +71,7 @@ curl -X POST --data '{ "params": { "height": 1000 } -}' -H 'content-type:application/json;' http://127.0.0.1:9650/ext/bc/P +}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/P ``` ### Get validators at proposed height @@ -83,7 +83,7 @@ curl -X POST --data '{ "params": { "height": "proposed" } -}' -H 'content-type:application/json;' http://127.0.0.1:9650/ext/bc/P +}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/P ``` ## Use Cases diff --git a/vms/platformvm/api/static_client.go b/vms/platformvm/api/static_client.go index 0210a7fae..1c7ae32b1 100644 --- a/vms/platformvm/api/static_client.go +++ b/vms/platformvm/api/static_client.go @@ -29,7 +29,7 @@ type staticClient struct { // NewClient returns a platformvm client for interacting with the platformvm static api func NewStaticClient(uri string) StaticClient { return &staticClient{requester: rpc.NewEndpointRequester( - uri + "/ext/vm/platform", + uri + "/v1/vm/platform", )} } diff --git a/vms/platformvm/client.go b/vms/platformvm/client.go index aa7c00c6e..d7bb36082 100644 --- a/vms/platformvm/client.go +++ b/vms/platformvm/client.go @@ -32,7 +32,7 @@ type Client struct { func NewClient(uri string) *Client { return &Client{Requester: rpc.NewEndpointRequester( - uri + "/ext/bc/P", + uri + "/v1/bc/P", )} } @@ -40,7 +40,7 @@ func NewClient(uri string) *Client { // for proper bech32 address formatting func NewClientWithNetworkID(uri string, networkID uint32) *Client { return &Client{ - Requester: rpc.NewEndpointRequester(uri + "/ext/bc/P"), + Requester: rpc.NewEndpointRequester(uri + "/v1/bc/P"), networkID: networkID, } } diff --git a/vms/platformvm/service.md b/vms/platformvm/service.md index f9d858a51..e45bfd5e5 100644 --- a/vms/platformvm/service.md +++ b/vms/platformvm/service.md @@ -3,7 +3,7 @@ The P-Chain API allows clients to interact with the [P-Chain](https://build.lux. ## Endpoint ``` -/ext/bc/P +/v1/bc/P ``` ## Format @@ -56,7 +56,7 @@ curl -X POST --data '{ "params" :{ "addresses":["P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p"] } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -133,7 +133,7 @@ curl -X POST --data '{ "encoding": "hex" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -162,7 +162,7 @@ curl -X POST --data '{ "encoding": "json" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -266,7 +266,7 @@ curl -X POST --data '{ "encoding": "hex" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -295,7 +295,7 @@ curl -X POST --data '{ "encoding": "json" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -398,7 +398,7 @@ curl -X POST --data '{ "method": "platform.getBlockchains", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -490,7 +490,7 @@ curl -X POST --data '{ "blockchainID":"2NbS4dwGaf2p1MaXb65PrkZdXRwmSX4ZzGnUu7jm3aykgThuZE" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -530,7 +530,7 @@ curl -X POST --data '{ "netID": "11111111111111111111111111111111LpoYY" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -671,7 +671,7 @@ curl -X POST --data '{ "nodeIDs": ["NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD"] }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response (Primary Network):** @@ -793,7 +793,7 @@ curl -X POST --data '{ "method": "platform.getFeeConfig", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/bc/P ``` **Example Response:** @@ -836,7 +836,7 @@ curl -X POST --data '{ "method": "platform.getFeeState", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/bc/P ``` **Example Response:** @@ -875,7 +875,7 @@ curl -X POST --data '{ "method": "platform.getHeight", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -944,7 +944,7 @@ curl -X POST --data '{ "validationID": ["9FAftNgNBrzHUMMApsSyV6RcFiL9UmCbvsCu28xdLV2mQ7CMo"] }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -998,7 +998,7 @@ curl -X POST --data '{ "method": "platform.getProposedHeight", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/bc/P ``` **Example Response:** @@ -1040,7 +1040,7 @@ curl -X POST --data '{ "params": { "netID":"11111111111111111111111111111111LpoYY" }, -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1096,7 +1096,7 @@ curl -X POST --data '{ "txID": "2nmH8LithVbdjaXsxVQCQfXtzN9hBbmebrsaEYnLM9T32Uy2Y5" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1161,7 +1161,7 @@ curl -X POST --data '{ }, "id": 1 } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1210,7 +1210,7 @@ curl -X POST --data '{ "netID": "11111111111111111111111111111111LpoYY" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1275,7 +1275,7 @@ curl -X POST --data '{ "method": "platform.getNet", "params": {"netID":"Vz2ArUpigHt7fyE79uF3gAXvTPLJi2LGgZoMpgNPHowUZJxBb"}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/bc/P ``` **Example Response:** @@ -1340,7 +1340,7 @@ curl -X POST --data '{ "method": "platform.getNets", "params": {"ids":["hW8Ma7dLMA7o4xmJf3AXBbo17bXzE7xnThUd3ypM4VAWo1sNJ"]}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1383,7 +1383,7 @@ curl -X POST --data '{ "params": {}, "id": 1 } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1426,7 +1426,7 @@ curl -X POST --data '{ }, "id": 1 } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1455,7 +1455,7 @@ curl -X POST --data '{ }, "id": 1 } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/P ``` **Example Response:** @@ -1500,7 +1500,7 @@ curl -X POST --data '{ "encoding": "json" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1612,7 +1612,7 @@ curl -X POST --data '{ "txID":"TAG9Ns1sa723mZy1GSoGqWipK6Mvpaj7CAswVJGM6MkVJDF9Q" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1685,7 +1685,7 @@ curl -X POST --data '{ "limit":5, "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` This gives response: @@ -1729,7 +1729,7 @@ curl -X POST --data '{ }, "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` This gives response: @@ -1772,7 +1772,7 @@ curl -X POST --data '{ "sourceChain": "X", "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` This gives response: @@ -1825,7 +1825,7 @@ curl -X POST --data '{ "height":1 }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -1874,7 +1874,7 @@ curl -X POST --data '{ "method": "platform.getValidatorFeeConfig", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/bc/P ``` **Example Response:** @@ -1915,7 +1915,7 @@ curl -X POST --data '{ "method": "platform.getValidatorFeeState", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/bc/P ``` **Example Response:** @@ -1961,7 +1961,7 @@ curl -X POST --data '{ "encoding": "hex" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -2008,7 +2008,7 @@ curl -X POST --data '{ "params" :{ "size":2 } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -2053,7 +2053,7 @@ curl -X POST --data '{ "blockchainID": "KDYHHKjM4yTJTT8H8qPs5KXzE6gQH5TZrmP1qVr1P6qECj3XN" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** @@ -2095,7 +2095,7 @@ curl -X POST --data '{ "netID":"2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/P +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/P ``` **Example Response:** diff --git a/vms/platformvm/txs/bench/README.md b/vms/platformvm/txs/bench/README.md index 5a1db0773..9a44da100 100644 --- a/vms/platformvm/txs/bench/README.md +++ b/vms/platformvm/txs/bench/README.md @@ -74,7 +74,7 @@ ground-truth numbers, drop captured bytes into `testdata/`: ```bash POD=$(kubectl -n lux get pods -l app=luxd -o jsonpath='{.items[0].metadata.name}') -kubectl -n lux exec "$POD" -- curl -s http://localhost:9650/ext/bc/P \ +kubectl -n lux exec "$POD" -- curl -s http://localhost:9650/v1/bc/P \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"platform.getMempool"}' \ > /tmp/mempool.json diff --git a/vms/proposervm/API_EXAMPLE.md b/vms/proposervm/API_EXAMPLE.md index ede184d22..f8e0a5f53 100644 --- a/vms/proposervm/API_EXAMPLE.md +++ b/vms/proposervm/API_EXAMPLE.md @@ -7,7 +7,7 @@ The `GetProposedHeight` API endpoint returns the P-Chain height that would be pr ## Endpoint ``` -/ext/bc//proposervm +/v1/bc//proposervm ``` ## Method @@ -45,7 +45,7 @@ curl -X POST --data '{ "id" :1, "method" :"proposervm.getProposedHeight", "params" :{} -}' -H 'content-type:application/json;' http://127.0.0.1:9650/ext/bc/C/proposervm +}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/C/proposervm ``` ### Response diff --git a/vms/proposervm/service.go b/vms/proposervm/service.go index ec897cdb0..26863ed20 100644 --- a/vms/proposervm/service.go +++ b/vms/proposervm/service.go @@ -36,7 +36,7 @@ type GetProposedHeightReply struct { // "id" :1, // "method" :"proposervm.getProposedHeight", // "params" :{} -// }' -H 'content-type:application/json;' http://127.0.0.1:9650/ext/bc/C/rpc +// }' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/C/rpc func (s *Service) GetProposedHeight(r *http.Request, _ *GetProposedHeightArgs, reply *GetProposedHeightReply) error { ctx := r.Context() diff --git a/vms/proposervm/service.md b/vms/proposervm/service.md index 3a11d3af4..d9b12a360 100644 --- a/vms/proposervm/service.md +++ b/vms/proposervm/service.md @@ -5,7 +5,7 @@ The ProposerVM API allows clients to fetch information about a chain's Consensus ## Endpoint ```text -/ext/bc/{blockchainID}/proposervm +/v1/bc/{blockchainID}/proposervm ``` ## Format @@ -35,7 +35,7 @@ curl -X POST --data '{ "method": "proposervm.getProposedHeight", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P/proposervm +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/bc/P/proposervm ``` **Example Response:** @@ -73,7 +73,7 @@ curl -X POST --data '{ "method": "proposervm.getCurrentEpoch", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P/proposervm +}' -H 'content-type:application/json;' 127.0.0.1:9650/v1/bc/P/proposervm ``` **Example Response:** diff --git a/vms/xvm/service.md b/vms/xvm/service.md index 70cc1b254..cfcefe5cf 100644 --- a/vms/xvm/service.md +++ b/vms/xvm/service.md @@ -20,9 +20,9 @@ This API uses the `json 2.0` RPC format. For more information on making JSON RPC ## Endpoints -`/ext/bc/X` to interact with the X-Chain. +`/v1/bc/X` to interact with the X-Chain. -`/ext/bc/blockchainID` to interact with other XVM instances, where `blockchainID` is the ID of a +`/v1/bc/blockchainID` to interact with other XVM instances, where `blockchainID` is the ID of a blockchain running the XVM. ## Methods @@ -36,7 +36,7 @@ of that state. This call is made to the XVM’s static API endpoint: -`/ext/vm/xvm` +`/v1/vm/xvm` Note: addresses should not include a chain prefix (that is `X-`) in calls to the static API endpoint because these prefixes refer to a specific chain. @@ -169,7 +169,7 @@ curl -X POST --data '{ }, "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/vm/xvm +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/vm/xvm ``` **Example Response:** @@ -219,7 +219,7 @@ curl -X POST --data '{ "password": "myPassword" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -316,7 +316,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -404,7 +404,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -505,7 +505,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -582,7 +582,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -642,7 +642,7 @@ curl -X POST --data '{ "password":"myPassword", "address":"X-lux18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -713,7 +713,7 @@ curl -X POST --data '{ "assetID":"LUX", "pageSize":20 } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -759,7 +759,7 @@ curl -X POST --data '{ "params" :{ "address":"X-lux1c79e0dd0susp7dc8udq34jgk2yvve7hapvdyht" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -829,7 +829,7 @@ curl -X POST --data '{ "params" :{ "assetID" :"FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -878,7 +878,7 @@ curl -X POST --data '{ "address":"X-lux18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "assetID": "2pYGetDWyKdHxpFxh2LHeoLNCH6H5vxxCxHQtFnnFaYxLsqtHC" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -938,7 +938,7 @@ curl -X POST --data '{ "encoding": "hex" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -994,7 +994,7 @@ curl -X POST --data '{ "encoding": "hex" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1031,7 +1031,7 @@ curl -X POST --data '{ "method": "xvm.getHeight", "params": {}, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1074,7 +1074,7 @@ curl -X POST --data '{ "txID":"2oJCbb8pfdxEHAf9A8CdN4Afj9VSR3xzyzNkf8tDv7aM1sfNFL", "encoding": "json" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1208,7 +1208,7 @@ curl -X POST --data '{ "params" :{ "txID":"2QouvFWUbjuySRxeX5xMbNCuAaKWfbk5FeEa2JmoF85RKLk2dD" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1279,7 +1279,7 @@ curl -X POST --data '{ "limit":5, "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` This gives response: @@ -1323,7 +1323,7 @@ curl -X POST --data '{ }, "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` This gives response: @@ -1367,7 +1367,7 @@ curl -X POST --data '{ "sourceChain": "P", "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` This gives response: @@ -1435,7 +1435,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1493,7 +1493,7 @@ curl -X POST --data '{ "password":"myPassword", "privateKey":"PrivateKey-2w4XiXxPfQK4TypYqnohRL8DRNTz9cGiGmwQ1zmgEqD9c9KWLq" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1536,7 +1536,7 @@ curl -X POST --data '{ "tx":"0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730", "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1585,7 +1585,7 @@ curl -X POST --data '{ "password":"myPassword" }, "id": 1 -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1660,7 +1660,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1741,7 +1741,7 @@ curl -X POST --data '{ "username":"myUsername", "password":"myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1814,7 +1814,7 @@ curl -X POST --data '{ "username" : "userThatControlsAtLeast10000OfThisAsset", "password" : "myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1897,7 +1897,7 @@ curl -X POST --data '{ "username" : "username", "password" : "myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1967,7 +1967,7 @@ curl -X POST --data '{ "username" : "myUsername", "password" : "myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X ``` **Example Response:** @@ -1991,7 +1991,7 @@ the format of the signed transaction. Can only be `hex` when a value is provided This call is made to the wallet API endpoint: -`/ext/bc/X/wallet` +`/v1/bc/X/wallet` :::caution @@ -2021,7 +2021,7 @@ curl -X POST --data '{ "tx":"0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730", "encoding": "hex" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X/wallet +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X/wallet ``` **Example Response:** @@ -2047,7 +2047,7 @@ can use the modified UTXO set. This call is made to the wallet API endpoint: -`/ext/bc/X/wallet` +`/v1/bc/X/wallet` :::caution @@ -2098,7 +2098,7 @@ curl -X POST --data '{ "username" : "userThatControlsAtLeast10000OfThisAsset", "password" : "myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X/wallet +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X/wallet ``` **Example Response:** @@ -2125,7 +2125,7 @@ addresses and assume the TX will be accepted so that future calls can use the mo This call is made to the wallet API endpoint: -`/ext/bc/X/wallet` +`/v1/bc/X/wallet` :::caution @@ -2185,7 +2185,7 @@ curl -X POST --data '{ "username" : "username", "password" : "myPassword" } -}' -H 'content-type:application/json;' 127.0.0.1:9630/ext/bc/X/wallet +}' -H 'content-type:application/json;' 127.0.0.1:9630/v1/bc/X/wallet ``` **Example Response:** @@ -2207,7 +2207,7 @@ Listen for transactions on a specified address. This call is made to the events API endpoint: -`/ext/bc/X/events` +`/v1/bc/X/events` :::caution @@ -2240,7 +2240,7 @@ func main() { } httpHeader := http.Header{} - conn, _, err := dialer.Dial("ws://localhost:9630/ext/bc/X/events", httpHeader) + conn, _, err := dialer.Dial("ws://localhost:9630/v1/bc/X/events", httpHeader) if err != nil { panic(err) } diff --git a/vms/xvm/static_client.go b/vms/xvm/static_client.go index 34692ee41..749f89c65 100644 --- a/vms/xvm/static_client.go +++ b/vms/xvm/static_client.go @@ -25,7 +25,7 @@ type staticClient struct { // NewClient returns an XVM client for interacting with the xvm static api func NewStaticClient(uri string) StaticClient { return &staticClient{requester: rpc.NewEndpointRequester( - uri + "/ext/vm/xvm", + uri + "/v1/vm/xvm", )} } diff --git a/wallet/network/primary/api.go b/wallet/network/primary/api.go index 2f091d123..528714324 100644 --- a/wallet/network/primary/api.go +++ b/wallet/network/primary/api.go @@ -70,7 +70,7 @@ type XClient struct { func NewXClient(uri, chainAlias string) *XClient { return &XClient{ requester: rpc.NewEndpointRequester( - fmt.Sprintf("%s/ext/bc/%s", uri, chainAlias), + fmt.Sprintf("%s/v1/bc/%s", uri, chainAlias), ), } } diff --git a/wallet/network/primary/examples/heartbeat-tx/main.go b/wallet/network/primary/examples/heartbeat-tx/main.go index 6061ec647..93c91e5b9 100644 --- a/wallet/network/primary/examples/heartbeat-tx/main.go +++ b/wallet/network/primary/examples/heartbeat-tx/main.go @@ -126,7 +126,7 @@ func sendSignedTx(ctx context.Context, client *ethclient.Client, chainID *big.In // it first sends `seedAmount` from seedKey to the heartbeat key and waits // for that to confirm before issuing the heartbeat tx. func heartbeatChain(ctx context.Context, chain, rpcBase string, key, seedKey *ecdsa.PrivateKey, seedAmount, seedFloor *big.Int, waitFor time.Duration) (prev, next uint64, txHash common.Hash, gasUsed uint64, err error) { - url := fmt.Sprintf("%s/ext/bc/%s/rpc", strings.TrimRight(rpcBase, "/"), chain) + url := fmt.Sprintf("%s/v1/bc/%s/rpc", strings.TrimRight(rpcBase, "/"), chain) client, err := ethclient.DialContext(ctx, url) if err != nil { return 0, 0, common.Hash{}, 0, fmt.Errorf("dial %s: %w", url, err) @@ -190,7 +190,7 @@ func main() { seedAmountWei string seedFloorWei string ) - flag.StringVar(&chains, "chains", "C,hanzo,zoo,pars,spc", "comma-separated chain aliases under /ext/bc//rpc") + flag.StringVar(&chains, "chains", "C,hanzo,zoo,pars,spc", "comma-separated chain aliases under /v1/bc//rpc") flag.StringVar(&rpcBase, "rpc-base", "", "RPC base URL, e.g. https://api.lux-test.network") flag.StringVar(&mnemonicEnv, "mnemonic-env", "LUX_MNEMONIC", "env var holding the BIP39 mnemonic") flag.UintVar(&bipIdx, "bip44-idx", 10, "BIP44 child index at m/44'/60'/0'/0/")