Vendor lock-free stateless alternative to blastr with additional features:
- spam filtering (spam.nostr.band and azzamo.net)
- events filtering
- kind
- author/mention
- PoW
- gossip
- tor/onion relays
- minimizes the risk of being rate-limited by the relay
- it checks whether event is already published on a certain relay
- relays ignore list
cargo install --locked broadcastrcargo install --locked --force --git https://github.com/codonaft/broadcastrbroadcastr --listen ws://localhost:8080 --relays https://codonaft.com/relays.json
💡 Usage 👁️
Usage: broadcastr --listen <listen> --relays <relays> [--blocked-relays <blocked-relays>] [--tor-proxy <tor-proxy>] [--proxy <proxy>] [--min-pow <min-pow>] [--allowed-pubkeys <allowed-pubkeys>] [--disable-mentions] [--max-events-by-author-per-min <max-events-by-author-per-min>] [--max-events-by-ip-per-min <max-events-by-ip-per-min>] [--allowed-kinds <allowed-kinds>] [--disable-gossip] [--disable-spam-nostr-band] [--disable-azzamo] [--update-interval <update-interval>] [--max-backoff-interval <max-backoff-interval>] [--connection-timeout <connection-timeout>] [--request-timeout <request-timeout>] [--log-level <log-level>] [--tcp-backlog <tcp-backlog>] [--max-msg-size <max-msg-size>] [--max-frame-size <max-frame-size>]
Broadcast Nostr events to other relays
Options:
--listen the listener ws URI (e.g. "ws://localhost:8080")
--relays relays or relay-list URIs (comma-separated, e.g.
"https://codonaft.com/relays.json,file:///path/to/relays-in-array.json,ws://1.2.3.4:5678")
--blocked-relays same, but for ignored relays; put public URL to your
broadcastr here to avoid loops
--tor-proxy connect to tor onion relays using socks5 proxy (e.g.
"127.0.0.1:9050")
--proxy connect to all relays using socks5 proxy
--min-pow pow difficulty limit (NIP-13)
--allowed-pubkeys authors or mentioned authors (comma-separated
hex/bech32/NIP-21 allow-list)
--disable-mentions
disallow mentions (of the allowed authors) by others
(default is false)
--max-events-by-author-per-min
limit events by author (default is 5)
--max-events-by-ip-per-min
limit events by IP (default is 50)
--allowed-kinds limit event kinds with (comma-separated allow-list, e.g
"0,1,3,5,6,7,4550,34550")
--disable-gossip don't discover additional relays from user profiles
--disable-spam-nostr-band
don't use spam.nostr.band for spam filtering
--disable-azzamo don't use azzamo.net for spam filtering
--update-interval relays and spam-lists update interval (default is 15m)
--max-backoff-interval
max update backoff interval (default is 5m)
--connection-timeout
connection timeout (default is 15s)
--request-timeout request timeout (default is 10s)
--log-level log level (default is info)
--tcp-backlog max incoming connections per listener IP address
--max-msg-size event message size
--max-frame-size ws frame size
-h, --help display usage information
- make it compatible with ordinary clients (besides
nak)- support delivery of multiple events over the same connection
- response with
varyheader
- support azzamo ban api
- use client IP (requires
X-Forwarded-FororX-Real-IPrequest header in your reverse proxy)- rate-limit
- allow-list (which overrides pubkeys allow-list)
- use follower list as allow-list
- use REQ filter as allow-list?
- e.g. allow events that ping a certain npub
- limit number of
ptags for events by strangers to avoid spam
- limit number of
- e.g. allow events that ping a certain npub
- relays fetching: process errors separately per provider
- deduplicate concurrently sent events
- option to subscribe to a certain REQ filter and automatically broadcast such events
- with auto added
since
- with auto added
- NIP-11
- custom relay info
- custom http page or a redirect
- improve RAM usage
- run memory profiler
- disconnect from relays?
- that previousely didn't receive events with the same kind?
- that closed connections after we sent them event?
- option to disconnect after timeout?
- make sure we don't attempt to connect to faulty relays
- retry to connect with an exponential backoff?
- add metrics
- socks5/http proxy for all connections?
I'm currently investing all my time in FOSS projects.
If you found this repo useful and you want to support me, please
Your support keeps me going ❤️ (◕‿◕)
MIT/Apache-2.0