All Projects → vivekmarakana → iota.lib.rb

vivekmarakana / iota.lib.rb

Licence: MIT License
Ruby Library for IOTA with core and wrapper api implementation.

Programming Languages

ruby
36898 projects - #4 most used programming language
java
68154 projects - #9 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to iota.lib.rb

Tanglestash
IOTA meets BitTorrent: An algorithm to persist any file onto the tangle of IOTA
Stars: ✭ 46 (+170.59%)
Mutual labels:  iota, tangle
dcurl
Hardware-accelerated Multi-threaded IOTA PoW, drop-in replacement for ccurl
Stars: ✭ 39 (+129.41%)
Mutual labels:  iota, tangle
leaderboard-example
IOTA Proof of Concept Application example. With tutorial.
Stars: ✭ 64 (+276.47%)
Mutual labels:  iota, tangle
meta-iota
OpenEmbedded layer for the IOTA Distributed Ledger
Stars: ✭ 41 (+141.18%)
Mutual labels:  iota, tangle
IOTA-MAM.lib.js-PoC
Working Proof of Concept of IOTA's MAM technology using Live Nodes to push and receive messages inside tangle
Stars: ✭ 19 (+11.76%)
Mutual labels:  iota, tangle
tangle-utils-website
A web site full of utilities for all things tangle, transaction and IOTA.
Stars: ✭ 19 (+11.76%)
Mutual labels:  iota, tangle
iota-python
A Pure-Python implementation of IOTA node
Stars: ✭ 30 (+76.47%)
Mutual labels:  iota, tangle
iota-mnemonic
Generate, restore IOTA seed from Bitcoin BIP39 mnemonic
Stars: ✭ 16 (-5.88%)
Mutual labels:  iota, iota-library
IOTAtangle
IOTA Tangle Visualiser 🦔 http://tangle.glumb.de/?DARK_MODE=true
Stars: ✭ 55 (+223.53%)
Mutual labels:  iota, tangle
SensorNode
SensorNode-client application for IOTA.
Stars: ✭ 35 (+105.88%)
Mutual labels:  iota, tangle
poc-ipfs
Demonstration of combining IOTA with IPFS for data storage.
Stars: ✭ 32 (+88.24%)
Mutual labels:  iota, tangle
HTML-Crypto-Currency-Chart-Snippets
💹 Simple HTML Snippets to create Tickers / Charts of Cryptocurrencies with the TradingView API 💹
Stars: ✭ 89 (+423.53%)
Mutual labels:  iota
IOTA101
IOTA Developer Essentials
Stars: ✭ 38 (+123.53%)
Mutual labels:  iota
flash-demo
IOTA Flash channels demo using webRTC for communication.
Stars: ✭ 21 (+23.53%)
Mutual labels:  iota
ntangle
Command-line utility for Tangling of Org documents — programmed in Nim.
Stars: ✭ 56 (+229.41%)
Mutual labels:  tangle
PEGASUS
Pegasus is a browser extension that implements a wallet for the IOTA cryptocurrency. https://allemanfredi.github.io/pegasus-website/
Stars: ✭ 14 (-17.65%)
Mutual labels:  iota
Customizable-Crypto-Currency-Dashboard-with-Chart
📺 A Dashboard with the price movements of the selected Cryptocurrencies 💹
Stars: ✭ 79 (+364.71%)
Mutual labels:  iota
iota-ion.lib.js
IOTA ION Library - Fast data-troughput in the browser, supported by the IOTA tangle.
Stars: ✭ 28 (+64.71%)
Mutual labels:  iota
CoinMarketCap-Desktop
A simple desktop wrapper for CoinMarketCap
Stars: ✭ 21 (+23.53%)
Mutual labels:  iota
giotan
The CLI Tool for IOTA in Go
Stars: ✭ 30 (+76.47%)
Mutual labels:  iota

[Archived Project] This Gem only supports IOTA 1.0 APIs. Post-chrysalis apis are not supported.

IOTA Ruby Gem

Build Status Gem Version GitHub license

This is the unofficial Ruby gem for the IOTA Core. It implements both the official API, as well as newly proposed functionality (such as signing, bundles, utilities, conversion, multi signature support and reattch/promote).

Installation

Add this line to your application's Gemfile:

gem 'iota-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install iota-ruby

Documentation

You can find basic documentation at: https://vivekmarakana.gitbooks.io/iota-ruby

Getting Started

After you've successfully installed the library, it is fairly easy to get started by simply launching a new instance of the IOTA object with an optional settings object. When instantiating the object you have the option to decide the API provider that is used to send the requests to and you can also connect directly to the Sandbox environment.

The optional settings object can have the following values:

  1. host: String Host you want to connect to. Can be DNS, IPv4 or IPv6. Defaults to localhost
  2. port: Integer port of the host you want to connect to. Defaults to 14265.
  3. user: String username for host if required.
  4. password: String password for host if required.
  5. provider: String If you don't provide host and port, you can supply the full provider value to connect to
  6. sandbox: Boolean Optional value to determine if your provider is the IOTA Sandbox or not.
  7. token: String Token string in case you are using sandbox.
  8. timeout: Integer Timeout in seconds for api requests to full node. Defaults to 120.
  9. batch_size: Integer Batch size for apis like getTrytes, getBalances etc. Defaults to 500.
  10. local_pow: Boolean Should PoW be done local machine or not. Defaults to false i.e. remote PoW.

You can either supply the remote node directly via the provider option, or individually with host and port, as can be seen in the example below:

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')

# now you can start using all of the functions
status, data = client.api.getNodeInfo

Overall, there are currently four subclasses that are accessible from the IOTA object:

  • api: Core API functionality for interacting with the IOTA core.
  • utils: Utility related functions for conversions, validation and so on
  • validator: Validator functions that can help with determining whether the inputs or results that you get are valid.
  • multisig: Functions for creating and signing multi-signature addresses and transactions.

How to use the Library

All API calls are executed synchronously and returns array with 2 entries. First entry is status and second is data. However, you can use it by passing block to it as well.

Here is a simple example of how to access the getNodeInfo function:

# Method 1
client.api.getNodeInfo do |status, data|
  if !status
    # If status is `false`, `data` contains error message...
    puts data
  else
    # If status is `true`, `data` contains response...
    puts data.inspect
  end
end

# Method 2
status, data = client.api.getNodeInfo
if !status
  puts data
else
  puts data.inspect
end

Local PoW Support

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

Compatibility

Tested on Travis CI on following environment configurations

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].