โฉ– powrelay.xyz

1 thousand hashes per byte
here is implementation of nostr data stream: // r="wss://nostr.data.haus" function send(){ key=`nostril --kind 1 2>&1 | grep -Pom1 "\S{64}"` eid="" messages=("this" "is" "a" "simple" "example" "of" "recursive" "data" "stream") for i in {8..0} do event=`nostril --envelope --sec $key $([ ${#eid} -gt 0 ] && echo "-e $eid") --kind 3434 --content "${messages[$i]}"` eid=`echo "$event" | jq -r .[1].id` echo "$event" | websocat -n1 "$r" done echo "event id for streaming: $eid" } function download(){ [ ${#1} -ne 64 ] && { echo "event id required" return } eid=$1 while true do event=`nostril-query -i $eid | websocat -n1 $r` echo "received packet: "`echo "$event" | jq -r .[2].content` eid=`echo "$event" | jq -r '.[2].tags[]|select(.[0]=="e")[1]'` [ ${#eid} -eq 0 ] && break done } [ "$1" == "send" ] && { send; exit; } [ "$1" == "dl" ] && { download "$2"; exit; } echo "Usage: " echo "./recursion.sh send" echo "./recursion.sh dl <id>" // output: ./recursion.sh send ["OK","71804acbd113cbc92db3dfa61ae4837d6b5a7d1f50367f4a01193145d25eeba3",true,""] ["OK","f0f69313a91eefd2f667131004944dcb9b15fa72ae1ff1d5f15ffd947ce92ebb",true,""] ["OK","0bcbc9033a1010a102af8d1a2c002429458ba1737aed70abeb191c562209f3db",true,""] ["OK","3b1f5e3f52a4850c5e5eb08f359614614ad95a9d9cf47747883d9358f0b16eb4",true,""] ["OK","03f5a1aab60ff2aeaac8ed71a78bb4032ff5c893422bb43b5c94da3a21213a8c",true,""] ["OK","5c5200cba9c0deed8a2a2b3ca7f2845cf6aee98b41dc1a0f9c76371be87badfd",true,""] ["OK","aa04b39e54915d74c1439c098f9b9c30122faf1a0947fafe12e7df799096bdfb",true,""] ["OK","ccb2564ae69cd640b2269f840d7868a004db2b1eac42db634f1434d15b199108",true,""] ["OK","aad5b4135a42858cba6fdd31118d0f5e5781f2aba571ce90a429482d656a47d7",true,""] event id for streaming: aad5b4135a42858cba6fdd31118d0f5e5781f2aba571ce90a429482d656a47d7 ./recursion.sh dl aad5b4135a42858cba6fdd31118d0f5e5781f2aba571ce90a429482d656a47d7 received packet: this received packet: is received packet: a received packet: simple received packet: example received packet: of received packet: recursive received packet: data received packet: stream // in real scenario, each word can be replaced with up to 50 kB base64 data.
Created at:
Sun Mar 9 02:12:59 UTC 2025
Kind:
1 Text note
Tags:
nonce 30367 18
1