UNPKG

hsd

Version:
32 lines (24 loc) 692 B
/*! * 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;