Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Last active December 18, 2019 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaurel/8ae35378f2523a2cc1fcef54f70317e2 to your computer and use it in GitHub Desktop.
Save ssaurel/8ae35378f2523a2cc1fcef54f70317e2 to your computer and use it in GitHub Desktop.
Blockchain in JS in action by @ssaurel
var blockchain = new Blockchain(4);
var block1 = blockchain.newBlock("Second Block");
blockchain.addBlock(block1);
var block2 = blockchain.newBlock("Third Block");
blockchain.addBlock(block2);
var block3 = blockchain.newBlock("Fourth Block");
blockchain.addBlock(block3);
console.log("Blockchain Validity: " + blockchain.isBlockchainValid());
blockchain.display();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment