8000 GitHub - bvcxza/sonos: C++ library and command line tool for Nostr
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

bvcxza/sonos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SONOS

A C++ library and a command line tool for Nostr. It follows NIP-01 spec.

Prerequisite to build

This project uses miniforge as dependency manager. Follow instructions to install it.

For users

Build and Install

See Prerequisite before build.

git clone --recurse-submodules https://github.com/bvcxza/sonos.git
cd sonos
mamba env update -n $(basename $PWD) -f conda.yml
. env.sh
bld_secp256k1 && cnf -DCMAKE_INSTALL_PREFIX=~/.local && bld install

Run

Just enter sonos to show usage.

Commands:

convert:

	Convert bech32 addresses (npub1 and nsec1) to/from hexadecimal string.
	Usage: sonos convert <bech32 address>
	Usage: sonos convert <hex address> <hrp:npub or nsec>

event:

	Create and send a event to nostr relays.
	Usage: echo "content" | sonos event <nsec> <kind> <tags> <relay_addresses ...>

keypair:

	Create or show keypair from hexadecimal/bech32 secret string
	Usage: sonos keypair [secret]

relays:

	Show user's relays from hexadecimal/bech32 public key.
	Usage: sonos relays <read|write|all> <public_key> <relay_addresses ...>

req:

	Send a REQ message to nostr relays and execute a external command for each received event.
	The program called by command receives the event JSON file path as the first parameter ($1 in bash).
	Usage: sonos req <filters> <command> <relay_addresses ...>

user:

	Show user metadata from hexadecimal/bech32 public key.
	Usage: sonos user <public_key> <relay_addresses ...>

Send a REQ and handle events with external program

Example: Call a bash script for each event with tag "Monero".

sonos req '{"kinds":[1],"#t":["Monero"],"limit":0}' ./samples/script.sh nostr.bitcoiner.social:443

For developers

Build and Test

See Prerequisite before build.

git clone https://github.com/bvcxza/sonos.git
cd sonos
git submodule update --init --force --recursive
mamba env update -n $(basename $PWD) -f conda.yml
. env.sh
bld_secp256k1 && cnf && bld && tst

Run

Just enter run to show usage.

Donations

Please consider donating to support the development of this project.

Monero (XMR): 8AADjm5nz4GXXn7Tf6FNfwCaAjAdkvdUs5KgRwBGUj2NHwWqkxbfLzYPom3mL6a1cN1aypyfvyzaxHAM8aARbafFKkABT6Z

About

C++ library and command line tool for Nostr

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published
0