Created
December 21, 2022 18:29
-
-
Save swissrouting/78c8bdade7ac5e8e7961b4b4571b7bdd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Mirrors notes from one nostr relay to another. | |
# | |
# Example usage: | |
# nostr-mirror.sh wss://source.relay.example wss://target.relay.example | |
# Source relay to fetch events from (wss://...). | |
SOURCE=$1 | |
# Target relay to send these events to (wss://...). | |
TARGET=$2 | |
echo '["REQ", "mirror", {}]' | \ | |
websocat -n --ping-interval 20 -B 400000 "${SOURCE}" | \ | |
jq -c '[.[0,2]]' --unbuffered -M | \ | |
websocat -n --ping-interval 20 -B 400000 "${TARGET}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment