mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-10-05 19:16:07 +02:00
Added useful bash scripts
This commit is contained in:
15
scripts/configfile.cfg
Normal file
15
scripts/configfile.cfg
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#nostr_servers=( "wss://relay.nostr.info" "wss://nostr-relay.wlvs.space" "wss://nostr-pub.wellorder.net" "wss://relay.damus.io" "wss://nostr.delo.software" "wss://nostr-pub.semisol.dev" "wss://nostr-relay-dev.wlvs.space")
|
||||||
|
|
||||||
|
nostr_servers=(
|
||||||
|
"wss://relay.nostr.info"
|
||||||
|
"wss://nostr.ono.re"
|
||||||
|
"wss://nostr-relay.wlvs.space"
|
||||||
|
"wss://relay.damus.io"
|
||||||
|
"wss://nostr-relay-dev.wlvs.space"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# reference
|
||||||
|
# https://nostr-registry.netlify.app/
|
||||||
|
# nostr.info
|
11
scripts/send_request.sh
Normal file
11
scripts/send_request.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./configfile.cfg
|
||||||
|
|
||||||
|
for server in ${nostr_servers[@]};
|
||||||
|
do
|
||||||
|
>&2 echo -e "\n\n------------Sending $1 to $server---------------------------\n"
|
||||||
|
>&2 echo "echo $1 | websocat $server " ;
|
||||||
|
echo "$1" | websocat -B 300000 $server
|
||||||
|
|
||||||
|
done
|
17
scripts/test_servers.sh
Normal file
17
scripts/test_servers.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./configfile.cfg
|
||||||
|
|
||||||
|
limit=200
|
||||||
|
numHours=6
|
||||||
|
|
||||||
|
echo -e "Requesting all evetns in last $numHours hours with a limit of $limit"
|
||||||
|
for server in ${nostr_servers[@]};
|
||||||
|
do
|
||||||
|
echo -e "\n\n------------Testing $server---------------------------\n"
|
||||||
|
sinceSeconds=`date -d "-$numHours hour" +%s` ;
|
||||||
|
req="[\"REQ\",\"l\",{\"since\":$sinceSeconds,\"limit\":$limit}]";
|
||||||
|
echo "echo $req | websocat $server | wc " ;
|
||||||
|
echo "$req" | websocat -B 300000 $server | wc
|
||||||
|
|
||||||
|
done
|
Reference in New Issue
Block a user