Git Product home page Git Product logo

iota-mqtt-poc's Introduction

iota-mqtt-poc

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

Background

IOTA Javascript Library Hello World Tutorial

Requirements

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 [email protected]:nicoschtein/iota-mqtt-poc.git # or clone your own fork
cd iota-mqtt-poc
npm install
heroku local

Environmental Variables

MQTT

  • MQTT_FULL_URL
    • MQTT Broker connection url with optional user/password parameters.
    • Example: 'mqtt://[user:pass@]localhost:1883'
  • MQTT_CLIENT_PREFIX
    • 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
    • MQTT Topic to subscribe to, with support for # and +.
    • Example: '/devices/+'

IOTA

  • IOTA_HOST
    • Host of the IOTA Node to be used. IP and host names supported.
    • Example: 'http://127.0.0.1' or 'http://localhost'
  • IOTA_PORT
    • Port of the IOTA Node to be used.
    • Example: 14265
  • IOTA_ADDRESS
    • IOTA Address to send the transactions to.
    • Example: '999999999999999999999999999999999999999999999999999999999999999999999999999999999'
  • IOTA_SEED
    • IOTA Seed for sending the transactions from.
    • Example: '999999999999999999999999999999999999999999999999999999999999999999999999999999999'
  • IOTA_TAG
    • 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_HOST = 'http://127.0.0.1'
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='http://127.0.0.1'
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

iota-mqtt-poc's People

Contributors

embeddedandroid avatar nicoschtein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

iota-mqtt-poc's Issues

Invalid Checksum in address

Getting an 'Invalid checksum address' when using the 90 character tryte address to send transaction. If i remove the checksum using iota.utils.noChecksum(), the transaction goes through but i cannot retrieve it on front end.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.