Skip to content

go nostr client implementing permessage-deflate websocket compression

License

Notifications You must be signed in to change notification settings

barkyq/gnost-deflate-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gnost-deflate-client

go nostr client implementing permessage-deflate websocket compression. Downloads the results of a REQ query, saving the results in jsonl format, and logs to stderr some stats related to the compression.

Building

In cloned repository run go build . to build the executable gnost-deflate-client.

Running

Accepts an array of filter json objects on stdin, and saves the returned events to a .jsonl file:

echo '[{
"authors":["3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
"since":1676600000
}]' | ./gnost-deflate-client --port 443 --scheme wss --host nos.lol --output events.jsonl

Keep connection alive

Use the --keepalive N option to keep the connection alive, sending a PING frame to the relay every N seconds. New returned events will be appended to the --output file. Enter C-c to cleanly shutdown the listener.

Compatibility with relays

Set the output to - in order to print the returned events to stdout. This can be composed with the import command for a local instance of gnost-relay or strfry

echo '[{"since":1676863922,"kinds":[1]}]' |\
gnost-deflate-client --port 443 --scheme wss --host nos.lol --keepalive 30 --output - |\
DATABASE_URL=postgres://x gnost-relay --import
echo '[{
"authors":["3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
"since":1676600000
}]' | ./gnost-deflate-client --port 443 --scheme wss --host nos.lol --output - | strfry import

Note that strfry import is not compatible with --keepalive since strfry expects an EOF from stdin.

About

go nostr client implementing permessage-deflate websocket compression

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages