Skip to content

Commit

Permalink
HN
Browse files Browse the repository at this point in the history
  • Loading branch information
Gigabyte0x1337 committed Oct 21, 2017
1 parent d2083c8 commit b1cc401
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 9 deletions.
13 changes: 5 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const BlockChain = require("./src/blockchain");
const crypto = require('crypto');



const blockChain = new BlockChain(486604799, 1);
const genisisBlock = blockChain.createBlock([
{ test: "halods" },
Expand All @@ -17,15 +18,11 @@ blockChain.addBlock(genisisBlock);
const block = blockChain.createBlock([
{ test: "halods" }
]);
block.timestamp = 1508587685;
block.nonce = 935890168;
blockChain.addBlock(block);

mine(block);
//block.timestamp = 1508587685;
//block.nonce = 935890168;
//blockChain.addBlock(block);

function mine(block) {
let hashTime = 0;
let iterations = 0;
while (true) {
block.nonce = 0;
block.timestamp = Math.round(Date.now() / 1000);
Expand All @@ -39,4 +36,4 @@ function mine(block) {
}
}
}

mine(block);
60 changes: 60 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"merkle": "^0.6.0"
"merkle": "^0.6.0",
"webworker-threads": "^0.7.13"
}
}

0 comments on commit b1cc401

Please sign in to comment.