Created
January 16, 2018 13:40
-
-
Save thecreazy/35910621cb7f1e74775a693cb0169479 to your computer and use it in GitHub Desktop.
Gist for my medium article on blockchain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Blockchain { | |
constructor () { | |
// Create chain and transaction | |
this.chain = [] | |
this.current_transactions = [] | |
// Binding of this | |
this.newBlock = this.newBlock.bind(this) | |
this.newTransaction = this.newTransaction.bind(this) | |
this.lastBlock = this.lastBlock.bind(this) | |
this.proofOfWork = this.proofOfWork.bind(this) | |
} | |
newBlock () { /* Create the new block */ } | |
newTransaction () { /* Store a new transaction */ } | |
hash (block) { /* hash the block */ } | |
lastBlock () { /* return the last block */} | |
} | |
module.exports = Blockchain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment