Global Feed Post Login
Replying to Avatar current

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);

Avatar
klabo 2y ago

Thanks 🤙

Reply to this note

Please Login to reply.

Discussion

No replies yet.