mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
chain letters are lowercase
The primary-network chains answer to either case; one spelling beats two. /v1/chain/c/rpc, /v1/chain/p, /v1/chain/x across the estate. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -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/chain/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/chain/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/chain/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/chain/X"
|
||||
echo " C-Chain: http://localhost:9650/v1/chain/C/rpc"
|
||||
echo " P-Chain: http://localhost:9650/v1/chain/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/chain/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/chain/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
@@ -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/chain/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/chain/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/chain/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/chain/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/chain/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/chain/X"
|
||||
echo " P-Chain: http://localhost:9650/v1/chain/P"
|
||||
echo " C-Chain: http://localhost:9650/v1/chain/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/chain/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/chain/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"
|
||||
|
||||
Reference in New Issue
Block a user