Why Nostr? What is Njump?
2023-05-17 17:25:27
in reply to

current on Nostr: right. Start with a node init and npm install nostr-tools. Here’s a simple connect ...

right. Start with a node init and npm install nostr-tools. Here’s a simple connect and log events.

const {WebSocket} = require('websocket-polyfill');
const {
SimplePool
} = require('nostr-tools');


async function run() {

let relays = ['wss://nos.lol',
'wss://nostr1.current.fyi',
'wss://eden.nostr.land',
'wss://relay.current.fyi',
'wss://nos.lol',
'wss://nostr21.com',
'wss://spore.ws',
'wss://nostr.bitcoiner.social',
'wss://offchain.pub',
'wss://relay.plebstr.com',
'wss://nostr.mom',
'wss://no.str.cr',
'wss://relay.nostr.bg',
'wss://nostr.oxtr.dev',
'wss://relay.snort.social',
'wss://relay.nostr.bg',
'wss://no.str.cr',
'wss://nostr.wine',
'wss://nostr-pub.wellorder.net',
'wss://nostr-relay.nokotaro.com',
'wss://relay.nostr.wirednet.jp'
]
const pool = new SimplePool();

let sub = pool.sub(
relays,
[
{
limit: 100,
kinds: [1],
//tags: ['t']
authors: ['c7063ccd7e9adc0ddd4b77c6bfabffc8399b41e24de3a668a6ab62ede2c8aabd']

}
]
)

sub.on('event', async event => {
console.log(event);

})

}

run().catch(console.log);
Author Public Key
npub1current7ntwqmh2twlrtl2llequeks0zfh36v69x4d3wmckg427safsh3w