About IOTA

IOTA is a revolutionary new transactional settlement and data integrity layer for the Internet of Things. It’s based on a new distributed ledger architecture, the Tangle, which overcomes the inefficiencies of current Blockchain designs and introduces a new way of reaching consensus in a decentralised peer-to-peer system. For the first time ever, through IOTA people can transfer money without any fees. This means that even infinitesimally small nano-payments can be made through IOTA.

Recently, IOTA team launched a way to promote a transaction to improve confirmation time over the traditional approach of reattaching it. This is done via checking consistency of transaction with existing ledger using checkConsistency API.

This functionality is available in IOTA JavaScript library as well. However, ruby library take a little different approach. Instead of providing separate API to promote transaction as JS library, it’s bundled together within already defined function replayBundle in Ruby Gem.

When user tries to replay any bundle, library check it’s consistency. If it’s found to be consistent, library will promote the transaction instead of replaying it and return the original bundle. If it’s not consistent, it will reattach the transaction and return new bundle. This bundle also allows to forcefully replay a bundle even if it can be promoted using forcedReplay parameter, if user wants.

This will help users avoid creating large bundles with many replays as well as allow to put transactions from middle to top of the tangle. This functionality is available in Ruby Gem version 1.1.2 and does not require any changes to existing code.

You can install the gem by adding following to your Gemfile :

gem 'iota-ruby', '~> 1.1.2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install iota-ruby

After this, you can use the library by require the library and creating client as following:

require 'iota'



# Create client with host and port as provider

client = IOTA::Client.new(host: 'http://localhost', port: 14265)



# Create client directly with provider

client = IOTA::Client.new(provider: 'http://localhost:14265')

This library is an effort to increase adoption of IOTA by providing easy to use libraries for various languages. Many people helped test the library to make stable release. Also, special thanks to IOTA developers to take time and review the code.

Code & Support

Code for this library is open sourced under MIT license at https://github.com/vivekmarakana/iota.lib.rb and you can ask for help in #ruby channel on Discord.