Skip to content

Instantly share code, notes, and snippets.

@spenserhuang
Last active Dec 28, 2017
Embed
What would you like to do?
js-blockchain Step 1
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