Getting started with Node.js and delion.io to use IOTA Tangle
The full article was originally published by Malik Dakdaki on Medium. Read the full article here.
Some months passed since the first introduction of delion.io, the first Tangle-as-a-Service provider. Meanwhile we managed to stabilize and optimize the API to interact with the IOTA Tangle thanks to the valuable feedback from the community as well as startups and some corporates (which overwhelmed us a lot in a positive way!).
In our previous article we gave a rough outline on how delion.io works based on an example we call API-Splitting. We showed the role of delion.io which acts as a facilitator for app developers and consumers to leverage the potential of IOTAs Distributed Ledger called Tangle.
Today we are going to get our hands dirty and learn how to write some lines of code using Node.js to create, execute and check transactions on the Tangle using delion.io API.
Installed and running latest stable version of Node.js
Code highlighting editor, we recommend using Visual Studio Code
Account on delion.io
Familiarize with the developer docs of delion.io
The structure of this blog post is straightforward. We walk you through the single steps from the beginning to the end to complete a transaction.
- Create Payment
- Execute Payment
- Check for Payment status
To use the API it is necessary to have an account on delion.io, which handles all of the transaction management in the background for you. There is no need to know about Trits, Trytes, Nodes, Proof-of-Work, Addresses etc.
The signup to delion.io requires a unique email and a strong password. The password policy is as follows: minimum of 10 digits, at least 1 lower-case character, at least 1 uppercase character, at least 1 number and at least 1 symbol.
After signup, a confirmation email is sent to you. Click on the link within the email to complete the signup. If the mail does not arrive within 2 minutes, check your spam folder of your mail provider. If still no confirmation mail arrives, please let us know and send us an email to email@example.com
Option 1: delion management console
This option refers to human centric signups, where you want to create an account for yourself or some devices for your smart home. Just go to https://console.delion.io/#/auth/register and you will see this screen.
Option 2: Via API
The API options allows to create accounts via batch or other automated processes. Below is a code example to achieve this.