@gxchain2/blockchain

[![NPM Version](https://img.shields.io/npm/v/@gxchain2/blockchain)](https://www.npmjs.org/package/@gxchain2/blockchain) ![License](https://img.shields.io/npm/l/@gxchain2/blockchain)

Usage no npm install needed!

<script type="module">
  import gxchain2Blockchain from 'https://cdn.skypack.dev/@gxchain2/blockchain';
</script>

README

@gxchain2/blockchain

NPM Version License

Definition of blockchain structure and rules, based on @gxchain2-ethereumjs/blockchain

INSTALL

npm install @gxchain2/blockchain

USAGE

blockchain = new Blockchain({
  db: chaindb, // Database to store blocks and metadata. Should be an abstract-leveldown compliant store
  database: database,
  genesisBlock, // Messages of genesis block to initialize blockchain
});

await blockchain.putBlock(block);
console.log(blockchain.latestBlock);
console.log(blockchain.totalDifficulty);

License

GNU General Public License v3.0