This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@cypsela/opal
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

opal

name is temporary 🚧 maybe?

peer-to-peer, collaborative states using merkle-crdts.

Beta Release Tacker: https://github.com/cypsela/opal/issues/8

DALL·E 2022-09-27 21 45 51 - cabochon gemstone opal  translucent vibrant multi-color  AAA+ grade  100 carats  macro photography  kaleidoscope inside the opal

Install

npm install @cypsela/opal

Usage

import IPFS from 'ipfs'
import { Opal } from '@cypsela/opal'

/** look at js-ipfs for configurations */
const ipfs = await IPFS.create() // 

/** see more config options in the API docs */
const opal = await Opal.create({ ipfs, libp2p: ipfs.libp2p }) // ipfs.libp2p will throw a typescript error; it's a hack for now

/** create a manifest for a keyvalue database */
const manifest = await opal.determine({ name: 'this is the databases name', type: 'keyvalue' })

/** open the keyvalue database */
const keyvalue = await opal.open(manifest)

/** The keyvalue API docs are not uploaded yet */

const entryCID = await keyvalue.put('key', 'value')
const value = await keyvalue.get('key')
const entryCID = await keyvalue.del('key')

Check out the tests for more usage examples for now.

API

Check out the API Docs

License

This project is dual licensed under MIT and APACHE.

Funding

Thanks to Protocol Labs for Funding this project through a grant.

Package Sidebar

Install

npm i @cypsela/opal

Weekly Downloads

1

Version

0.0.1

License

none

Unpacked Size

340 kB

Total Files

229

Last publish

Collaborators

  • tabcat00