chain routes: /v1/bc -> /v1/chain

luxd serves chain routes under /v1/chain, and the node, cli and sdk releases
already ship it. The deployed gateways still answer the old prefix, so remote
reads break until they are redeployed; the estate moves together rather than
sitting half converted.

Lines that record an observation - a probe, a status code, a past release -
keep the prefix they were written against, as do URLs on hosts that are not
ours. Avalanche endpoints move to /ext/bc, which is the path that host serves.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-09-01 08:21:06 -07:00
co-authored by Hanzo Dev
parent f56ed0a9c5
commit 5a808d27f7
11 changed files with 40 additions and 40 deletions
+8 -8
View File
@@ -158,7 +158,7 @@ if curl -s -X POST --data '{
"address":"X-lux18jma8ppw3nhx5r4ap8clazz0dps7rv5u6wdp",
"assetID":"LUX"
}
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/X 2>/dev/null | grep -q "balance"; then
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/chain/X 2>/dev/null | grep -q "balance"; then
echo -e "${GREEN}✅ Working${NC}"
else
echo -e "${RED}❌ Failed${NC}"
@@ -171,7 +171,7 @@ if curl -s -X POST --data '{
"method":"eth_chainId",
"params":[],
"id":1
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/C/rpc 2>/dev/null | grep -q "result"; then
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/chain/C/rpc 2>/dev/null | grep -q "result"; then
echo -e "${GREEN}✅ Working${NC}"
else
echo -e "${RED}❌ Failed${NC}"
@@ -184,7 +184,7 @@ BLOCK_HEIGHT=$(curl -s -X POST --data '{
"method":"eth_blockNumber",
"params":[],
"id":1
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/C/rpc 2>/dev/null | grep -o '"result":"[^"]*"' | sed 's/"result":"//;s/"//')
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/chain/C/rpc 2>/dev/null | grep -o '"result":"[^"]*"' | sed 's/"result":"//;s/"//')
if [ ! -z "$BLOCK_HEIGHT" ]; then
echo -e "${GREEN}✅ Current block: $BLOCK_HEIGHT${NC}"
@@ -199,12 +199,12 @@ echo ""
echo "RPC Endpoints:"
echo " Info API: http://localhost:9650/v1/info"
echo " Health: http://localhost:9650/v1/health"
echo " X-Chain: http://localhost:9650/v1/bc/X"
echo " C-Chain: http://localhost:9650/v1/bc/C/rpc"
echo " P-Chain: http://localhost:9650/v1/bc/P"
echo " X-Chain: http://localhost:9650/v1/chain/X"
echo " C-Chain: http://localhost:9650/v1/chain/C/rpc"
echo " P-Chain: http://localhost:9650/v1/chain/P"
echo ""
echo "WebSocket:"
echo " C-Chain WS: ws://localhost:9650/v1/bc/C/ws"
echo " C-Chain WS: ws://localhost:9650/v1/chain/C/ws"
echo ""
echo "Node PID: $NODE_PID"
echo "To stop: kill $NODE_PID"
@@ -220,7 +220,7 @@ while true; do
"method":"eth_blockNumber",
"params":[],
"id":1
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/C/rpc 2>/dev/null | grep -o '"result":"[^"]*"' | sed 's/"result":"//;s/"//')
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/chain/C/rpc 2>/dev/null | grep -o '"result":"[^"]*"' | sed 's/"result":"//;s/"//')
if [ ! -z "$BLOCK" ]; then
BLOCK_DEC=$((16#${BLOCK#0x}))
+10 -10
View File
@@ -136,17 +136,17 @@ test_endpoint "2. Keystore API" \
# Test X-Chain (AVM - Asset Virtual Machine)
test_endpoint "3. X-Chain API" \
"http://127.0.0.1:9650/v1/bc/X" \
"http://127.0.0.1:9650/v1/chain/X" \
'{"jsonrpc":"2.0","id":1,"method":"avm.getAssetDescription","params":{"assetID":"LUX"}}'
# Test P-Chain (Platform Chain)
test_endpoint "4. P-Chain API" \
"http://127.0.0.1:9650/v1/bc/P" \
"http://127.0.0.1:9650/v1/chain/P" \
'{"jsonrpc":"2.0","id":1,"method":"platform.getHeight"}'
# Test C-Chain (Contract Chain - EVM)
test_endpoint "5. C-Chain API" \
"http://127.0.0.1:9650/v1/bc/C/rpc" \
"http://127.0.0.1:9650/v1/chain/C/rpc" \
'{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
# Get blockchain info
@@ -172,7 +172,7 @@ curl -s -X POST --data '{
"jsonrpc":"2.0",
"id":1,
"method":"avm.getHeight"
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/X 2>/dev/null | grep -o '"height":[0-9]*' || echo "Height: 0"
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/chain/X 2>/dev/null | grep -o '"height":[0-9]*' || echo "Height: 0"
# Create test wallet
echo ""
@@ -199,7 +199,7 @@ X_ADDR=$(curl -s -X POST --data '{
"username":"dexuser",
"password":"dexpass123"
}
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/X 2>/dev/null | grep -o '"address":"[^"]*"' | cut -d'"' -f4)
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/chain/X 2>/dev/null | grep -o '"address":"[^"]*"' | cut -d'"' -f4)
if [ ! -z "$X_ADDR" ]; then
echo -e "${GREEN}✅ X-Chain Address: $X_ADDR${NC}"
@@ -212,9 +212,9 @@ echo ""
echo "RPC Endpoints:"
echo " Info API: http://localhost:9650/v1/info"
echo " Health: http://localhost:9650/v1/health"
echo " X-Chain: http://localhost:9650/v1/bc/X"
echo " P-Chain: http://localhost:9650/v1/bc/P"
echo " C-Chain: http://localhost:9650/v1/bc/C/rpc"
echo " X-Chain: http://localhost:9650/v1/chain/X"
echo " P-Chain: http://localhost:9650/v1/chain/P"
echo " C-Chain: http://localhost:9650/v1/chain/C/rpc"
echo ""
echo "Node PID: $NODE_PID"
echo "Logs: tail -f $DATA_DIR/node.log"
@@ -231,7 +231,7 @@ while true; do
"jsonrpc":"2.0",
"id":1,
"method":"avm.getHeight"
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/X 2>/dev/null | grep -o '"height":[0-9]*' | cut -d':' -f2)
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/chain/X 2>/dev/null | grep -o '"height":[0-9]*' | cut -d':' -f2)
if [ ! -z "$HEIGHT" ]; then
echo "X-Chain Height: $HEIGHT at $(date '+%H:%M:%S')"
@@ -242,7 +242,7 @@ while true; do
"jsonrpc":"2.0",
"id":1,
"method":"platform.getHeight"
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/bc/P 2>/dev/null | grep -o '"height":[0-9]*' | cut -d':' -f2)
}' -H 'content-type:application/json;' http://127.0.0.1:9650/v1/chain/P 2>/dev/null | grep -o '"height":[0-9]*' | cut -d':' -f2)
if [ ! -z "$P_HEIGHT" ]; then
echo "P-Chain Height: $P_HEIGHT"