blockcluster

3.0.1 • Public • Published

blockcluster

build status code coverage code style styled with prettier made with lass license

Official BlockCluster Node.js SDK for Dynamo and Platform APIs

Table of Contents

Install

npm:

npm install blockcluster

yarn:

yarn add blockcluster

Usage

Here is an example script showing how to create an asset type, issue assets and fetch assets:

const Blockcluster = require('blockcluster');
 
const node = new Blockcluster.Dynamo({
    locationDomain: 'app-ap-south-1b.blockcluster.io', //enter your node's location domain
    instanceId: 'noeurgyb' //enter your instanceId
});
 
//create license solo asset type
await node.callAPI('assets/createAssetType', {
    assetType: 'solo',
    assetName: 'license',
    fromAccount: node.getWeb3().eth.accounts[0]
});
 
//issue a license
await node.callAPI('assets/issueSoloAsset', {
    assetName: 'license',
    fromAccount: node.getWeb3().eth.accounts[0],
    toAccount: node.getWeb3().eth.accounts[0],
    identifier: '1234'
});
 
//get asset info
const assetInfo = await node.callAPI('assets/getSoloAssetInfo', {
    assetName: 'license',
    identifier: '1234'
});

Here is an another example script showing how to create stream using an offline account:

const Wallet = require('ethereumjs-wallet');
 
const wallet = Wallet.generate();
const privateKey = wallet.getPrivateKey().toString('hex');
const address = '0x' + wallet.getAddress().toString('hex');
 
await node.callAPI(
    'streams/create',
    {
        streamName: 'renew',
        fromAccount: address
    },
    {
        privateKey
    }
);

Docs

Documentation of Dynamo's REST APIs and their usage is available at https://node.api.blockcluster.io

Contributors

Name Website
BlockCluster https://www.blockcluster.io
Jibin Mathews https://www.jibinmathews.in
Narayan Prusty https://www.github.com/narayanprusty
Saikat Chakrabortty https://www.github.com/saikatharryc

License

MIT © BlockCluster

Package Sidebar

Install

npm i blockcluster

Weekly Downloads

20

Version

3.0.1

License

MIT

Unpacked Size

2.27 MB

Total Files

112

Last publish

Collaborators

  • narayanprusty