@ocap/indexdb

1.18.147 • Public • Published

OCAP IndexDB

Defines the abstract interface of OCAP IndexDB, must be implemented with an actual statedb, please checkout following packages:

  • @ocap/indexdb-memory
  • @ocap/indexdb-fs
  • @ocap/indexdb-elasticsearch

Usage

yarn add @ocap/statedb-memory

Then:

const MemoryIndexDB = require('@ocap/indexdb-memory');

const indexdb = new MemoryIndexDB();

indexdb.account.create(address, attrs, context);
indexdb.account.get(address);
indexdb.account.update(address, updates, context);

indexdb.asset.create(address, attrs, context);
indexdb.asset.get(address);
indexdb.asset.update(address, updates, context);

indexdb.tx.create(hash, attrs, context);
indexdb.tx.get(hash);
indexdb.tx.find(conditions);

Readme

Keywords

none

Package Sidebar

Install

npm i @ocap/indexdb

Weekly Downloads

442

Version

1.18.147

License

MIT

Unpacked Size

22.6 kB

Total Files

7

Last publish

Collaborators

  • wangshijun
  • polunzh
  • mave99a