Nuclear Package Magnet

    @espresso-org/aragon-datastore
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.6 • Public • Published

    AragonOS Datastore

    Build Status Coverage Status

    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
    

    Keywords

    none

    Install

    npm i @espresso-org/aragon-datastore

    DownloadsWeekly Downloads

    5

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    7.27 MB

    Total Files

    22

    Last publish

    Collaborators

    • juslar
    • mcormier