# datona-lib

> Core library for access to the Datona IO Platform. Datona Protocol v0.0.2. Adds HTTP and WebSocket support.

Latest version **0.1.4** (published 2021-02-08) · LGPL license · 0 weekly downloads

## Install

```sh
npm install datona-lib
pnpm add datona-lib
yarn add datona-lib
bun add datona-lib
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2021-02-08 |
| First published | 2020-02-05 |
| Weekly downloads | 0 |
| License | LGPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Datona Labs |
| Maintainers | dnpotter |
| Keywords | smart data access, control of data, data vault, gdpr, data protection, blockchain, datona |

## Links

- npm: https://www.npmjs.com/package/datona-lib
- Repository: https://github.com/Datona-Labs/datona-lib
- Homepage: https://github.com/Datona-Labs/datona-lib#readme
- Issues: https://github.com/Datona-Labs/datona-lib/issues
- npm.io page: https://npm.io/package/datona-lib

## Dependencies (10)

- [ws](https://npm.io/package/ws.md) ^7.2.5
- [npm](https://npm.io/package/npm.md) ^7.5.2
- [rlp](https://npm.io/package/rlp.md) ^2.2.4
- [web3](https://npm.io/package/web3.md) ^1.3.0
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [js-sha3](https://npm.io/package/js-sha3.md) ^0.8.0
- [minimist](https://npm.io/package/minimist.md) >=0.2.1
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.0.0
- [secp256k1](https://npm.io/package/secp256k1.md) ^3.8.0
- [isomorphic-ws](https://npm.io/package/isomorphic-ws.md) ^4.0.1

## Recent versions

- 0.1.4 (latest) — 2021-02-08
- 0.1.3 — 2020-08-01
- 0.1.2 — 2020-05-02
- 0.1.1 — 2020-04-29
- 0.0.5 — 2020-04-26
- 0.0.4 — 2020-04-24
- 0.0.3 — 2020-02-06
- 0.0.2 — 2020-02-06
- 0.0.1 — 2020-02-05

## README

<p align="center">
<img src="https://datonalabs.org/images/hex.png" width=150 />
</p>

# Datona IO Platform Library (datona-lib)

[![NPM](https://img.shields.io/npm/v/datona-lib)](https://www.npmjs.org/package/datona-lib)

Core Javascript library for accessing the [Datona IO Platform](https://datona.io).

For more information about the platform see [What Is Smart Data Access](https://datona-lib.readthedocs.io/en/latest/what.html) or download the [white paper](https://datonalabs.org/documents/WhitePaper.pdf).

## Features
- Fully encapsulates the [Datona Application Layer Protocol](https://datona-lib.readthedocs.io/en/latest/types.html#application-layer-protocol);
- Allows [Smart Data Access Contracts](https://datona-lib.readthedocs.io/en/latest/what.html#smart-data-access-contracts) on the blockchain to be deployed, managed and queried;
- Allows Data Vaults controlled by Smart Data Access Contracts to be created, updated, accessed and deleted on any compliant local or remote Data Vault Server;
- Provides all cryptographic functions needed to use the platform.

## Documentation
Full documentation is available on [ReadTheDocs](https://datona-lib.readthedocs.io/en/latest/index.html).

## Installation

### Within a Web Page

Copy `dist/datona-lib.js` into your directory structure along with [`dist/web3.min.js`](https://github.com/ethereum/web3.js).  Include these scripts in your web page:

```html
<head>
  <script src="./lib/web3.min.js"></script>
  <script src="./lib/datona-lib.js"></script>
 </head>
```

### Within a Local Node.js Project

    $ npm install datona-lib

This will install datona-lib and all its dependencies to your local node project.

## Usage

You need to be running a local Ethereum node or have access to a remote node - e.g. [Infura](https://infura.io) to use this library.

```javascript
const datona = require('datona-lib');
```

See the [project documentation](https://datona-lib.readthedocs.io/en/latest/index.html) for usage information.

## Projects utilising datona-lib

- [datona-cli](https://github.com/datona-labs/datona-cli)

If you have a project that you feel could be listed here, please [ask for it](https://github.com/datona-labs/datona-lib/issues/new)!


## Tests

By default, the tests are configured to use a local [Ganache](https://www.trufflesuite.com/ganache) instance on port 8545.  Ganache needs to be running before executing any of these test commands.  You will need to set the mnemonic to ``foil message analyst universe oval sport super eye spot easily veteran oblige``.

If you want to run these tests using your own blockchain node or a third party service, edit the url in config.json and ensure the three addresses in ``test/system-scenarios.rst`` have funds.

    $ npm test

Runs all tests except those few that depend on realtime delays in Ganache.

    $ npm run test-all

Runs all tests.

    $ npm run test-cov

Runs all tests and generates a coverage report.

## Community

- [Discord](https://discord.gg/sSnvK5C)
- [Twitter](https://twitter.com/DatonaLabs)

## Copyright

Copyright (c) 2020 [Datona Labs](https://datonalabs.org)

Released under the [GNU Lesser General Public License](LICENSE)

---
_Source: https://npm.io/package/datona-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
