Synopsis
This library provides basic functions for creating serializing and deserializing blocks
Installation
npm install dfinity-block
Usage
const block = version: 0 height: 1000 timestamp: 0 preBlockHash: 20 stateRoot: 20 beaconSig: 32 preNotarySig: 32 minterID: 0 minterSig: 32 const sk = crypto // sign the block as a minter and serialize the blockconst signedBlock = await block // desialize the blockconst block2 = await DfinityBlock // read the height of the blockblock2height
API
Specification
License
All code and designs are open sourced under GPL V3.