Last active
December 28, 2017 06:35
-
-
Save spenserhuang/666235b9003e0b1b52b59164ce123a35 to your computer and use it in GitHub Desktop.
js-blockchain Step 1
This file contains 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 Block { | |
constructor(timestamp, data) { | |
this.index = 0; | |
this.timestamp = timestamp; | |
this.data = data; | |
this.previousHash = "0"; | |
this.hash = this.calculateHash(); | |
this.nonce = 0; | |
} | |
calculateHash() { | |
} | |
mineBlock(difficulty) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment