Last active
December 14, 2018 14:40
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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