Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
95 lines (81 sloc) 3.31 KB


IOTA Proof of Concept, service that stores MQTT messages on the tangle.


IOTA Javascript Library Hello World Tutorial


Make sure you have Node.js and the Heroku Toolbelt installed.

Node Packages

Using iota.lib.js to connect to IOTA tangle. Open Source

Using MQTT.js as MQTT client. Open Source

Using Async to handle queues. Open Source

Using node-cleanup to properly close connections on exit. Open Source

Using url to parse full URL. Open Source

Cloning & Running locally

git clone # or clone your own fork
cd iota-mqtt-poc
npm install
heroku local

Environmental Variables


    • MQTT Broker connection url with optional user/password parameters.
    • Example: 'mqtt://[user:pass@]localhost:1883'
    • Prefix to use on the MQTT client ID, followed by an 8-char string (pseudo)randomly generated using Math.random() .
    • Example: 'iota_poc_' resulting in iota_poc_3bc3eb87
    • MQTT Topic to subscribe to, with support for # and +.
    • Example: '/devices/+'


    • Host of the IOTA Node to be used. IP and host names supported.
    • Example: '' or 'http://localhost'
    • Port of the IOTA Node to be used.
    • Example: 14265
    • IOTA Address to send the transactions to.
    • Example: '999999999999999999999999999999999999999999999999999999999999999999999999999999999'
    • IOTA Seed for sending the transactions from.
    • Example: '999999999999999999999999999999999999999999999999999999999999999999999999999999999'
    • IOTA Seed for bundling transactions. Maximum of 13 ascii chars.
    • Example: ’iota-mqtt-poc’

Setting Environmental Vars

Locally using .env file.

Create a new file named .env and place it on the root directory, next to package.json.

MQTT_FULL_URL = 'mqtt://[user:pass@]localhost:1883'
MQTT_CLIENT_PREFIX = 'iota_poc_'
MQTT_TOPIC = '/devices/+'
IOTA_PORT = 14265
IOTA_ADDRESS = '999999999999999999999999999999999999999999999999999999999999999999999999999999999'
IOTA_SEED = '999999999999999999999999999999999999999999999999999999999999999999999999999999999'
IOTA_TAG = 'iota-mqtt-poc'

Remotely using Heroku Toolbet

Requires an existing Heroku App, see “Deploying to Heroku” for more info

For each var use command config:set to set the values, if the value is already set it will be replaced.

heroku config:set IOTA_HOST=''
heroku config:set IOTA_PORT=14265

To view current state of your vars:

heroku config

Deploying to Heroku (Optional)

heroku create
git push heroku master

Open remote App

heroku open