#The blockchain bar Learning some blockchain and Go things
A block chain built from scratch in Go
- Fully functional, accepts transactions and syncs all nodes connected to network
- Accounts in the form of 'wallets'
- HTTP API server to host full blockchain
- CLI built using Cobra package
##Usage clone the repository & cd into project
####Install the CLI
go install ./cmd/...
Show all commands
tbb help
Start a local server
tbb run --dataDir=[/absolute/path/to/dir]
# 'dataDir' sets you want config stored, defaults to $HOME/.tbb
Get balances
CLI
tbb balances list
API
curl http://localhost:8080/balances/list | jq
# 'jq' is for formatting, if you don't have it, can omit
Add a Transaction
*the first time you do this, you will want to use "jrhodes" as from, as that is the only account with "coins" to transfer
CLI
tbb tx add --from=[from acct] --to=[to acct] --value=[value]
API
curl --location --request POST --header "Content-Type: application/json" --data '{"from":"[someAccount]","to":"[someAccount]","value":[someNumber]}' http://localhost:8080/tx/add