3.0.1 • Published 5 years ago

blockcluster v3.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
5 years ago

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

NameWebsite
BlockClusterhttps://www.blockcluster.io
Jibin Mathewshttps://www.jibinmathews.in
Narayan Prustyhttps://www.github.com/narayanprusty
Saikat Chakraborttyhttps://www.github.com/saikatharryc

License

MIT © BlockCluster

3.0.1

5 years ago

2.0.1

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.0.3

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago