Aidos Kuneen

The Aidos Kuneen Developer Hub

Welcome to the Aidos Kuneen developer hub. You'll find comprehensive guides and documentation to help you start working with Aidos Kuneen as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    
Suggest Edits

Introduction

 

Following we demonstrate and explain the usage of the JSON-REST HTTP interface (API) for an Aidos Node.

Through the API it is possible to request certain information or to execute certain commands on your local or a remote node (depending on which commands are enabled for remote access).
Once your node is successfully setup, you can interface with it through port 14266 by passing along a JSON object which contains a specified command; and upon successful execution of the command, returns your requested information.

The main priority of the API as well as ARI itself is security. As such, anything that has to do with private keys is done client side. Examples how this can be done can be found in the Aidos Wallet which contains a Javascript library. Also feel free to implement this functionality by yourself.

For your convenience, we have added concrete examples on how to use the API in Curl, Python and nodeJS. If you are using Javascript, you can simply follow along by using either XMLHttpRequest or jQuery. For NodeJS you have to install the request npm package.

The Aidos API is running on port 14266 by default (Testnet: port 15555).

Suggest Edits

How to issue an request

 

All API calls need to be sent to http://localhost:14266 via a POST HTTP request. The data which will be sent is a JSON object which is defined by the following scheme:
{‘command’: ’APICOMMAND’}

Additional parameters are simply added as additional key-value pairs. If the command is successfully executed, your requested information is returned as either an object or a stringified object (use json.parse or equivalent to turn it into an object).

When making a request, make sure that the HTTP library you're using defines the Content-Length of the data to be sent. If this is not done automatically, manually add it via a header field e.g. 'Content-Length': Buffer.byteLength(JSON.stringify(command)).

Here we list and describe all additional parameters which are required to be passed along for certain commands:

  • seed: string tryte encoded string which contains the accounts seed. The seed must be correctly encoded trytes: only uppercase latin letters and 9’s. No other characters are allowed. The maximum security level is 81-trytes, but you can choose longer/shorter seeds.
  • address: string 81-trytes long address of the recipient of a transaction.
  • value: string the quantity of units which should be transferred. Note that one ADK equals 100000000 units.
  • message: string tryte-encoded string which can contain arbitrary information and is sent alongside a transaction. The message value is publicly visible. The max value is 2187 trytes, which is 6561 trits (or roughly 1312 bytes).
  • transaction / hash: string hash of a transaction. A single transaction hash is 81-chars long.
  • trytes: string the raw data of a transaction.
  • bundles: list contains a list of transaction bundles. Bundles are basically linked, individual transactions which were created with a single transfer. They are uniquely identified by a 27-char hash.
  • addresses : list a list of addresses. A single address is 81-chars long.
  • tags: list the tag of a transaction.
  • approvees: list a list of transaction which were referenced by this transaction
  • securityLevel: int specifies the security level of your transaction. Can either by 0 (for 81-trit security), 1 (for 162-trit security) and 2 (for 243-trit security). Lower security transactions are faster to generate.
  • minWeightMagnitude: int specifies the amount of Proof of Work that will be carried out. Currently can only take the value 18.
Suggest Edits

attachToMesh

Attaches the specified transactions (trytes) to the Mesh by doing Proof of Work. You need to supply branchTransaction as well as trunkTransaction (basically the tips which you're going to validate and reference with this transaction) - both of which you'll get through the getTransactionsToApprove API call.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "attachToMesh", "trunkTransaction": "UHJOHFZK9UNVSTXZRRROVFRLDMLWLILGTSOIDQKRRCRXZMSAI9SFRJYIGCM9PEEJQZHHIKLDMBY999999", "branchTransaction": "MYUDAOXEJC9NKBXV9PTFSZTNJOZEYPPPZHXH9UMJRWIVMCZJXKJUKJTUROHYVVGPLKJCHGULYD9999999", "minWeightMagnitude": 18, "trytes": ["RAWTRYTES"]}'
import urllib2
import json

command = {
    'command': 'attachToMesh',
    'trunkTransaction': 'UHJOHFZK9UNVSTXZRRROVFRLDMLWLILGTSOIDQKRRCRXZMSAI9SFRJYIGCM9PEEJQZHHIKLDMBY999999', 
    'branchTransaction': 'MYUDAOXEJC9NKBXV9PTFSZTNJOZEYPPPZHXH9UMJRWIVMCZJXKJUKJTUROHYVVGPLKJCHGULYD9999999',
    'minWeightMagnitude': 18,
    'trytes': ['RAWTRYTES']
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url='http://localhost:14266', data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
    'command': 'attachToMesh',
    'trunkTransaction': 'UHJOHFZK9UNVSTXZRRROVFRLDMLWLILGTSOIDQKRRCRXZMSAI9SFRJYIGCM9PEEJQZHHIKLDMBY999999',
    'branchTransaction': 'MYUDAOXEJC9NKBXV9PTFSZTNJOZEYPPPZHXH9UMJRWIVMCZJXKJUKJTUROHYVVGPLKJCHGULYD9999999',
    'minWeightMagnitude': 18,
    'trytes': ['RAWTRYTES']
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': JSON.stringify(command).length
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{
  'trytes':['TRYTESFORTRANSACTION']
}
{"error": "Invalid parameters."}
{"error": "Invalid trunkTransaction hash."}
{"error": "Invalid branchTransaction hash."}
{"error": "Invalid trytes input."}

Body Params

command
string
required
trunkTransaction
string
required

Trunk transaction to approve.

branchTransaction
string
required

Branch transaction to approve.

minWeightMagnitude
int32
required

Proof of Work intensity. Minimum value is 18.

trytes
string
required

List of trytes (raw transaction data) to attach to the Mesh.

 
Field
Description

tryte

The returned value is a different set of tryte values which you can input into broadcastTransactions and storeTransactions. The returned tryte value, the last 243 trytes basically consist of the: trunkTransaction + branchTransaction + nonce. These are valid trytes which are then accepted by the network.

Suggest Edits

broadcastTransactions

Broadcast a list of transactions to all peers. The input trytes for this call are provided by attachToMesh.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "broadcastTransactions", "trytes": ["BHEXYPFRIGBSBGQLPFPEROJRJIYFNUNLYZHXNJY9FOQXTXXFIIODEBYENQVKJBHOBZFHATCUGHKGNXFOQO9TDIOVGKJJILQURSZKLNPIUUOVHUG9SGRRGUDTGLLUSFA9NOZNFRCRTPDEQQIBIEDMYQKHVJPUBTOQNKGQX9ZRSKWQUALHRUNKIBQMFFRHZVISUSXMYCLVHODMNT9MKFJXRBAGKL9PQSIHT9ILVO99ASTOUWZSDVSAJNPY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HZWKDMLUNQWJQUBYXDHCLKBCDXZLGQYDJHECJSYANQCAIEFF9QCGZVNSXZIVOCZZTYGCOTCIHAMSFGCPHVR9XNXZIZJX9CNYEYHHICMLTKUOCGTFBMHLDTUBOQSGE9KJOLQOJW9ARHSRXQTJTHHYVVXWMDWOWPAIG9GXYVMVHUDTXIHLMZCGOSICRCSCDBFVBNT9M9ZHOXMNTOEGUDDCGD9UXPZMGIGVOTDAOSHCGTXUTUSIXEMGS9TAVODXTYNZYUYOPFHF9NQAXE9YJLFXAYJYZMCG9HZTFHRUCOTTJLJAQWXWFTWICDGRQMIJEKTRWSIIK999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999DAQRHWD99A99999999A99999999VSIEYBNRKEGNKNWYJASK9JBZKYCSOOBBYUZRP9NMPIWRFTELRONZSZEUVBANLHFXYDHDIFNTCZJRGKRWVSEOPZBLXMYUR9XOTVPZKOVVTIBDVMYAQCF9TXKYUBCY9WFGUUJXYDGIKUPMLAKLIBLWZKVKLSTT999999RLQBJJHKDGCAXOCGCPYMPX9SKXK9HGTJKT9JQUOEZXIHEOGEABRNBMTXIDBOWGYESQCQGBPQTEB999999RAPNXVJRYCBIKYW9IMEKDDBNKSVOPKYHLDKZSNFEEICKEEJJCOSMFATAWFPKOZQMYRK9CFMMLIXV9AJWP"]}'
import urllib2
import json

command = {
    'command': 'broadcastTransactions',
    'trytes': ['BHEXYPFRIGBSBGQLPFPEROJRJIYFNUNLYZHXNJY9FOQXTXXFIIODEBYENQVKJBHOBZFHATCUGHKGNXFOQO9TDIOVGKJJILQURSZKLNPIUUOVHU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NAIVRHUNRHCGDVHIOEDJSCKBSIQZKOXTOJUKQH9Q9LYWIHLMJIHYKDABVNIBQCINEMVUYHXTPDMUSGKS9XQV9ZHQDGNLAOJVCWRPHDCYUFOTXBXZHVVAQ9DFLUVMQKFHLXASTVIHZWKDMLUNQWJQUBYXDHCLKBCDXZLGQYDJHECJSYANQCAIEFF9QCGZVNSXZIVOCZZTYGCOTCIHAMSFGCPHVR9XNXZIZJX9CNYEYHHICMLTKUOCGTFBMHLDTUBOQSGE9KJOLQOJW9ARHSRXQTJTHHYVVXWMDWOWPAIG9GXYVMVHUDTXIHLMZCGOSICRCSCDBFVBNT9M9ZHOXMNTOEGUDDCGD9UXPZMGIGVOTDAOSHCGTXUTUSIXEMGS9TAVODXTYNZYUYOPFHF9NQAXE9YJLFXAYJYZMCG9HZTFHRUCOTTJLJAQWXWFTWICDGRQMIJEKTRWSIIK999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999DAQRHWD99A99999999A99999999VSIEYBNRKEGNKNWYJASK9JBZKYCSOOBBYUZRP9NMPIWRFTELRONZSZEUVBANLHFXYDHDIFNTCZJRGKRWVSEOPZBLXMYUR9XOTVPZKOVVTIBDVMYAQCF9TXKYUBCY9WFGUUJXYDGIKUPMLAKLIBLWZKVKLSTT999999RLQBJJHKDGCAXOCGCPYMPX9SKXK9HGTJKT9JQUOEZXIHEOGEABRNBMTXIDBOWGYESQCQGBPQTEB999999RAPNXVJRYCBIKYW9IMEKDDBNKSVOPKYHLDKZSNFEEICKEEJJCOSMFATAWFPKOZQMYRK9CFMMLIXV9AJWP']
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
  'command': 'broadcastTransactions',
  'trytes': ['BHEXYPFRIGBSBGQLPFPEROJRJIYFNUNLYZHXNJY9FOQXTXXFIIODEBYENQVKJBHOBZFHATCUGHKGNXFOQO9TDIOVGKJJILQURSZKLNPIUUOVHUG9SGRRGUDTGLLUSFA9NOZNFRCRTPDEQQIBIEDMYQKHVJPUBTOQNKGQX9ZRSKWQUALHRUNKIBQMFFRHZVISUSXMYCLVHODMNT9MKFJXRBAGKL9PQSIHT9ILVO99ASTOUWZSDVSAJNPYQSSWQHLDAOPXYSTNQTUUNE9ALBVRYAJGKIJTASKSZNYYSTXHYDUSJNFDIPIFYAXPMQUGQRMMADQBXBATNMWZSYBDAGFPTLDQTMUVEYNRBQXOTQMTEZHVJZEKE9HHGKLUUCAFTJBQNJUQCIACPZWU9S9TEMQKEP9SKGSLLHVLPHQVVTTNCAFGPGRHROPFHJGDTPGXNK9PZQASVXVLDHYTJRMCQWFQZFFFNJZFVQDZE9HMATDIWIJHNNCIHASXOLHZWMPICZHEFUDYZYOWBTSGMDDPILBCPGFKIMTNZFCUJKEAUIASKGCCQGEW9QZ9TSNQHAFYYJSTHOKOLGPXYVQZXNPVUGQMOIJWZZYGVYXXFCUCNLAAXSEGHRONQKFCRHHWFIKJFDVA9NCMXTAKRRIMJJUXJGZYQOGQUZEBTCDYQBLLRHKHPJRQRVGYGQKOGCQBJHPJLVDRWHJCSSMUIXBJGMJLGCYYMDBGPEEQTNDLKLGYZDKXEDDCJUCC9ETMCWPJUDGENHOLPGJGZVMBIBUXMACX9RKSXRSGQYAUFIDVIEIIKAASCWMRSZNDVGHCE9DLWHYGDTFKUT9SJKJQXFJCMGKLWXTJQOXBPNHEUWGZFCAPPSVIJKATJNFDPVCKLCTNOTOLEOTXL9CBDJFWWHWGHWAW9PGLJVAUNVKAMJXMGZCD9CZZVRWBV9UMBSKCSE9MBXVUEKSD9CPVDRJAAVWVHOQNQZZAORZVYSDQVLWRHNYOVBEO9YDXZGZQVLADMLGDQYFWSWLBB9KNCDL9JOXLTNSIDFVKOKPBBIT9VIQQZFANVAPKEYUIUELVVZCLTPSKRWJXUWAUZCXLJYYYOCTUUOYQOSYUVJNCJHGKMWPU99XLE9NASIXDTBQNSQG9RHWZTSFEBESALSMNJQPVNAIVRHUNRHCGDVHIOEDJSCKBSIQZKOXTOJUKQH9Q9LYWIHLMJIHYKDABVNIBQCINEMVUYHXTPDMUSGKS9XQV9ZHQDGNLAOJVCWRPHDCYUFOTXBXZHVVAQ9DFLUVMQKFHLXASTVIHZWKDMLUNQWJQUBYXDHCLKBCDXZLGQYDJHECJSYANQCAIEFF9QCGZVNSXZIVOCZZTYGCOTCIHAMSFGCPHVR9XNXZIZJX9CNYEYHHICMLTKUOCGTFBMHLDTUBOQSGE9KJOLQOJW9ARHSRXQTJTHHYVVXWMDWOWPAIG9GXYVMVHUDTXIHLMZCGOSICRCSCDBFVBNT9M9ZHOXMNTOEGUDDCGD9UXPZMGIGVOTDAOSHCGTXUTUSIXEMGS9TAVODXTYNZYUYOPFHF9NQAXE9YJLFXAYJYZMCG9HZTFHRUCOTTJLJAQWXWFTWICDGRQMIJEKTRWSIIK999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999DAQRHWD99A99999999A99999999VSIEYBNRKEGNKNWYJASK9JBZKYCSOOBBYUZRP9NMPIWRFTELRONZSZEUVBANLHFXYDHDIFNTCZJRGKRWVSEOPZBLXMYUR9XOTVPZKOVVTIBDVMYAQCF9TXKYUBCY9WFGUUJXYDGIKUPMLAKLIBLWZKVKLSTT999999RLQBJJHKDGCAXOCGCPYMPX9SKXK9HGTJKT9JQUOEZXIHEOGEABRNBMTXIDBOWGYESQCQGBPQTEB999999RAPNXVJRYCBIKYW9IMEKDDBNKSVOPKYHLDKZSNFEEICKEEJJCOSMFATAWFPKOZQMYRK9CFMMLIXV9AJW']
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{ }
{"error": "Invalid parameters."}
{"error": "Invalid trytes input."}

Body Params

command
string
required
 
Suggest Edits

findTransactions

Find the transactions which match the specified input and return. All input values are lists, for which a list of return values (transaction hashes), in the same order, is returned for all individual elements. The input fields can either be bundles, addresses, tags or approvees. Using multiple of these input fields returns the intersection of the values.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "findTransactions", "addresses": ["HZSMDORPCAFJJJNEEWZSP9OCQZAHCAVPBAXUTJKRCYZXMSNGERFZLQPNWOQQHK9RMJO9PNSVV9KR9DONH"]}'
import urllib2
import json

command = {
    'command': 'findTransactions',
    'addresses': ['HZSMDORPCAFJJJNEEWZSP9OCQZAHCAVPBAXUTJKRCYZXMSNGERFZLQPNWOQQHK9RMJO9PNSVV9KR9DONH']
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var command = {
  'command': 'findTransactions',
  'addresses': ['HZSMDORPCAFJJJNEEWZSP9OCQZAHCAVPBAXUTJKRCYZXMSNGERFZLQPNWOQQHK9RMJO9PNSVV9KR9DONH']
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': JSON.stringify(command).length
  },
  json: command
};

request.post(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{ 
  hashes: [ 
    'CGWKDBEGLULSRCZVIUFKBTZYDYUWUGMXVJRTTXKBSMMNSITMAQMQNGYFNYPNGVCSHNVHDMVOOTQ999999' 
  ] 
}
{"error": "Invalid parameters."}

Body Params

command
string
required
bundles
array of strings

List of bundle hashes. The hashes need to be extended to 81chars by padding the hash with 9's.

addresses
array of strings

List of addresses.

tags
array of strings

List of transaction tags. Has to be 27 trytes.

approvees
string

List of approvees of a transaction.

 

The transaction hashes which are returned depend on your input. For each specified input value, the command will return the following:

Field
Description

bundles

Returns the list of transactions which contain the specified bundle hash.

addresses

Returns the list of transactions which have the specified address as an input/output field.

tags

Returns the list of transactions which contain the specified tag value.

approvees

Returns the list of transaction which reference (i.e. confirm) the specified transaction.

Suggest Edits

getBalances

Similar to getInclusionStates it returns the confirmed balance which a list of addresses have at the latest confirmed milestone. In addition to the balances, it also returns the milestone as well as the index with which the confirmed balance was determined. The balances is returned as a list in the same order as the addresses were provided as input.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "getBalances", "addresses": ["OZZIZKFIQPGBLZKWLTBNMFKKTHFKYOYTRMGJU9AJTVRI9BUKULPQFFPZT9AIT9GTQSZLKKLVLXDVCYLZZ"], "threshold": 100}'
import urllib2
import json

command = {
    'command': 'getBalances',
    'addresses': ['OZZIZKFIQPGBLZKWLTBNMFKKTHFKYOYTRMGJU9AJTVRI9BUKULPQFFPZT9AIT9GTQSZLKKLVLXDVCYLZZ'],
    'threshold': 100
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
    'command': 'getBalances',
    'addresses': ['OZZIZKFIQPGBLZKWLTBNMFKKTHFKYOYTRMGJU9AJTVRI9BUKULPQFFPZT9AIT9GTQSZLKKLVLXDVCYLZZ'],
    'threshold': 100
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': JSON.stringify(command).length
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{
    "balances": [
        "55964400000000"
    ],
    "duration": 30,
    "milestone": "BCBHKWSBJNLLSTYEJKYDQYITCIBXCWHKYXWKSSNGODPJLTUW9EKD9PYCAKQBCBPBIMCYONOEYRZ999999",
    "milestoneIndex": 4184
}
{"error": "Invalid parameters."}
{"error": "Invalid addresses input."}
{"error": "Illegal 'threshold'."}

Body Params

getBalances
string
required
addresses
array of strings
required

List of addresses you want to get the confirmed balance from

threshold
string
required

Confirmation threshold, should be set to 100.

 
Field
Description

balances

List of balances in the same order as you put in the addresses. The balance is returned in units, which means 100000000 = 1 ADK.

Suggest Edits

getInclusionStates

Get the inclusion states of a set of transactions. This is for determining if a transaction was accepted and confirmed by the network or not. You can search for multiple tips (and thus, milestones) to get past inclusion states of transactions.
This API call simply returns a list of boolean values in the same order as the transaction list submitted, thus you get a true/false whether a transaction is confirmed or not.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "getInclusionStates", "transactions": ["GMJYGKPMRIIQBNADRKSKZ9TJKEMIMKXTNXVBKXWSMLKLVSWCXYRQRAIPBMEEJEDBDZ9NWBQBRSZ999999"], "tips": ["BCBHKWSBJNLLSTYEJKYDQYITCIBXCWHKYXWKSSNGODPJLTUW9EKD9PYCAKQBCBPBIMCYONOEYRZ999999"]}'
import urllib2
import json

command = {
    'command': 'getInclusionStates',
    'transactions': ['GMJYGKPMRIIQBNADRKSKZ9TJKEMIMKXTNXVBKXWSMLKLVSWCXYRQRAIPBMEEJEDBDZ9NWBQBRSZ999999'],
    'tips': ['BCBHKWSBJNLLSTYEJKYDQYITCIBXCWHKYXWKSSNGODPJLTUW9EKD9PYCAKQBCBPBIMCYONOEYRZ999999']
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var command = {
    'command': 'getInclusionStates',
    'transactions': ['GMJYGKPMRIIQBNADRKSKZ9TJKEMIMKXTNXVBKXWSMLKLVSWCXYRQRAIPBMEEJEDBDZ9NWBQBRSZ999999'],
    'tips': ['BCBHKWSBJNLLSTYEJKYDQYITCIBXCWHKYXWKSSNGODPJLTUW9EKD9PYCAKQBCBPBIMCYONOEYRZ999999']
}

var options = {
  url: 'http://localhost:14265',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': JSON.stringify(command).length
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{
  "states": [true], 
  "duration": 55
}
{"error": "Invalid parameters."}
{"error": "Invalid transactions input."}
{"error": "Invalid tips input."}
{"error": "This operations cannot be executed: The Submesh has not been updated yet."}

Body Params

command
string
required
transactions
array of strings
required

List of transactions you want to get the inclusion state for.

tips
array of strings
required

List of tips (including milestones) you want to search for the inclusion state.

 
Field
Description

states

List of boolean values in the same order as the transaction list submitted. Returning true/false depending if a transaction is confirmed or not. (refering to the newest milestone (tip) submitted)

Suggest Edits

getNodeInfo

Returns information about your Node.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "getNodeInfo"}'
import urllib2
import json

command = {
    'command': 'getNodeInfo'
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
    'command': 'getNodeInfo'
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{
  "appName": "ARI",
  "appVersion": "1.0.0.0",
  "jreAvailableProcessors": 2,
  "jreFreeMemory": 13263408,
  "jreVersion": "1.8.0_131",
  "jreMaxMemory": 466092032,
  "jreTotalMemory": 44040192,
  "latestMilestone": "AEQJFZOHFOOPFFFMTDGLSERTIL9APEKRIOHFQHWKT9QEANVZPDZBALBDKUIMAWJ9YSAWBHZZREE999999",
  "latestMilestoneIndex": 4104,
  "latestSolidSubmeshMilestone": "AEQJFZOHFOOPFFFMTDGLSERTIL9APEKRIOHFQHWKT9QEANVZPDZBALBDKUIMAWJ9YSAWBHZZREE999999",
  "latestSolidSubmeshMilestoneIndex": 4104,
  "peers": 10,
  "packetsQueueSize": 0,
  "time": 1496336198873,
  "tips": 3,
  "transactionsToRequest": 0,
  "duration": 96
}

Body Params

command
string
required
 
Field
Description

appName

Name of app you are currently using. ARI stands for Aidos Reference Implementation

appVersion

The version of the Aidos software you're currently running.

jreAvailableProcesses

Available cores on your machine for JRE.

jreFreeMemory

Returns the amount of free memory in the Java Virtual Machine.

jreMaxMemory

Returns the maximum amount of memory that the Java virtual machine will attempt to use.

jreTotalMemory

Returns the total amount of memory in the Java virtual machine.

latestMilestone

Latest milestone that was signed off by the coordinator.

latestMilestoneIndex

Index of the latest milestone.

latestSolidSubmeshMilestone

The latest milestone which is solid and is used for sending transactions. For a milestone to become solid your local node must basically approve the submesh of coordinator-approved transactions, and have a consistent view of all referenced transactions.

latestSolidSubmeshMilestoneIndex

Index of the latest solid submesh.

peers

Number of peers you are directly connected with.

packetsQueueSize

Packets which are currently queued up.

time

Current UNIX timestamp.

tips

Number of tips in the network.

transactionsToRequest

Transactions to request during syncing process.

Suggest Edits

getTips

Returns the list of tips.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "getTips"}'
import urllib2
import json

command = {
    'command': 'getTips'
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
    'command': 'getTips'
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{
  "hashes": [
    "BMTDMVTKVAGGPAZJHPQXIQZW9YHTGXFVNUYMZMIJBPHAHSYDHTFVIZYNECSVBUQXQHPXXGWKFAT999999",
    "SDTXTJZWXG9OJDUNLGOVHFFUDIN9MTTTTQXONLTUVMNGGL9MUZSMYESKEMBPIAWVPXBXWDDQUZH999999"
  ],
  "duration": 105
}

Body Params

command
string
required
 
Field
Description

hashes

Hashes of transactions that need to be approved.

Suggest Edits

getTransactionsToApprove

Tip selection which returns trunkTransaction and branchTransaction. The input value is depth, which basically determines how many bundles to go back for finding transactions that have to be approved. Setting a higher depth value means you are contributing more to the state of the network (as you have to confirm more transactions).

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "getTransactionsToApprove", "depth": 10}'
import urllib2
import json

command = {
    'command': 'getTransactionsToApprove',
    'depth': 10
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
  'command': 'getTransactionsToApprove',
  'depth': 10 
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{
  "trunkTransaction": "TVQGOMELDDKINJNOJMXCEGMWHPESGWYWFNOZRUNUHBGXXTIASGEFLJBPIITWDOYCSRBRDLLVDHK999999", 
  "branchTransaction": "TVQGOMELDDKINJNOJMXCEGMWHPESGWYWFNOZRUNUHBGXXTIASGEFLJBPIITWDOYCSRBRDLLVDHK999999", 
  "duration": 543
}
{"error": "This operations cannot be executed: The Submesh has not been updated yet."}
{"error": "The Submesh is not solid."}

Body Params

command
string
required
depth
int32
required

Number of bundles to go back to determine the transactions for approval.

 
Field
Description

trunkTransaction

Trunk Transaction to approve.

branchTransaction

Branch Transaction to approve.

Suggest Edits

getTrytes

Returns the raw transaction data (trytes) of a specific transaction. These trytes can then be easily converted into the actual transaction object. See utility functions for more details.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "getTrytes", "hashes": ["CGWKDBEGLULSRCZVIUFKBTZYDYUWUGMXVJRTTXKBSMMNSITMAQMQNGYFNYPNGVCSHNVHDMVOOTQ999999"]}'
import urllib2
import json

command = {
    'command': 'getTrytes',
    'hashes': ['CGWKDBEGLULSRCZVIUFKBTZYDYUWUGMXVJRTTXKBSMMNSITMAQMQNGYFNYPNGVCSHNVHDMVOOTQ999999']
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
  'command': 'getTrytes',
  'hashes': ['CGWKDBEGLULSRCZVIUFKBTZYDYUWUGMXVJRTTXKBSMMNSITMAQMQNGYFNYPNGVCSHNVHDMVOOTQ999999']
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': JSON.stringify(command).length
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{ 
  trytes: [ 'RFCANSYBATOYJBSHNVPWIGLSZPDFUNIBY9SWUJUJLAOPWLDU9HUSXY9KJMJIP9JFTXXMS9OBKSWFWNMOJQCQFCFQVPUKXQVSPOSPGGCLESJKAFBUOATAIT9FWEITHAUGXRCHYBWMYBXRSK9OBCTJMWTJJLHDUPHBONEJFKKMZYGUAKONQHSCRYFVOHLURYWWORNCCEASONPQ9TBCSKXERN9SLKLGWYEDLKMZUYFFGAOBZYIIVADRVNQ9ULPEHTZYYAIIVDSDYKAXSWEVUOXKWJNMCUVBYZQHKOZVXLYBLHGXKGSWGLMNEIBREMHAZQTHOFBZTXINALZR9ANP9OSANJNS9OZVUGOWJNJQUWCWJMQHEHREXNPTCTRLNYPRREOCJXUCBBEJTX9VKBHFJTHKYHVKXAKOCXRUQUVVLJKCKL9AOWAVWYCW9ZXSKJTCJIEEUBUDDHQIYCVRTLPQVQ9PIF9TLX9EEZKIKAYOGA9LUA9ZNYVPUGHECTYOMDXQWJYRPXYLMKBKEQY9KGEPUOYPFJLUY9BVDDFKGIBNLKCMLVALUWEFJHUPACEWZLCYFJVUTCHOJLGKVLKRYRLWYLYBQGLQWWLDUABHBX9SEPLJXUFIDZWXEYQGNFNBDJVDVZFPVISV9WTIKLYECNRIWSQOOKSEMD9XSQJRGDJTWVNIMMKINBRDBGQAPFXJKDZSSPDPFCLCHRIQDLTBBFAJTDZIDRJTT9DAJUBYWMFWCMATSWJFTTHBZQSQHCH9IZKIGRSNNPBXWONFZPHQOTFPPAX9EVEHZNFZNHCZXXYZQCUAKHBLQFHKFH9JNTMBCMCDXJJDCVQXZOBHXEHAVENZPUU9OURDMMFBHOTAUIWACSDNYIUVXWNOAOFIMZBWNVBSMDF9FEKIKZJAMUZHRJFLPFWBINFYJNSALKBNHAYBVKVUVLCJYDNMHQXVASORJFXV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EKGOMEUGJLKBZRXC9MAUDXNTYFQJS9F9OS9HHBEKMVQJOIKYHOCLKIKBXXJZPLLSNMWXRJUAY9UACOYMLBSAREMBUGPPODDJAQRZQRFWHWJBJGLETOUUOKEPXRSVCPEXDMAPPHODSQKYOUQQIXLF9CJJQPRNDFYQUO9VIAQYCREJJPFUDGHZSMDORPCAFJJJNEEWZSP9OCQZAHCAVPBAXUTJKRCYZXMSNGERFZLQPNWOQQHK9RMJO9PNSVV9KR9DONH999999999999999999999999999HSF999999999999999999999999QJHQHWD99999999999A99999999POXARQSLTL9DFTIPZTOSYWLXWPLTGLEOCBWIWLIVWPQNPDRFWXBVNOCFBUPRMDFZY9IPXJTKNZYJZWMITRSDQBRUXKGBU9I9JXTMKAUOVYCBWOMQQKYD99FXYDXZHZ9DDUUHXIWLXGFHPVBDBFESABJQCRNZ999999GCLFOAQL9MMBE9VNH9FDEHQMAGINIQOZEYEWBYPNEQTWYSOIHNDHPWHTSNJVU9QTNTLRHUSATJX999999YMFHXIXTCVGHIFJBBAECAVSHKKTRDDZTQIHVK9AKJA9WHVJHAHWBICCVWAIWAZ9VFPX9GYPRKACBHZLA9' 
          ] 
}
{"error": "Invalid parameters."}
{"error": "Wrong arguments."}
{"error": "Invalid hash input."}

Body Params

command
string
required
 
Field
Description

trytes

Raw trytes.

Suggest Edits

interruptAttachingToMesh

Interrupts and completely aborts the attachToMesh process.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "interruptAttachingToMesh"}'
import urllib2
import json

command = {
    'command': 'interruptAttachingToMesh'
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
    'command': 'interruptAttachingToMesh'
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned

Body Params

command
string
required
 
Suggest Edits

storeTransactions

Store transactions into the local storage. The trytes to be used for this call are returned by attachToMesh.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "storeTransactions", "trytes": ["BHEXYPFRIGBSBGQLPFPEROJRJIYFNUNLYZHXNJY9FOQXTXXFIIODEBYENQVKJBHOBZFHATCUGHKGNXFOQO9TDIOVGKJJILQURSZKLNPIUUOVHUG9SGRRGUDTGLLUSFA9NOZNFRCRTPDEQQIBIEDMYQKHVJPUBTOQNKGQX9ZRSKWQUALHRUNKIBQMFFRHZVISUSXMYCLVHODMNT9MKFJXRBAGKL9PQSIHT9ILVO99ASTOUWZSDVSAJNPYQSSWQHLDAOPXYSTNQTUUNE9ALBVRYAJGKIJTASKSZNYYSTXHYDUSJNFDIPIFYAXPMQUGQRMMADQBXBATNMWZSYBDAGFPTLDQTMUVEYNRBQXOTQMTEZHVJZEKE9HHGKLUUCAFTJBQNJUQCIACPZWU9S9TEMQKEP9SKGSLLHVLPHQVVTTNCAFGPGRHROPFHJGDTPGXNK9PZQASVXVLDHYTJRMCQWFQZFFFNJZFVQDZE9HMATDIWIJHNNCIHASXOLHZWMPICZHEFUDYZYOWBTSGMDDPILBCPGFKIMTNZFCUJKEAUIASKGCCQGEW9QZ9TSNQHAFYYJSTHOKOLGPXYVQZXNPVUGQMOIJWZZYGVYXXFCUCNLAAXSEGHRONQKFCRHHWFIKJFDVA9NCMXTAKRRIMJJUXJGZYQOGQUZEBTCDYQBLLRHKHPJRQRVGYGQKOGCQBJHPJLVDRWHJCSSMUIXBJGMJLGCYYMDBGPEEQTNDLKLGYZDKXEDDCJUCC9ETMCWPJUDGENHOLPGJGZVMBIBUXMACX9RKSXRSGQYAUFIDVIEIIKAASCWMRSZNDVGHCE9DLWHYGDTFKUT9SJKJQXFJCMGKLWXTJQOXBPNHEUWGZFCAPPSVIJKATJNFDPVCKLCTNOTOLEOTXL9CBDJFWWHWGHWAW9PGLJVAUNVKAMJXMGZCD9CZZVRWBV9UMBSKCSE9MBXVUEKSD9CPVDRJAAVWVHOQNQZZAORZVYSDQVLWRHNYOVBEO9YDXZGZQVLADMLGDQYFWSWLBB9KNCDL9JOXLTNSIDFVKOKPBBIT9VIQQZFANVAPKEYUIUELVVZCLTPSKRWJXUWAUZCXLJYYYOCTUUOYQOSYUVJNCJHGKMWPU99XLE9NASIXDTBQNSQG9RHWZTSFEBESALSMNJQPVNAIVRHUNRHCGDVHIOEDJSCKBSIQZKOXTOJUKQH9Q9LYWIHLMJIHYKDABVNIBQCINEMVUYHXTPDMUSGKS9XQV9ZHQDGNLAOJVCWRPHDCYUFOTXBXZHVVAQ9DFLUVMQKFHLXASTVIHZWKDMLUNQWJQUBYXDHCLKBCDXZLGQYDJHECJSYANQCAIEFF9QCGZVNSXZIVOCZZTYGCOTCIHAMSFGCPHVR9XNXZIZJX9CNYEYHHICMLTKUOCGTFBMHLDTUBOQSGE9KJOLQOJW9ARHSRXQTJTHHYVVXWMDWOWPAIG9GXYVMVHUDTXIHLMZCGOSICRCSCDBFVBNT9M9ZHOXMNTOEGUDDCGD9UXPZMGIGVOTDAOSHCGTXUTUSIXEMGS9TAVODXTYNZYUYOPFHF9NQAXE9YJLFXAYJYZMCG9HZTFHRUCOTTJLJAQWXWFTWICDGRQMIJEKTRWSIIK999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999DAQRHWD99A99999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OGCQBJHPJLVDRWHJCSSMUIXBJGMJLGCYYMDBGPEEQTNDLKLGYZDKXEDDCJUCC9ETMCWPJUDGENHOLPGJGZVMBIBUXMACX9RKSXRSGQYAUFIDVIEIIKAASCWMRSZNDVGHCE9DLWHYGDTFKUT9SJKJQXFJCMGKLWXTJQOXBPNHEUWGZFCAPPSVIJKATJNFDPVCKLCTNOTOLEOTXL9CBDJFWWHWGHWAW9PGLJVAUNVKAMJXMGZCD9CZZVRWBV9UMBSKCSE9MBXVUEKSD9CPVDRJAAVWVHOQNQZZAORZVYSDQVLWRHNYOVBEO9YDXZGZQVLADMLGDQYFWSWLBB9KNCDL9JOXLTNSIDFVKOKPBBIT9VIQQZFANVAPKEYUIUELVVZCLTPSKRWJXUWAUZCXLJYYYOCTUUOYQOSYUVJNCJHGKMWPU99XLE9NASIXDTBQNSQG9RHWZTSFEBESALSMNJQPVNAIVRHUNRHCGDVHIOEDJSCKBSIQZKOXTOJUKQH9Q9LYWIHLMJIHYKDABVNIBQCINEMVUYHXTPDMUSGKS9XQV9ZHQDGNLAOJVCWRPHDCYUFOTXBXZHVVAQ9DFLUVMQKFHLXASTVIHZWKDMLUNQWJQUBYXDHCLKBCDXZLGQYDJHECJSYANQCAIEFF9QCGZVNSXZIVOCZZTYGCOTCIHAMSFGCPHVR9XNXZIZJX9CNYEYHHICMLTKUOCGTFBMHLDTUBOQSGE9KJOLQOJW9ARHSRXQTJTHHYVVXWMDWOWPAIG9GXYVMVHUDTXIHLMZCGOSICRCSCDBFVBNT9M9ZHOXMNTOEGUDDCGD9UXPZMGIGVOTDAOSHCGTXUTUSIXEMGS9TAVODXTYNZYUYOPFHF9NQAXE9YJLFXAYJYZMCG9HZTFHRUCOTTJLJAQWXWFTWICDGRQMIJEKTRWSIIK999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999DAQRHWD99A99999999A99999999VSIEYBNRKEGNKNWYJASK9JBZKYCSOOBBYUZRP9NMPIWRFTELRONZSZEUVBANLHFXYDHDIFNTCZJRGKRWVSEOPZBLXMYUR9XOTVPZKOVVTIBDVMYAQCF9TXKYUBCY9WFGUUJXYDGIKUPMLAKLIBLWZKVKLSTT999999RLQBJJHKDGCAXOCGCPYMPX9SKXK9HGTJKT9JQUOEZXIHEOGEABRNBMTXIDBOWGYESQCQGBPQTEB999999RAPNXVJRYCBIKYW9IMEKDDBNKSVOPKYHLDKZSNFEEICKEEJJCOSMFATAWFPKOZQMYRK9CFMMLIXV9AJWP']
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
  'command': 'storeTransactions',
  'trytes': ['BHEXYPFRIGBSBGQLPFPEROJRJIYFNUNLYZHXNJY9FOQXTXXFIIODEBYENQVKJBHOBZFHATCUGHKGNXFOQO9TDIOVGKJJILQURSZKLNPIUUOVHUG9SGRRGUDTGLLUSFA9NOZNFRCRTPDEQQIBIEDMYQKHVJPUBTOQNKGQX9ZRSKWQUALHRUNKIBQMFFRHZVISUSXMYCLVHODMNT9MKFJXRBAGKL9PQSIHT9ILVO99ASTOUWZSDVSAJNPYQSSWQHLDAOPXYSTNQTUUNE9ALBVRYAJGKIJTASKSZNYYSTXHYDUSJNFDIPIFYAXPMQUGQRMMADQBXBATNMWZSYBDAGFPTLDQTMUVEYNRBQXOTQMTEZHVJZEKE9HHGKLUUCAFTJBQNJUQCIACPZWU9S9TEMQKEP9SKGSLLHVLPHQVVTTNCAFGPGRHROPFHJGDTPGXNK9PZ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HOXMNTOEGUDDCGD9UXPZMGIGVOTDAOSHCGTXUTUSIXEMGS9TAVODXTYNZYUYOPFHF9NQAXE9YJLFXAYJYZMCG9HZTFHRUCOTTJLJAQWXWFTWICDGRQMIJEKTRWSIIK999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999DAQRHWD99A99999999A99999999VSIEYBNRKEGNKNWYJASK9JBZKYCSOOBBYUZRP9NMPIWRFTELRONZSZEUVBANLHFXYDHDIFNTCZJRGKRWVSEOPZBLXMYUR9XOTVPZKOVVTIBDVMYAQCF9TXKYUBCY9WFGUUJXYDGIKUPMLAKLIBLWZKVKLSTT999999RLQBJJHKDGCAXOCGCPYMPX9SKXK9HGTJKT9JQUOEZXIHEOGEABRNBMTXIDBOWGYESQCQGBPQTEB999999RAPNXVJRYCBIKYW9IMEKDDBNKSVOPKYHLDKZSNFEEICKEEJJCOSMFATAWFPKOZQMYRK9CFMMLIXV9AJWP']
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{ }
{"error": "Invalid parameters."}
{"error": "Invalid trytes input."}

Body Params

command
string
required
trytes
string
required

List of raw data of transactions to be rebroadcast.

 
Suggest Edits

Peer Discovery

 

Following API calls are used for the peer discovery, thus it's not needed to call any of them manually. The commands are still listed and explained below.

Suggest Edits

addPeer

Connect your Node to the receiving peer of this command. Note that you can only add your own Node with this command and your request might be refused if the receiving peer already reached maxPeers. The port specified has to be the ARI Meshport. Peers will be saved after ARI is closed.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "addPeer", "uri": "tcp://1.2.3.4:14265", "type": "ipv4"}'
import urllib2
import json

command = {
  'command': 'addNeighbors',
  'uri': 'tcp://1.2.3.4:14265',
  'type': 'ipv4'
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
  'command': 'addNeighbors',
  'uri': 'tcp://1.2.3.4:14265',
  'type': 'ipv4'
}

var headers = {
    'Content-Type': 'application/json',
    'Content-Length': JSON.stringify(command).length
};

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{"addedPeer" : 0}
{"error": "Invalid parameters."}
{"error": "Failure adding peer."}

Body Params

command
string
required
uri
string
required

IP address in URI format to push to the remote node.

type
string
required

IPmode the pushing node is running in either: 'ipv4', 'ipv6' or 'mixed'. If a wrong mode is supplied for the given IP the request will be denied.

 
Field
Description

addedPeer

Returns either 0 if your node was already added in a previous call, 1 if it was added now or -1 if it was refused.

Suggest Edits

getPeerAddresses

Returns the peers you are connected to and the IPmode they are running in. If your node is running dualstack / mixed IP mode this will return IPv6 addresses for other mixed nodes. In IPv4 mode only IPv4 addresses are returned.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "getPeerAddresses"}'
import urllib2
import json

command = {
    'command': 'getPeerAddresses'
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
    'command': 'getPeerAddresses'
}

var headers = {
    'Content-Type': 'application/json',
    'Content-Length': JSON.stringify(command).length
};

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{
  "peerlist": [
    "[2001:db8:a0b:12f0::1]:14265|mixed",
    "158.69.12.134:14265|ipv4",
    "27.23.255.2:14265|ipv4",
  ],
  "duration": 2
}

Body Params

command
string
required
 
Field
Description

peerlist

List of addresses and their IPmode. Format: "http://ip:meshport|ipmode". ipmode := ipv4 || ipv6 || mixed.

Suggest Edits

ping

Returns callers IP address.

 
posthttp://localhost:14266
curl http://localhost:14266 \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"command": "ping"}'
import urllib2
import json

command = {
    'command': 'ping'
}

stringified = json.dumps(command)

headers = {'content-type': 'application/json'}

request = urllib2.Request(url="http://localhost:14266", data=stringified, headers=headers)
returnData = urllib2.urlopen(request).read()

jsonData = json.loads(returnData)

print jsonData
var request = require('request');

var command = {
    'command': 'ping'
}

var options = {
  url: 'http://localhost:14266',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': Buffer.byteLength(JSON.stringify(command))
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});
A binary file was returned
{
  "ip": "109.15.23.2",
  "duration": 0
}

Body Params

command
string