26 lines
985 B
Bash
Executable File
26 lines
985 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Test script for stats query functionality
|
|
# Uses the admin private key generated during startup
|
|
|
|
ADMIN_PRIVKEY="5f43e99864c3b2a3d10fa6aa25d3042936017e929c6f82d2b4c974af4502af21"
|
|
ADMIN_PUBKEY="8f0306d7d4e0ddadf43caeb72791e1a2c6185eec2301f56655f666adab153226"
|
|
RELAY_PUBKEY="df5248728b4dfe4fa7cf760b2efa58fcd284111e7df2b9ddef09a11f17ffa0d0"
|
|
|
|
echo "Testing stats query with NIP-17 encryption..."
|
|
echo "Admin pubkey: $ADMIN_PUBKEY"
|
|
echo "Relay pubkey: $RELAY_PUBKEY"
|
|
|
|
# Create the command array for stats_query
|
|
COMMAND='["stats_query"]'
|
|
|
|
echo "Command to encrypt: $COMMAND"
|
|
|
|
# For now, let's just check if the relay is running and can accept connections
|
|
echo "Checking if relay is running..."
|
|
curl -s -H "Accept: application/nostr+json" http://localhost:8888 | head -20
|
|
|
|
echo -e "\nTesting WebSocket connection..."
|
|
timeout 5 wscat -c ws://localhost:8888 <<< '{"type": "REQ", "id": "test", "filters": []}' || echo "WebSocket test completed"
|
|
|
|
echo "Stats query test completed." |