Skip to content

Instantly share code, notes, and snippets.

@matheusml
Created December 6, 2017 18:14
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 matheusml/6a53ddc0e20441cbed988f84185e39a1 to your computer and use it in GitHub Desktop.
Save matheusml/6a53ddc0e20441cbed988f84185e39a1 to your computer and use it in GitHub Desktop.
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