Overledger JavaScript SDK

Welcome to the developer's guide to use the Overledger SDK written in Javascript by Quant Network.

Introduction to the Overledger SDK

Overledger is a blockchain operating system that allows applications to connect to multiple distributed ledger technologies (DLTs) or blockchains, thus becoming Multi-chain Applications (MApps). The Overledger SDK enables developers to create signed transactions and send them simultaneously to all supported DLTs through the Overledger Blockchain Programming Interface (BPI).

Technologies

The Overledger SDK is a collection of node packages written in Typescript. Currently, the supported DLTs are Ethereum and Ripple. Bitcoin support will be re-enabled once the migration to the public testnet is complete.

Prerequisites

  • Register for a free developer account on Quant Developer's Portal
  • You will require a MApp ID and BPI key:
    • Register your application in order to get a free MApp ID.
    • Verify your Quant token, and create a BPI key.
  • Node.js 10

Installation

The Overledger SDK can be installed as a node module. If all supported DLTs are necessary, the bundle package can be installed, which will include all required dependencies.

npm install @quantnetwork/overledger-bundle

Alternatively, the suite of packages allows developers to chose which blockchains/DLTs they would like to utilise by installing the core package and the individual DLT packages.

npm install @quantnetwork/overledger-core
npm install @quantnetwork/overledger-ethereum

Getting started

Initialize the SDK with the available DLTs. Optionally, a timeout period can be specified (by default it is 5000ms).

const OverledgerSDK = require("@quantnetwork/overledger-bundle").default;

const overledger = new OverledgerSDK("mappId", "bpiKey", {
  dlts: [{ dlt: "ethereum" }, { dlt: "ripple" }],
  timeout: 1500, // Optional
  provider: { network: 'testnet' }, // Optional
});

API Reference

The SDK packages provide functions for interacting with the Overledger BPI Gateway as well as support for offline account generation and transaction signing. The functions which interact with the Overldger BPI (send, get) return a promise with a standard Axios response which includes the BPI data in the data field.

Please check the examples folder for details on how to sign and send transactions, as well as do account queries. The api reference page can be found here.

Examples

Examples can be found in the examples folder.

Don't forget to setup your mappId and bpiKey, you can get these on the developer portal.

Development

The Overledger JavaScript SDK manages multiple packages through Lerna. To develop the SDK, first install lerna:

npm install -g lerna

To build the project, download the yarn package manager and run:

yarn run build

This will build and link the packages together.

Running tests

Make your changes and then from the root directory:

yarn test

To run tests on a specific package, change directories to that specific package and run the test command there.

Documentation

Please update the documentation after your changes by editing the JSDoc annotations inside the source files and then run the following command from the root directory:

yarn run docs

License

The Apache 2.0 license can be found here.

License Maven Central

Overledger Java SDK

Developer's guide to use the Overledger SDK written in Java by Quant Network.

Introduction to the Overledger SDK

Overledger is an operating system that allows distributed apps (MApps) to connect to multiple distributed ledger technologies (DLTs) or blockchains. The Overledger SDK allows developers to create signed transactions & send them simultaneously to all supported DLTs.

Technologies

The Overledger SDK is maven compatible dependency written in Java

Overledger SDK Structure

Project Layer

Overledger SDK Working Flow

Project Flow

Prerequisites

  • Register for a free developer account on Quant Developer's Portal
  • You will require MAppId and access key:
    • Enter information regarding your application in order to get a MApp ID.
    • Verfify your Quant token, and create a access key.

Installation

Developers would have to install the Overledger SDK as a maven dependency.

<!-- SDK bundle -->
<dependency>
    <groupId>network.quant</groupId>
    <artifactId>overledger-sdk-bundle</artifactId>
    <version>1.0.0-alpha.3</version>
</dependency>

Tailored installation

When a full implementation of all dependencies is not required, it can be tailored to only implement those services that will be utilised.

overledger-sdk-api

API module defines Overledger SDK interfaces.

overledger-sdk-essential

This module gives a basic implementation of Overledger SDK API.

overledger-sdk-bitcoin

This module contains Bitcoin implementation of Overledger Account API.

overledger-sdk-ethereum

This module contains Ethereum implementation of Overledger Account API.

overledger-sdk-ripple

This module contains Ripple implementation of Overledger Account API.

overledger-sdk-bundle

This module bundles up API, essential, Bitcoin, Ethereum and Ripple modules.

Getting started

  • Follow README from overledger-sdk-api to create context.properties.

  • Then load properties into OverledgerContext

OverledgerContext.loadContext(...);
  • Instance OverledgerSDK Object, add accounts, and call Overledger SDK methods.
public class OverledgerSDKExample {

    private OverledgerSDK overledgerSDK;

    public OverledgerSDKExample(Account... accounts) {
        this.overledgerSDK = DefaultOverledgerSDK.newInstance(NETWORK.MAIN);
        this.overledgerSDK.addAccount(DLT.bitcoin.name(), accounts[0]);
        this.overledgerSDK.addAccount(DLT.ethereum.name(), accounts[1]);
        this.overledgerSDK.addAccount(DLT.ripple.name(), accounts[2]);
    }

    public OverledgerTransaction writeTransaction(OverledgerTransaction ovlTransaction) {
        return this.overledgerSDK.writeTransaction(ovlTransaction);
    }

}

Further information

This SDK acts as library for embedding in an application, and facilitates the execution and access of Quant Network's Overledger.

Refer wiki for more Details.

Stable Release Version JDK Version compatibility BPI Version compatibility Release Date
1.0.0-alpha 11+ 1.0.0-alpha *30/10/2018
1.0.0-alpha.1 11+ 1.0.0-alpha.1 *17/12/2018
1.0.0-alpha.2 11+ 1.0.0-alpha.1 *26/02/2019
1.0.0-alpha.3 11+ 1.0.0-alpha.2 *15/04/2019

Release notes

Release Notes
1.0.0-alpha v1.0.0-alpha release notes
1.0.0-alpha.1 v1.0.0-alpha.1 release notes
1.0.0-alpha.2 v1.0.0-alpha.2 release notes
1.0.0-alpha.3 v1.0.0-alpha.3 release notes