Giter Club home page Giter Club logo

aragon-datastore's Introduction

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

aragon-datastore's People

Contributors

juslar avatar leftab avatar macor161 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.