-
-
Save matheusml/6a53ddc0e20441cbed988f84185e39a1 to your computer and use it in GitHub Desktop.
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(index = 0, previousHash = null, data = 'Genesis block', difficulty = 1) { | |
this.index = index | |
this.previousHash = previousHash | |
this.data = data | |
this.timestamp = new Date() | |
this.difficulty = difficulty | |
this.nonce = 0 | |
this.mine() | |
} | |
/* */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment