Commit Graph

151 Commits

Author SHA1 Message Date
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
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
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
Ivan Kuznetsov 7935589f8a Send 'vrack' in response to 'version' 2017-10-01 10:08:51 +07:00
Ivan Kuznetsov 1c5bc460f4 Implement 'version' command 2017-10-01 09:33:33 +07:00
Ivan Kuznetsov 60a1386f3d Implement 'startnode' CLI command 2017-10-01 08:44:41 +07:00
Ivan Kuznetsov 2e06c0a637 Update the README 2017-09-19 16:44:23 +07:00
Ivan Kuznetsov 9b9b571028 Fill coinbase transaction data with random bytes 2017-09-19 15:47:03 +07:00
Ivan Kuznetsov ffac3de519 Lower the difficulty of PoW 2017-09-19 15:03:30 +07:00
Ivan Kuznetsov 74cbac4e8f Revert "Fix the 'checksum' function"
This reverts commit 465b85d5f2.
2017-09-19 14:53:53 +07:00
Ivan Kuznetsov 8cafc0ef1e Use Merkle root hash in proof-of-work 2017-09-18 13:01:43 +07:00
Ivan Kuznetsov 668d209f5e Implement Merkle tree 2017-09-18 12:45:58 +07:00
Ivan Kuznetsov 827f124c61 Refactor something in UTXOSet 2017-09-18 11:01:24 +07:00