0.1.3 • Published 1 year ago
bitblock v0.1.3
bitblock
Blockchain storage implemented in Node.js.
Usage
import BitBlock from 'bitblock';
const validator: BlockValidator = (block, previousBlock) => {
// implement custom validation logic here
return true;
};
const blockChain = new BitBlock('blockchain', validator);
blockChain.generateGenesis().then((genesisBlock) => {
console.log('Genesis block', genesisBlock);
return blockChain.addBlock(Buffer.from('Second block'));
});