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 Answers1

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

mihi
  • 7,324
  • 2
  • 15
  • 34
  • 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. – Pranav Gangwani Feb 05 '21 at 17:43
  • Same error message as before? Probably you edited the wrong config file and/or forgot to restart your node? – mihi Feb 05 '21 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? – Pranav Gangwani Feb 06 '21 at 01: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 Feb 06 '21 at 12:27
  • I added the screenshot of the file. Please let me know if you know someone else who might help. – Pranav Gangwani Feb 06 '21 at 17:17
  • I see you already asked in #hornet on Discord, so no other idea where to ask. Perhaps somebody else will come and have a better answer for you. :) – mihi Feb 06 '21 at 22:59