xdb-digitalbits-base v5.3.0
JS DigitalBits Base
The xdb-digitalbits-base library is the lowest-level digitalbits helper library. It consists of classes to read, write, hash, and sign the xdr structures that are used in digitalbits-core. This is an implementation in JavaScript that can be used on either Node.js or web browsers.
Warning! Node version of this package is using
sodium-nativepackage, a native implementation of Ed25519 in Node.js, as an optional dependency. This means that if for any reason installation of this package fails,xdb-digitalbits-basewill fallback to the much slower implementation contained intweetnacl.If you are using
xdb-digitalbits-basein a browser you can ignore this. However, for production backend deployments you should definitely be usingsodium-native. Ifsodium-nativeis successfully installed and workingDigitalBitsBase.FastSigningvariable will be equaltrue. Otherwise it will befalse.
Quick start
- Install Bundler
- Use node version >= 12.
Clone repository, install dependencie, compile libs and link directory
git clone https://github.com/xdbfoundation/xdb-digitalbits-base
cd xdb-digitalbits-base
bundle install
yarn
yarn gulp
yarn linkUse yarn to include xdb-digitalbits-base in your own project. Execute in root directory of your project
yarn link xdb-digitalbits-baseThen require/import it in your JavaScript:
var DigitalBitsBase = require('xdb-digitalbits-base');Usage
For information on how to use xdb-digitalbits-base, take a look at the docs in the docs folder.
Testing
To run all tests:
yarn gulp testTo run a specific set of tests:
yarn gulp test:node
yarn gulp test:browserYou can also run yarn test for a simpler subset of the test cases.
Documentation
Documentation for this repo lives inside the docs folder.
License
xdb-digitalbits-base is licensed under an Apache-2.0 license. See the LICENSE file for details.