@ocap/statedb

1.18.120 • Public • Published

OCAP StateDB

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

  • @ocap/statedb-memory
  • @ocap/statedb-fs
  • @ocap/statedb-qldb

Usage

yarn add @ocap/statedb-memory

Then:

const MemoryStateDB = require('@ocap/statedb-memory');

const statedb = new MemoryStateDB();

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

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

statedb.delegation.create(address, attrs, context);
statedb.delegation.get(address);
statedb.delegation.update(address, updates, context);

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

Readme

Keywords

none

Package Sidebar

Install

npm i @ocap/statedb

Weekly Downloads

188

Version

1.18.120

License

MIT

Unpacked Size

7.07 kB

Total Files

8

Last publish

Collaborators

  • wangshijun
  • polunzh
  • mave99a