Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

rsksmart/rif-data-vault

Repository files navigation

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
  1. Start IPFS Daemon
ipfs daemon
  1. Run tests
npm test

or watch mode with

test:watch

Lint

npm run lint

Branching model

  • master has latest release. Do merge commits.
  • develop has latest approved PR. PRs need to pass ci and LGTM. Do squash & merge.
  • Use branches pointing to develop to add new PRs.
  • Do external PRs against latest commit in develop.

Deploy your Data Vault instance

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