Skip to content

Instantly share code, notes, and snippets.

@huhn511
Last active December 14, 2018 14:40
Show Gist options
  • Save huhn511/f096d7f1831a92c0aae3d45cd87851c4 to your computer and use it in GitHub Desktop.
Save huhn511/f096d7f1831a92c0aae3d45cd87851c4 to your computer and use it in GitHub Desktop.
If you want to use this gem with public full node which does not support remote PoW on host, you can set local_pow to true when initialising the client.
require 'iota'
# With remote PoW
client = IOTA::Client.new(provider: 'https://node.iota-tangle.io:14265')
# If you use `client.api.attachToTangle` api here, you'll get error saying that attachToTangle command is not allowed
# With local pow
client = IOTA::Client.new(provider: 'https://node.iota-tangle.io:14265', local_pow: true)
# Now you can use `client.api.attachToTangle` api, which will do the proof-of-work on transaction and return the trytes that needs to be broadcasted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment