rsksmart / rif-data-vault

RIF Data Vault
MIT License
2 stars 7 forks source link
data-vault ipfs rif rsk

logo

RIF Data Vault

A user centric cloud storage system

docs alerts

The Data Vault is a user-centric cloud service. Allows any user with a digital wallet to connect to their own storage cloud, encrypting their information on the client side.

Quick start

Connect to RIF Data Vault from your browser app!

import DataVaultWebClient, { AuthManager, AsymmetricEncryptionManager } from '@rsksmart/ipfs-cpinner-client'

const serviceUrl = 'https://data-vault.identity.rifos.org'

// using Metamask
const address = await window.ethereum.request({ method: 'eth_accounts' }).then(accounts => accounts[0])
const did = `did:ethr:rsk:${address}`

const dataVault = new DataVaultWebClient({
  serviceUrl,
  authManager: new AuthManager({ did, serviceUrl, personalSign: (data: string) => window.ethereum.request({ method: 'personal_sign', params: [data, address] }) }),
  encryptionManager: AsymmetricEncryptionManager.fromWeb3Provider(window.ethereum)
})

const key = 'MyKey'
const content = 'this is my content'

const id = await dataVault.create({ key, content })

await dataVault.get({ did, key })

Read the docs and find out more!

Modules

Run for development

  1. Install dependencies

    npm i
    npm run setup
  2. Install IPFS CLI. Find your option: https://docs.ipfs.io/how-to/command-line-quick-start/.

Test

  1. Init IPFS (once)

    ipfs init
  2. Start IPFS Daemon

    ipfs daemon
  3. Run tests

    npm test

    or watch mode with

    test:watch

Lint

npm run lint

Branching model

Deploy your Data Vault instance

To run a productive instance of the Data Vault refer to Data Vault service configuration