naivecoin
naivecoin copied to clipboard
A tutorial for building a cryptocurrency
Why not just comparing hashes instead of stringified objects? [isValidGenesis](https://github.com/lhartikk/naivecoin/blob/master/src/blockchain.ts#L232) ```javascript const isValidGenesis = (block: Block): boolean => { return JSON.stringify(block) === JSON.stringify(genesisBlock); }; ```
You've stated in your **_Architecture_** section that two servers should be exposed: an **HTTP** server and a **WebSocket _HTTP_** server. Great article though!
I think in hasDuplicates() function: const groups = _.countBy(txIns, (txIn) => txIn.txOutId + txIn.txOutId); Why we need calculate txIn.txOutId two time? I think it should be: const groups = _.countBy(txIns,...
provides for a stop script run ---> npm stop
Hi, I have cloned your code in my environment and follow the readme ,when i type npm start ,some errors were found.: /var/www/test/naivecoin/src/transactionPool.js:39 transactionPool = _.without(transactionPool, ...invalidTxs); SyntaxError: Unexpected token...
Minor issue... Apparently `false` is missing on the `return` statement of the second `if` in `validateCoinbaseTx`, that has a `boolean` return type. It shouldn't affect the way it works though,...
The bug was caused when `timeTaken > timeExpected * 2` at first round. Originally, It would be -1, which is absolutely wrong. So in order to avoid this bug, test...
Nice and clear article for get started in blockchain and cryptocurrency! I find out there might be a typo in https://lhartikk.github.io/jekyll/update/2017/07/13/chapter2.html I consider it should be In the below example,...