Commit Graph

161 Commits

Author SHA1 Message Date
RichardWeiYang a104a54db5 Merge db3fe41ad8 into c5c21fd069 2017-10-31 07:05:53 +00:00
Wei Yang db3fe41ad8 more detail explanation 2017-10-31 12:04:10 +08:00
Ivan Kuznetsov c5c21fd069
Merge pull request #4 from denispeplin/patch-1
Don't output every hash onto console, its too slow
2017-10-28 20:59:36 +07:00
Ivan Kuznetsov 0557058641
Merge pull request #5 from bigUNO/master
🤝 Fixes unkeyed composite literal
2017-10-28 20:57:36 +07:00
Wei Yang 56c9e3faa6 add GetBalance to chain 2017-10-22 10:53:22 +08:00
Wei Yang 9b2f73b11b add PrintHTML method to chain 2017-10-22 10:49:02 +08:00
Wei Yang cb4ae18f43 export DB in blockchain 2017-10-22 10:39:31 +08:00
Wei Yang c72ff7fcee Change README for bc package 2017-10-22 10:23:40 +08:00
Wei Yang b415f08c46 make it a package bc 2017-10-22 10:20:14 +08:00
Wei Yang 04318d7ca4 cli: generatePrivKey 2017-10-22 00:47:37 +08:00
Wei Yang 64cf474f27 fix private key display 2017-10-21 22:32:49 +08:00
Wei Yang 9f6ac35835 update gitignore 2017-10-21 22:01:19 +08:00
Wei Yang c410eb2f1d display the private key 2017-10-20 08:44:58 +08:00
Leon Johnson 28de8475a5
👕 Fixes crypto/ecdsa.PublicKey composite literal uses unkeyed fields
My linter never runs out of things to complain about :)
2017-10-19 14:33:26 -04:00
Wei Yang 5c88b24c2c display the addresse in TXIn and optmize getAddress command 2017-10-19 22:28:49 +08:00
Wei Yang 01d18ce4d5 add Address in TXOut 2017-10-19 21:48:55 +08:00
Wei Yang 36cfffcb64 cli: add getBlock command 2017-10-19 15:42:05 +08:00
Denis 989569ce61 Don't output every hash onto console, its too slow
Mining is about 3 times faster in average on my computer with this patch.
2017-10-18 12:21:38 +03:00
Wei Yang 5f4f2f518d cli: add command getPubKeyHash 2017-10-18 15:29:36 +08:00
Wei Yang 2974ee8571 cli: print PubKeyHash in getAddress 2017-10-18 15:29:30 +08:00
Wei Yang 009fda2b7c display the number of tx mined 2017-10-18 11:56:30 +08:00
Wei Yang 29099f0c02 check wallet before sending
We could only send money from our own wallet.

If the parameter is not an address in our wallet, exit the program gracefully
and show an error message.
2017-10-18 11:54:37 +08:00
Wei Yang 8ea4bc859d Use View instead of Update in NewBlockchain() 2017-10-18 11:51:41 +08:00
Wei Yang 42b9dbb26e version: display the addree when a new node is connected 2017-10-18 11:47:23 +08:00
Wei Yang 782db48492 cli: add three cli command for exploring 2017-10-18 11:41:47 +08:00
Wei Yang f9935daa83 base58_test: add test case for Base58 2017-10-16 21:51:16 +08:00
Wei Yang cee6700c21 base58: fix Base58Decode on calculating the zeroBytes
The leading "zeroBytes" in address is b58Alphabet[0] instead of 0x00.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
2017-10-16 21:51:16 +08:00
Wei Yang 5e43c770ee merkle tree: fix the implementation and add a test case
Merkle tree requires a full binary tree, which means the number of node is
power of 2 and the level of the tree is log(N) instead of N/2.

This patch duplicate the node to a power of 2 number and correct the level
calculation. Besides it adds a test case with 6 nodes.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
2017-10-16 12:45:37 +08:00
Wei Yang c0accf31e0 cli: show timestamp of the block 2017-10-12 08:58:28 +08:00
Ivan Kuznetsov cb32e7ca13 Fix ranging in Base58Encode and Base58Decode 2017-10-06 17:42:49 +07:00
Ivan Kuznetsov 58f9eb7dc5 Update README 2017-10-06 17:32:52 +07:00
Ivan Kuznetsov a96a5bc1e6 Fix the main scenario 2017-10-06 12:29:55 +07:00
Ivan Kuznetsov 64d1cc5569 When a new block is mined, let everyone know 2017-10-06 11:30:51 +07:00
Ivan Kuznetsov 5c4340f47d Add -miner flag to 'startnode' command 2017-10-03 16:21:15 +07:00
Ivan Kuznetsov 13f22d2e40 Update UTXOSet after adding a new block 2017-10-03 15:54:50 +07:00
Ivan Kuznetsov 150778f920 Add -mine option to the 'send' command 2017-10-03 15:54:31 +07:00
Ivan Kuznetsov 9de40a9385 Fix 'version' message exhanging 2017-10-03 15:47:56 +07:00
Ivan Kuznetsov 3cb93b5278 Implement 'tx' command (WIP) 2017-10-03 15:47:27 +07:00
Ivan Kuznetsov c753df287a Implement the correct way of synchronizing a blockchain 2017-10-01 21:33:03 +07:00
Ivan Kuznetsov a79d78ad8c Implement Blockchain.AddBlock 2017-10-01 20:30:21 +07:00
Ivan Kuznetsov 470adef2c3 Implement 'block' and 'getdata' commands 2017-10-01 11:50:27 +07:00
Ivan Kuznetsov 9adb5fc139 Implement 'getblocks' command 2017-10-01 11:19:43 +07:00
Ivan Kuznetsov 0c59d8cd52 Show block height in 'printchain' command 2017-10-01 11:04:31 +07:00
Ivan Kuznetsov 2734285450 Implement block height 2017-10-01 11:02:38 +07:00
Ivan Kuznetsov 130cf66a90 Fix wallet file name 2017-10-01 10:53:26 +07:00
Ivan Kuznetsov 4acc3ae271 Update .gitignore 2017-10-01 10:53:19 +07:00
Ivan Kuznetsov 0c91da0e52 Wallet file name must depend on node ID 2017-10-01 10:48:51 +07:00
Ivan Kuznetsov 57f3680551 Blockchain file name must depend on node ID 2017-10-01 10:42:34 +07:00
Ivan Kuznetsov 504b6c85bf Set node ID via an env. var 2017-10-01 10:29:04 +07:00
Ivan Kuznetsov 4a9f7be98c Implement 'addr' command 2017-10-01 10:25:11 +07:00