Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: show timestamp of the block #3

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c0accf3
cli: show timestamp of the block
RichardWeiYang Oct 11, 2017
5e43c77
merkle tree: fix the implementation and add a test case
RichardWeiYang Oct 16, 2017
cee6700
base58: fix Base58Decode on calculating the zeroBytes
RichardWeiYang Oct 16, 2017
f9935da
base58_test: add test case for Base58
RichardWeiYang Oct 16, 2017
782db48
cli: add three cli command for exploring
RichardWeiYang Oct 16, 2017
42b9dbb
version: display the addree when a new node is connected
RichardWeiYang Oct 18, 2017
8ea4bc8
Use View instead of Update in NewBlockchain()
RichardWeiYang Oct 18, 2017
29099f0
check wallet before sending
RichardWeiYang Oct 18, 2017
009fda2
display the number of tx mined
RichardWeiYang Oct 18, 2017
2974ee8
cli: print PubKeyHash in getAddress
RichardWeiYang Oct 18, 2017
5f4f2f5
cli: add command getPubKeyHash
RichardWeiYang Oct 18, 2017
36cfffc
cli: add getBlock command
RichardWeiYang Oct 19, 2017
01d18ce
add Address in TXOut
RichardWeiYang Oct 19, 2017
5c88b24
display the addresse in TXIn and optmize getAddress command
RichardWeiYang Oct 19, 2017
c410eb2
display the private key
RichardWeiYang Oct 20, 2017
9f6ac35
update gitignore
RichardWeiYang Oct 21, 2017
64cf474
fix private key display
RichardWeiYang Oct 21, 2017
04318d7
cli: generatePrivKey
RichardWeiYang Oct 21, 2017
b415f08
make it a package bc
RichardWeiYang Oct 22, 2017
c72ff7f
Change README for bc package
RichardWeiYang Oct 22, 2017
cb4ae18
export DB in blockchain
RichardWeiYang Oct 22, 2017
9b2f73b
add PrintHTML method to chain
RichardWeiYang Oct 22, 2017
56c9e3f
add GetBalance to chain
RichardWeiYang Oct 22, 2017
db3fe41
more detail explanation
RichardWeiYang Oct 31, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base58.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this is against the idea of the project: it should be a standalone app, not a package. Why did you decide to make this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, this is up to you. I just add it for my purpose.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, actually, I am not comfortable with the GitHub pull request.

Since what I want you to take is the fix on Decoder and merkle tree, the #2 - #4 commit.

While GitHub automatically create the pull request with all my new commits on master branch.

How could I send a pull request just with dedicated commit? or you could pick up the one you want? or I have to make a clean master branch so that you can pull?


import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion base58_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion block.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion blockchain.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion blockchain_iterator.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"log"
Expand Down
2 changes: 1 addition & 1 deletion cli.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"flag"
Expand Down
2 changes: 1 addition & 1 deletion cli_createblockchain.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cli_createwallet.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion cli_explore.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this file and commands. Looks like its purpose is just to debug/test things.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this is some cli commands which helps me to understand the blockchain:-)


import (
"crypto/elliptic"
Expand Down
2 changes: 1 addition & 1 deletion cli_getbalance.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cli_listaddress.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cli_printchain.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cli_reindexutxo.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion cli_send.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cli_startnode.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"fmt"
Expand Down
6 changes: 0 additions & 6 deletions main.go

This file was deleted.

2 changes: 1 addition & 1 deletion merkle_tree.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"crypto/sha256"
Expand Down
2 changes: 1 addition & 1 deletion merkle_tree_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"encoding/hex"
Expand Down
2 changes: 1 addition & 1 deletion proofofwork.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion transaction.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion transaction_input.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import "bytes"

Expand Down
2 changes: 1 addition & 1 deletion transaction_output.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion utxo_set.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"encoding/hex"
Expand Down
2 changes: 1 addition & 1 deletion wallet.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion wallets.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package bc

import (
"bytes"
Expand Down