hsd
Version:
Cryptocurrency bike-shed
31 lines (24 loc) • 612 B
JavaScript
/*!
* blockstore/layout.js - file blockstore data layout for hsd
* Copyright (c) 2019, Braydon Fuller (MIT License).
* https://github.com/handshake-org/hsd
*/
;
const bdb = require('bdb');
/*
* Database Layout:
* V -> db version
* F[type] -> last file record by type
* f[type][fileno] -> file record by type and file number
* b[type][hash] -> block record by type and block hash
*/
const layout = {
V: bdb.key('V'),
F: bdb.key('F', ['uint32']),
f: bdb.key('f', ['uint32', 'uint32']),
b: bdb.key('b', ['uint32', 'hash256'])
};
/*
* Expose
*/
module.exports = layout;