aragon-datastore
Datastore based on AragonOS
Last updated 2 years ago by mcormier .
MIT · Original npm · Tarball · package.json
$ cnpm install aragon-datastore 
SYNC missed versions from official npm registry.

AragonOS Datastore

The Datastore lets DApps easily store files and manage their permissions decentrally. It consists of two modules:

  1. A javascript library to store files in a distributed file system, IPFS as of right now. It will also handle the encryption/decryption process.
  2. A solidity smart contract that keeps the information of those files and manages permissions.

Javascript library

To be as extensible as possible, the Datastore is built around a system of multiple providers. To use the Javascript library, first import the necessary objects:

import { Datastore, providers } from 'aragon-datastore'

And you can then create an instance like this:

const datastore = new Datastore({
    storageProvider: new providers.storage.Ipfs(),
    encryptionProvider: new providers.encryption.Aes(),
    rpcProvider: new providers.rpc.Aragon(aragonApp)
})

The code above would create a Datastore instance using IPFS as storage and aragon.js to execute the smart contract methods and receive events. To use Filecoin instead of IPFS, simply select the corresponding storage provider. In case the DApp is not using Aragon, a Web3 provider is also availabe:

    rpcProvider: new providers.rpc.Web3(...)

Solidity smart contract

To use or extend the smart contract features, import the Datastore.sol file:

import "aragon-datastore/contracts/Datastore.sol";

IPFS

Right now, the Datastore only supports IPFS. The provider will try to connect to localhost by default on port 5001. Make sure an IPFS daemon is running:

ipfs daemon

Current Tags

  • 0.0.4                                ...           latest (2 years ago)

4 Versions

  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (9)
Dev Dependencies (17)

Copyright 2014 - 2016 © taobao.org |