Add network command live RPC integration with multi-node probing and blockchain.env configuration
Some checks failed
Security Scanning / security-scan (push) Has been cancelled
CLI Tests / test-cli (push) Has been cancelled

- 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:
aitbc
2026-04-14 13:31:10 +02:00
parent ffd05769df
commit dab867499c
3 changed files with 178 additions and 18 deletions

View File

@@ -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."""