Skip to content

Commit f4c37e0

Browse files
committed
fix: remove hardcoded mock indicators from dashboard
- Replace hardcoded TPS with dynamic status indicator - Change Mock indicator to Connecting when blockchain not yet connected - Add RPC test script for debugging
1 parent 8f4ee15 commit f4c37e0

3 files changed

Lines changed: 18 additions & 13 deletions

File tree

apps/hub/src/components/dashboard/OnChainFeedWidget.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@ export function OnChainFeedWidget() {
185185
</div>
186186
<div className="h-6 w-px bg-white/10" />
187187
<div className="text-center">
188-
<div className="text-xs text-gray-400">TPS</div>
189-
<div className="font-mono text-neon-green text-sm">~25</div>
188+
<div className="text-xs text-gray-400">Status</div>
189+
<div className="font-mono text-neon-green text-sm">
190+
{blockHeight ? 'Live' : 'Connecting...'}
191+
</div>
190192
</div>
191193
</div>
192194

apps/hub/src/components/dashboard/WalletWidget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ export function WalletWidget() {
9292
<div className="flex items-center justify-between mb-4">
9393
<h3 className="text-lg font-grunge text-neon-cyan">💎 Wallet</h3>
9494
<div className="flex items-center gap-2">
95-
<span className={`w-2 h-2 rounded-full ${isConnected ? 'bg-green-400' : 'bg-yellow-400'}`} />
95+
<span className={`w-2 h-2 rounded-full ${isConnected ? 'bg-green-400 animate-pulse' : 'bg-yellow-400'}`} />
9696
<span className="text-xs text-gray-500">
97-
{isConnected ? 'Live' : 'Mock'}
97+
{isConnected ? 'Live' : 'Connecting...'}
9898
</span>
9999
</div>
100100
</div>

scripts/test-rpc.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
#!/bin/bash
2-
# Test RPC endpoint on the server
2+
# Test RPC endpoint
33

4-
# Create proper JSON file
5-
cat > /tmp/rpc-test.json << 'ENDJSON'
6-
{"jsonrpc":"2.0","method":"chain_getHealth","params":[],"id":1}
7-
ENDJSON
4+
# Create a valid JSON-RPC request
5+
cat > /tmp/rpc_test.json << 'EOF'
6+
{"jsonrpc":"2.0","id":1,"method":"chain_getHealth","params":[]}
7+
EOF
88

9-
echo "Testing JSON content:"
10-
cat /tmp/rpc-test.json
9+
echo "Request body:"
10+
cat /tmp/rpc_test.json
1111
echo ""
12-
echo "Making RPC request..."
13-
curl -s -X POST -H 'Content-Type: application/json' -d @/tmp/rpc-test.json http://localhost:9944
12+
13+
echo "Testing RPC..."
14+
curl -s http://localhost:9944 -X POST -H "Content-Type: application/json" -d @/tmp/rpc_test.json
15+
1416
echo ""
17+
echo "Done."

0 commit comments

Comments
 (0)