Add network command live RPC integration with multi-node probing and blockchain.env configuration
- Add read_blockchain_env helper to parse /etc/aitbc/blockchain.env configuration - Add normalize_rpc_url helper to parse and normalize RPC endpoint URLs - Add probe_rpc_node to query /health and /rpc/head endpoints with latency tracking - Add get_network_snapshot to probe local node and p2p_peers from config - Update network status to show real connected node count and sync status - Update network peers to show actual peer endpoints and connection
This commit is contained in:
@@ -54,6 +54,26 @@ class TestBlockchainCommand:
|
||||
assert "--rpc-url" in result.stdout
|
||||
|
||||
|
||||
class TestNetworkCommand:
|
||||
"""Test network subcommands and backward-compatible argument forms."""
|
||||
|
||||
def test_network_ping_positional_node(self):
|
||||
result = run_cli("network", "ping", "localhost")
|
||||
assert result.returncode == 0
|
||||
assert "Ping: Node localhost" in result.stdout
|
||||
|
||||
def test_network_ping_flag_alias(self):
|
||||
result = run_cli("network", "ping", "--node", "localhost")
|
||||
assert result.returncode == 0
|
||||
assert "Ping: Node localhost" in result.stdout
|
||||
|
||||
def test_network_propagate_flag_alias(self):
|
||||
result = run_cli("network", "propagate", "--data", "smoke-test")
|
||||
assert result.returncode == 0
|
||||
assert "Data propagation: Complete" in result.stdout
|
||||
assert "smoke-test" in result.stdout
|
||||
|
||||
|
||||
class TestMarketplaceCommand:
|
||||
"""Test marketplace grouping and legacy rewrite."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user