2

I have a private tangle with a Hornet Coordinator node. I am trying to make zero-value transactions using Python API but get an error "Command [attachToTangle] is protected.

This the code which I'm using for sending transactions.

API Declaration printing get_node_info() Creating and Sending Transaction Error Response config.json file

Please help someone. Any suggestions are appreciated.

1 Answer 1

1

The attachToTangle command is used to perform PoW for your transaction. For it to work for transactions received via the Internet (even from localhost), you need to enable remote PoW in your Hornet node:

https://docs.iota.org/docs/hornet/1.1/guides/allowing-remote-pow

by setting this configuration:

"httpAPI": {
    "permitRemoteAccess": [
      "attachToTangle"
    ],
}

Alternatively, you can set your PyOTA library to to local PoW:

https://pyota.readthedocs.io/en/latest/#optional-local-pow

6
  • It is still not working. I added "attachToTangle" in the permitRemoteAccess. I even tried to do local pow but it failed when I set the local_pow=True. Please let me know. Commented Feb 5, 2021 at 17:43
  • Same error message as before? Probably you edited the wrong config file and/or forgot to restart your node?
    – mihi
    Commented Feb 5, 2021 at 21:13
  • I edited the config.json file of the node in the /var/lib/hornet directory. After that, I restarted my node using sudo systemctl restart hornet. Is there any way by which I can share the screenshot of the edited file? Commented Feb 6, 2021 at 1:25
  • you might edit your question and add the screenshots there. But no, I have no idea anymore why it does not work for you :-(
    – mihi
    Commented Feb 6, 2021 at 12:27
  • I added the screenshot of the file. Please let me know if you know someone else who might help. Commented Feb 6, 2021 at 17:17

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.