Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can connect to relays, but NDKEvent.publish always returns Error: Timeout #173

Closed
neilck opened this issue Jan 4, 2024 · 1 comment
Closed

Comments

@neilck
Copy link

neilck commented Jan 4, 2024

Am I doing something wrong?

I can connect to relays, but get Error: Timeout on NDKEvent.publish, no matter which relays I use (tried multiple).
Version: 2.3.2

My test code:

const test = async () => {
    console.log("Test started...");
    // Test Key
    const signer = new NDKPrivateKeySigner(
      "3dc60aa853c59a01d8d07819a871673cf4636a2306b532aae4490e0eaf78f2ce"
    );

    const ndk = new NDK({
      signer: signer,
      explicitRelayUrls: ["wss://relay.damus.io", "wss://nostr.hubmaker.io"],
      enableOutboxModel: false,
    });

    const ndkEvent = new NDKEvent(ndk);
    ndkEvent.kind = 1;
    ndkEvent.content = "Hello, world!";

    return ndkEvent.publish(undefined, 10000);
  };

Thanks.

@neilck
Copy link
Author

neilck commented Jan 4, 2024

I missed the ndk.connect.

@neilck neilck closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant