itns-sidechain/lib/blockstore/index-browser.js
2025-06-02 15:26:59 +04:00

31 lines
692 B
JavaScript

/*!
* blockstore/index.js - blockstore for hsd
* Copyright (c) 2019, Braydon Fuller (MIT License).
* https://github.com/handshake-org/hsd
*/
'use strict';
const {join} = require('path');
const AbstractBlockStore = require('./abstract');
const LevelBlockStore = require('./level');
/**
* @module blockstore
*/
exports.create = function create(options) {
const location = join(options.prefix, 'blocks');
return new LevelBlockStore({
network: options.network,
logger: options.logger,
location: location,
cacheSize: options.cacheSize,
memory: options.memory
});
};
exports.AbstractBlockStore = AbstractBlockStore;
exports.LevelBlockStore = LevelBlockStore;