1.20.14 • Published 12 months ago
@ocap/statedb-dolt v1.20.14
@ocap/statedb-dolt
Install
npm install @ocap/statedb-dolt
// or
pnpm install @ocap/statedb-doltUsage
const DOLTStateDB = require('@ocap/statedb-dolt');
const db = new DOLTStateDB({
connection: 'mysql://root:@127.0.0.1:3306',
});
db.onReady(async () => {
const account = {
address: 'z1VUFgtw9JSENAswYm5vqdpg461oi6JPEdP',
balance: '100000000000000000000000000',
gasBalance: '0',
nonce: 2,
numTxs: 1,
numAssets: 0,
migratedTo: [],
migratedFrom: [],
stake: null,
context: {
genesisTime: '2021-02-02T02:17:48.141Z',
genesisTx: '',
renaissanceTime: '2021-02-02T02:17:48.141Z',
renaissanceTx: '',
},
moniker: 'system',
};
await db.runAsLambda(async (txn) => {
const exist = await db.account.get(account.address, { txn });
console.log('account', { exist });
if (!exist) {
const created = await db.account.create(account.address, account, { txn });
console.log('account', { created });
}
});
});1.20.14
12 months ago
1.20.13
12 months ago
1.20.12
12 months ago
1.20.11
1 year ago
1.20.10
1 year ago
1.20.9
1 year ago
1.20.8
1 year ago
1.20.7
1 year ago
1.20.6
1 year ago
1.20.5
1 year ago
1.20.4
1 year ago
1.20.3
1 year ago
1.20.2
1 year ago
1.20.1
1 year ago
1.20.0
1 year ago
1.19.21
1 year ago
1.19.20
1 year ago
1.19.19
1 year ago
1.19.18
1 year ago
1.19.17
1 year ago
1.19.16
1 year ago