All Projects → iotaledger → Iota.js

iotaledger / Iota.js

Licence: mit
IOTA JavaScript monorepo

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Iota.js

Ttn
The Things Network Stack V2
Stars: ✭ 440 (-52.23%)
Mutual labels:  iot, internet-of-things
Californium
CoAP/DTLS Java Implementation
Stars: ✭ 521 (-43.43%)
Mutual labels:  iot, internet-of-things
Openhab Core
Core framework of openHAB
Stars: ✭ 472 (-48.75%)
Mutual labels:  iot, internet-of-things
Paho.mqtt.embedded C
Paho MQTT C client library for embedded systems. Paho is an Eclipse IoT project (https://iot.eclipse.org/)
Stars: ✭ 887 (-3.69%)
Mutual labels:  iot, internet-of-things
Attifyos
Attify OS - Distro for pentesting IoT devices
Stars: ✭ 615 (-33.22%)
Mutual labels:  iot, internet-of-things
Ockam
End-to-end encrypted messaging and mutual authentication between cloud and edge-device applications
Stars: ✭ 395 (-57.11%)
Mutual labels:  iot, internet-of-things
Iotex Core
Official implementation of IoTeX blockchain protocol in Go.
Stars: ✭ 505 (-45.17%)
Mutual labels:  iot, internet-of-things
Wakaama
Eclipse Wakaama is a C implementation of the Open Mobile Alliance's LightWeight M2M protocol (LWM2M).
Stars: ✭ 358 (-61.13%)
Mutual labels:  iot, internet-of-things
Windows Iotcore Samples
Official code samples repository for Windows 10 Internet of Things (IoT)
Stars: ✭ 580 (-37.02%)
Mutual labels:  iot, internet-of-things
Iot Firstep
一个物联网(IoT)开发的入门教程。涉及单片机、上位机、移动应用、服务器后台开发的知识。以及蓝牙4.0、以太网模块的使用实例。
Stars: ✭ 555 (-39.74%)
Mutual labels:  iot, internet-of-things
Pytradfri
IKEA Trådfri/Tradfri API. Control and observe your lights from Python. Examples available. On pypi. Sans-io.
Stars: ✭ 778 (-15.53%)
Mutual labels:  iot, internet-of-things
Sitewhere
SiteWhere is an industrial strength open-source application enablement platform for the Internet of Things (IoT). It provides a multi-tenant microservice-based infrastructure that includes device/asset management, data ingestion, big-data storage, and integration through a modern, scalable architecture. SiteWhere provides REST APIs for all system functionality. SiteWhere provides SDKs for many common device platforms including Android, iOS, Arduino, and any Java-capable platform such as Raspberry Pi rapidly accelerating the speed of innovation.
Stars: ✭ 788 (-14.44%)
Mutual labels:  iot, internet-of-things
Cylon
JavaScript framework for robotics, drones, and the Internet of Things (IoT)
Stars: ✭ 3,862 (+319.33%)
Mutual labels:  iot, internet-of-things
Hivemq Mqtt Client
HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
Stars: ✭ 402 (-56.35%)
Mutual labels:  iot, internet-of-things
Kura
Eclipse Kura™ project - http://eclipse.org/kura
Stars: ✭ 369 (-59.93%)
Mutual labels:  iot, internet-of-things
Leshan
Eclipse Leshan is an OMA Lightweight M2M (LWM2M) implementation in Java.
Stars: ✭ 483 (-47.56%)
Mutual labels:  iot, internet-of-things
Iota.py
PyOTA: The IOTA Python API Library
Stars: ✭ 337 (-63.41%)
Mutual labels:  iota, internet-of-things
Freedomotic
Open IoT Framework
Stars: ✭ 354 (-61.56%)
Mutual labels:  iot, internet-of-things
Esphome Core
🚨 No longer used 🚨 - The C++ framework behind ESPHome
Stars: ✭ 545 (-40.83%)
Mutual labels:  iot, internet-of-things
Upm
UPM is a high level repository that provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platform through calls to MRAA APIs.
Stars: ✭ 622 (-32.46%)
Mutual labels:  iot, internet-of-things


The official JavaScript client library for interacting with the Tangle

Developer documentation portal

Discord StackExchange MIT license Supported IRI API endpoints Code quality Build status

AboutPrerequisitesInstallationGetting startedAPI referenceExamplesSupporting the projectJoining the discussion


About

This is the official JavaScript client library, which allows you to do the following:

  • Create transactions
  • Sign transactions
  • Generate addresses
  • Interact with an IRI node

This is beta software, so there may be performance and stability issues. Please report any issues in our issue tracker.

Prerequisites

To use the library, your computer must have one of the following supported versions of Node.js:

  • Node.js 10 or higher. Recommended version is latest LTS.
  • Node.js 8

To install library packages, your computer must have one of the following package managers:

A package.json file is required. It can be generated with npm init or yarn init

Installation

To install the IOTA JavaScript client library and its dependencies, you can use one of the following options:

  • Install the library with npm
    npm install @iota/core
    
  • Install the library with Yarn
    yarn add @iota/core
    

Getting started

After you've installed the library, you can connect to an IRI and interface with it.

An extended guide can be found on our documentation portal, we strongly recommend you to go here for starting off. A quick starting tutorial is shown below.

To connect to a local IRI node, do the following:

import { composeAPI } from '@iota/core'

const iota = composeAPI({
    provider: 'http://localhost:14265'
})

iota.getNodeInfo()
    .then(info => console.log(info))
    .catch(error => {
        console.log(`Request error: ${error.message}`)
    })

API reference

For details on all available API methods, see the reference page.

Examples

We have a list of test cases in the examples directory that you can use as a reference when developing apps with IOTA.

Here's how you could send a zero-value transaction and read the message in it from the Tangle, using the library. For the guides, see the documentation portal.

const Iota = require('@iota/core');
const Converter = require('@iota/converter');
const Extract = require('@iota/extract-json')

// Connect to a node
const iota = Iota.composeAPI({
  provider: 'https://nodes.devnet.thetangle.org:443'
});

const depth = 3;
const minimumWeightMagnitude = 9;

// Define a seed and an address.
// These do not need to belong to anyone or have IOTA tokens.
// They must only contain a mamximum of 81 trytes
// or 90 trytes with a valid checksum
const address =
  'HEQLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWOR99D';
const seed =
  'PUEOTSEITFEVEWCWBTSIZM9NKRGJEIMXTULBACGFRQK9IMGICLBKW9TTEVSDQMGWKBXPVCBMMCXWMNPDX';

// Define a JSON message to send.
// This message must include only ASCII characters.
const message = JSON.stringify({"message": "Hello world"});

// Convert the message to trytes
const messageInTrytes = Converter.asciiToTrytes(message);

// Define a zero-value transaction object
// that sends the message to the address
const transfers = [
  {
    value: 0,
    address: address,
    message: messageInTrytes
  }
];

// Create a bundle from the `transfers` array
// and send the transaction to the node
iota
  .prepareTransfers(seed, transfers)
  .then(trytes => iota.sendTrytes(trytes, depth, minimumWeightMagnitude))
  .then(bundle => {
    // The message can be read from the Tangle, using the tail transaction hash
    const tailTransactionHash = bundle[0].hash; // NOLIVEQNRHIIRPDPHYTGJOVSGOUXVAACDNAPNTTRFNNCVNJMDZFPURTDNVTAKHPSLSJRYZGQHYBBAE999

    console.log(tailTransactionHash);

    // Get the tail transaction's bundle from the Tangle
    return iota.getBundle(tailTransactionHash)
      .then(bundle => {
        // Get your hello world message from the transaction's `signatureMessageFragment` field and print it to the console
        console.log(JSON.parse(Extract.extractJson(bundle)));
      })
  })
  .catch(err => {
    console.error(err)
  });

Supporting the project

If the IOTA JavaScript client library has been useful to you and you feel like contributing, consider posting a bug report, feature request or a pull request.

See the contributing guidelines for more information.

Cloning and bootstrapping the repository on GitHub

  1. Click the Fork button in the top-right corner

  2. Clone your fork and change directory into it

  3. Bootstrap your environment by doing the following:

    npm run init
    

This step will download all dependencies, build and link the packages together. iota.js uses Lerna to manage multiple packages. You can re-bootstrap your setup at any point with lerna bootstrap command.

Running tests

Make your changes on a single package or across multiple packages and test the system by running the following from the root directory:

npm test

To run tests of specific package, change directory into the package's directory and run npm test from there.

Updating documentation

Please update the documention when needed by editing JSDoc annotations and running npm run docs from the root directory.

Joining the discussion

If you want to get involved in the community, need help with getting setup, have any issues related with the library or just want to discuss IOTA, Distributed Registry Technology (DRT) and IoT with other people, feel free to join our Discord.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].