https://github.com/blockclusterapp/blockcluster-node
Official BlockCluster Node.js SDK for Dynamo, Paymeter, Hyperion and Platform APIs
https://github.com/blockclusterapp/blockcluster-node
assets-management blockchain blockchain-as-a-service decentralized-storage private-blockchain proxy-re-encryption wallets-management
Last synced: 3 months ago
JSON representation
Official BlockCluster Node.js SDK for Dynamo, Paymeter, Hyperion and Platform APIs
- Host: GitHub
- URL: https://github.com/blockclusterapp/blockcluster-node
- Owner: BlockClusterApp
- License: mit
- Created: 2018-09-11T16:29:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-29T07:05:35.000Z (about 6 years ago)
- Last Synced: 2025-03-20T11:13:53.952Z (3 months ago)
- Topics: assets-management, blockchain, blockchain-as-a-service, decentralized-storage, private-blockchain, proxy-re-encryption, wallets-management
- Language: JavaScript
- Homepage: https://www.blockcluster.io
- Size: 1.71 MB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# blockcluster
[](https://travis-ci.org/BlockClusterApp/blockcluster-node)
[](https://codecov.io/gh/BlockClusterApp/blockcluster-node)
[](https://github.com/sindresorhus/xo)
[](https://github.com/prettier/prettier)
[](https://lass.js.org)
[](LICENSE)> Official BlockCluster Node.js SDK for Dynamo and Platform APIs
## Table of Contents
* [Install](#install)
* [Usage](#usage)
* [Docs](#docs)
* [Contributors](#contributors)
* [License](#license)## Install
[npm][]:
```sh
npm install blockcluster
```[yarn][]:
```sh
yarn add blockcluster
```## Usage
Here is an example script showing how to create an asset type, issue assets and fetch assets:
```js
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:
```js
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
## Contributors
| Name | Website |
| ----------------------- | -------------------------------------- |
| **BlockCluster** | |
| **Jibin Mathews** | |
| **Narayan Prusty** | |
| **Saikat Chakrabortty** | |## License
[MIT](LICENSE) © [BlockCluster](https://www.blockcluster.io)
##
[npm]: https://www.npmjs.com/
[yarn]: https://yarnpkg.com/