Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified node/rustchain_p2p_gossip.py
100644 → 100755
Empty file.
36 changes: 36 additions & 0 deletions tools/node_dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import time
import requests
import os

def get_node_stats():
# Attempt to query the local Rustchain RPC
try:
response = requests.post("http://localhost:3000/rpc",
json={"method": "get_status", "params": []},
timeout=2)
return response.json()
except:
return None

def print_dashboard():
os.system('clear')
print("="*40)
print(" RUSTCHAIN NODE HEALTH DASHBOARD ")
print("="*40)
stats = get_node_stats()

if stats:
print(f"Status: ONLINE")
print(f"Peers: {stats.get('peers', '0')}")
print(f"Block: {stats.get('height', 'Unknown')}")
print(f"Hashrate: {stats.get('hashrate', '0')} H/s")
else:
print(f"Status: OFFLINE (Node not responding on port 3000)")

print("-" * 40)
print("Press Ctrl+C to exit")

if __name__ == "__main__":
while True:
print_dashboard()
time.sleep(5)