0.1.0 • Published 5 years ago

mimostore v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

mimo-orbit

Custom identity store on OrbitDB

An key-value store refactored to accept digital signatures. Add new claims about your identity to the DB. It uses digital signatures to ensure that all data added to the DB has been approved by the owner of the identity.

Table of Contents

Install

npm install mimostore

Usage

First, create an instance of OrbitDB and Web3:

const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
const MimoStore = require('mimostore')

const ipfs = new IPFS()

// add MimoStore to orbitdb
OrbitDB.addDatabaseType(MimoStore.type, MimoStore)

// instantiate MimoStore
const orbitdb = new OrbitDB(ipfs)
const mimostore = orbitdb.create('mimo', MimoStore.type, {
  write: ['*']
})

Add a claim to it, if the signature of the data is a valid one then the data will be added successfully:

await store.put({ id: '0x_id', bio: 'I <3 Mimo' }, '<signature>')

Later, when the database contains data, query whenever:

await store.get('0x_id')

API

See the commented code in the codebase

License

MIT © 2018 Ghilia Weldesselasie