This is a tool for cloning all past events between Nostr relays. It's useful when switching Nostr relay implementations.
The tool syncs between two Nostr relays. It iterates through events from the source relay and sends them to the destination. It tracks received, acknowledged, duplicated, and non-duplicated events. Logs are generated periodically. If the process is interrupted (e.g., Ctrl+C), it logs the status and exits gracefully.
You need Node.js and npm installed.
- Clone the repo:
git clone https://github.com/imksoo/nostr-sync.git
- Navigate to the project directory:
cd nostr-relay-sync
- Install dependencies:
npm install
- Set up environment variables: Create a
.env
file at the root and add:
SECKEY=your_secret_key
PUBKEY=your_public_key
Replace your_secret_key
and your_public_key
with your Nostr keys.
- Start the script:
npx ts-node sync.ts
Make sure the script runs in an environment with a stable connection to the relays.
https://snort.social/p/npub1yf3lgamj6aqpm77k7cn9l2e7vrfcy7yaf8zttxqzauwgpnevag6srxkfre
All pull requests are welcome. For major changes, start with opening an issue.
This project is under the MIT license.