universa
v1.0.0-beta.4
Published
Official Node.js module to facilitate access to the Java library using Universa's UMI protocol
Readme
Universa
This is an official Node.js module from Universa to facilitate access to the Java library using Universa's UMI protocol.
Get started
Prerequisites
- Node 8+
- JVM v1.8* must be installed to run the UMI tool. Java runtimes for different OSes could be downloaded from https://www.java.com/en/download/.
Installing
This library is distributed on npm. In order to add it as a dependency, run the following command:
$ npm i --save universaUsage
const { PrivateKey, Contract } = require('universa');
async function main () {
const privateKey = await PrivateKey.create(2048);
const contract = await Contract.create(privateKey);
await contract.seal();
console.log(`Contract is ok: ${await contract.check()}`);
console.log(`Contract id: ${await (await contract.getId()).toString()}`)
}
main();Running the tests
- Clone the repo
$ git clone https://gitlab.com/universa/universa.git && cd universa - Install the dependencies
$ npm install - Run the tests:
$ npm test
Acknowledgments
- Universa Java API: https://kb.universablockchain.com/general_java_api/5
- Universa UMI server: https://kb.universablockchain.com/umi_protocol/98
- Universa Ruby gem: https://github.com/sergeych/universa
- Universa Python package: https://github.com/vkovrigin/universa
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Built with
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
