Skip to content

jsrhodes15/the-blockchain-bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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  

About

Blockchain implementation written in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages