1. Home
  2. Docs
  3. Chainlink Adapters
  4. Private: Adapter Downloads
  5. IOTA Adapter Setup

IOTA Adapter Setup

This adaptor is a base IOTA adaptor for Chainlink using the iota.lib.js library and ExpressJS.

Dependencies

To be able to run this external adaptor, you need Docker installed.

Run the Adaptor

This adaptor is published on the public docker hub, so you just need to run the two following commands:

docker pull linkpoolio/iota-cl-ea
docker run -t -p 8081:8081 -e HOST=<NODE_HOST> -e PORT=<NODE_PORT> linkpoolio/iota-cl-ea

To find a IOTA node, use the public directory found here

Verify Adaptor

To ensure that the adaptor is working properly, the following call:

http://localhost:8081/info

Should result in something similar to the following:

{
    "appName": "IRI",
    "appVersion": "1.4.2.1",
    "jreAvailableProcessors": 8,
    "jreFreeMemory": 108582056,
    "jreVersion": "1.8.0_161",
    "jreMaxMemory": 7635730432,
    "jreTotalMemory": 1186463744,
    "latestMilestone": "AINWVKSNTXZTMCXGEZIVOYOWUKHUIWOSCFOFAVUXBLULAAGOYOBSFHRPNLGLUYXJN9PLKNCX9KEWZ9999",
    "latestMilestoneIndex": 340297,
    "latestSolidSubtangleMilestone": "AINWVKSNTXZTMCXGEZIVOYOWUKHUIWOSCFOFAVUXBLULAAGOYOBSFHRPNLGLUYXJN9PLKNCX9KEWZ9999",
    "latestSolidSubtangleMilestoneIndex": 340297,
    "neighbors": 40,
    "packetsQueueSize": 0,
    "time": 1517440111272,
    "tips": 9796,
    "transactionsToRequest": 7,
    "duration": 0
}

API Specification

Currently, the API supports the following IOTA API queries:

  • broadcastAndStore
  • findTransactionObjects
  • getTransactionsObjects
  • getAccountData
  • getNodeInfo
  • sendTrytes

/transaction-object-query

IOTA API Function: findTransactionObjects

Perform a transaction search based on the query parameters below.

GET Params:

ParamDescription
bundlesComma seperated list of bundle hashes
addressesComma seperated list of addresses
tagsComma serperated list of transaction tags (27 trytes length)
approveesComma seperated list of approvees

/transaction-object

IOTA API Function: findTransactionObjects

Get transaction objects based on the transaction hashes.

GET Params:

ParamDescription
transcationsComma seperated list of transaction hashes

/account-data

IOTA API Function: getAccountData

Get account data by given account seed.

GET Params:

ParamDescription
seedAccount seed, non-tryte

/broadcast-and-store

IOTA API Function: broadcastAndStore

Broadcast and store trytes.

GET Params:

ParamDescription
trytesComma seperated list of trytes.

/send-trytes

IOTA API Function: sendTrytes

Attach to trianges, then broadcast and store.

GET Params:

ParamDescription
trytesComma seperated list of trytes.
depthint
minWeightMagnitudeint

/info

IOTA API Function: getNodeInfo

Get the current nodes information.

Development

To run the external adaptor, clone the repo and run the following commands:

    npm install
    node index.js

You should then see the following:

IOTA External Adaptor Listening on: ::8081

To run the unit tests, run the following:

    npm install -g
    npm test

Which should give the following output:

  IOTA External Adaptor
    ✓ responds to /
    ✓ responds to /account-data (2558ms)
    ✓ responds to /info (98ms)
    ✓ responds to /transaction-object (147ms)
    ✓ responds to /transaction-object-query (191ms)
    ✓ 404 everything else

Contributions

If anyone has any recommendation on what IOTA API calls to support, or wants to contribute and add more themselves, please do!

Created by the LinkPool Team

Was this article helpful to you? Yes No

How can we help?