1

Have a hornet node set up on AWS, able to access the dashboard and interact with the REST API just fine. However when trying to build a connection to it using nodejs @iota/client ClientBuilder cannot connect to it.

async function run() {
    // this doesn't work
    const client = new ClientBuilder().node('https://<my-node-ip>:443').build();
    // this works
    const client = new ClientBuilder().node('https://api.lb-0.h.chrysalis-devnet.iota.cafe').build();

    client.getInfo().then(console.log).catch(console.error)

    const index = "testIndex";
    const data = `This message was sent at: ${new Date()}`

    try{
        const message = await client.message()
         .index(index)
         .data(data)
         .submit();
        console.log(message);
        console.log(message.messageId);
        console.log(data);
        return message.messageId.toString();
    }

    catch (err){
        console.log(err);
        throw Error("Not able to send message to tangle")
    }
}

run()
    .then(() => console.log("Done"))
    .catch((err) => console.error(err));

Throws an error:

[Error: ClientTask error: Client(NodeError("Couldn't get a result from any node"))]
[Error: ClientTask error: Client(NodeError("Couldn't get a result from any node"))]
Error: Not able to send message to tangle
1
  • I'm experiencing the same problem. Did you address the issue?
    – c96
    Commented Apr 6, 2022 at 14:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.