Files
universe/docker/report-all-chains.sh
zeekayandHanzo AI 15131f6af4
CI/CD / render (push) Waiting to run
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 AI <[email protected]>
2026-09-08 15:23:20 -07:00

132 lines
5.0 KiB
Bash
Executable File

#!/bin/bash
# Report on all chains: Mainnet, Testnet, and L2s
# Shows chain ID, token, status, and luxdefi.eth balance
echo "========================================"
echo "🔍 LUX ECOSYSTEM CHAIN STATUS REPORT"
echo "========================================"
echo ""
# luxdefi.eth address
LUXDEFI="0x9011E888251AB053B7bD1cdB598Db4f9DEd94714"
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
# Function to check chain
check_chain() {
local name=$1
local port=$2
local expected_id=$3
local token=$4
local type=$5
echo -e "${BLUE}━━━ $name ($type) ━━━${NC}"
# Try to get chain ID
CHAIN_ID=$(curl -s -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \
-H 'content-type:application/json' http://localhost:$port/v1/chain/c/rpc 2>/dev/null | jq -r .result 2>/dev/null)
if [ ! -z "$CHAIN_ID" ] && [ "$CHAIN_ID" != "null" ]; then
CHAIN_DEC=$(printf "%d" $CHAIN_ID 2>/dev/null)
echo -e " Status: ${GREEN}✓ RUNNING${NC}"
echo " Chain ID: $CHAIN_ID ($CHAIN_DEC)"
echo " Expected: $expected_id"
echo " Token: $token"
echo " RPC: http://localhost:$port/v1/chain/c/rpc"
# Check luxdefi.eth balance
BALANCE=$(curl -s -X POST --data "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBalance\",\"params\":[\"$LUXDEFI\",\"latest\"],\"id\":1}" \
-H 'content-type:application/json' http://localhost:$port/v1/chain/c/rpc 2>/dev/null | jq -r .result 2>/dev/null)
if [ ! -z "$BALANCE" ] && [ "$BALANCE" != "null" ]; then
# Convert hex to decimal (roughly)
if [ "$BALANCE" = "0x33b2e3c9fd0803ce8000000" ]; then
echo -e " luxdefi.eth: ${GREEN}1,000,000,000 $token${NC}"
elif [ "$BALANCE" = "0x0" ]; then
echo -e " luxdefi.eth: ${YELLOW}0 $token${NC}"
else
echo " luxdefi.eth: $BALANCE"
fi
else
echo -e " luxdefi.eth: ${YELLOW}Cannot query${NC}"
fi
# Check block number
BLOCK=$(curl -s -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
-H 'content-type:application/json' http://localhost:$port/v1/chain/c/rpc 2>/dev/null | jq -r .result 2>/dev/null)
if [ ! -z "$BLOCK" ] && [ "$BLOCK" != "null" ]; then
BLOCK_DEC=$(printf "%d" $BLOCK 2>/dev/null)
echo " Block Height: $BLOCK_DEC"
fi
else
echo -e " Status: ${RED}✗ NOT RUNNING${NC}"
echo " Port: $port"
fi
echo ""
}
# Check for migrated data
echo -e "${YELLOW}Checking for migrated blockchain data...${NC}"
if [ -d "/home/z/.luxd/chainData/C/db/badgerdb/ethdb" ]; then
echo -e "${GREEN}✓ Found migrated data with 1,082,780 blocks${NC}"
echo " Contains 2 trillion LUX for luxdefi.eth"
else
echo -e "${YELLOW}⚠ No migrated data found${NC}"
fi
echo ""
# MAINNET CHAINS
echo -e "${BLUE}══════════════════════════════${NC}"
echo -e "${BLUE} MAINNET CHAINS ${NC}"
echo -e "${BLUE}══════════════════════════════${NC}"
echo ""
check_chain "LUX Network" 9650 96369 "LUX" "Primary"
check_chain "LUX Network (Alt)" 9630 96369 "LUX" "Primary"
check_chain "Hanzo AI" 9660 36963 "AI" "App Chain"
check_chain "Zoo Network" 9670 200200 "ZOO" "App Chain"
check_chain "SPC Network" 9680 36911 "SPC" "App Chain"
# TESTNET CHAINS
echo -e "${BLUE}══════════════════════════════${NC}"
echo -e "${BLUE} TESTNET CHAINS ${NC}"
echo -e "${BLUE}══════════════════════════════${NC}"
echo ""
check_chain "LUX Testnet" 9750 96368 "tLUX" "Primary"
check_chain "Hanzo AI Test" 9760 36962 "tAI" "App Chain"
check_chain "Zoo Testnet" 9770 200201 "tZOO" "App Chain"
check_chain "SPC Testnet" 9780 36912 "tSPC" "App Chain"
# Summary
echo -e "${BLUE}══════════════════════════════${NC}"
echo -e "${BLUE} SUMMARY ${NC}"
echo -e "${BLUE}══════════════════════════════${NC}"
echo ""
echo -e "${YELLOW}Key Information:${NC}"
echo "• luxdefi.eth address: $LUXDEFI"
echo "• Test account (deprecated): 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC"
echo ""
echo -e "${YELLOW}Architecture:${NC}"
echo "• 1 Primary Network (LUX)"
echo "• 5 Validator Nodes per network"
echo "• 3 EVM App Chains (Hanzo, Zoo, SPC)"
echo "• All app chains run on top of LUX mainnet"
echo ""
echo -e "${YELLOW}Token Allocations:${NC}"
echo "• 1B AI tokens to luxdefi.eth on Hanzo"
echo "• 1B ZOO tokens to luxdefi.eth on Zoo"
echo "• 1B SPC tokens to luxdefi.eth on SPC"
echo "• Historic data migrated from PebbleDB for LUX/ZOO/SPC"
echo ""
echo -e "${GREEN}Report Complete!${NC}"