-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Labels
Description
Describe the bug
With the current version (commit fb6948f) nostream is not accepting events. Sending a simple event with nostr-tools gives no response. Requesting events works as expected though.
Switching to commit f237400 solves the issue. Everything works as expected.
To Reproduce
Steps to reproduce the behavior:
- Run command:
- Start nostream witch mentioned commit checked out
- execute sth like:
import 'websocket-polyfill'
import {
relayInit,
getPublicKey,
getEventHash,
signEvent
} from 'nostr-tools'
const relay = relayInit('wss://example.com')
let privateKey = 'xxx'
relay.on('connect', () => {
console.log(`connected to ${relay.url}`)
})
relay.on('error', () => {
console.log(`failed to connect to ${relay.url}`)
})
await relay.connect()
let event = {
kind: 1,
created_at: Math.floor(Date.now() / 1000),
tags: [],
content: 'Hello world! This is a test',
pubkey: getPublicKey(privateKey)
}
event.id = getEventHash(event)
event.sig = signEvent(event, privateKey)
let pub = relay.publish(event)
pub.on('ok', () => {
console.log(`${relay.url} has accepted our event`)
})
pub.on('failed', reason => {
console.log(`failed to publish to ${relay.url}: ${reason}`)
})- See error: Event is not accepted, but no error is thrown either.
Expected behavior
The event got accepted
System (please complete the following information):
- OS: Ubuntu 22.04
- Platform: docker
- Version: commit fb6948f