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
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);