This is a project I build to demonstrate the foundational ideas of how a blockchain works. It imagines blocks on a blockchain using a single server and does not use a peer-to-peer network as this project is not meant to be a demonstration of decentralization. There are also some basic transaction/cyrptography examples related to blockchain/cryptocurrency shown through the code.
git clone https://github.com/KevinGe00/go-blockchain.git
In root directory, to run the server:
go build
./go-blockchain
"Listening on port 10000" should appear and indicates that the server is now up and running.
Please find the Postman collection, import it into Postman to see examples how to call the API in order to view the blockchain and mine blocks to be added to the blockchain.
In root directory, run this to run all the *_test.go files:
go test -v
You can also look through the code coverage of the tests in detail by running:
go test -coverprofile=coverage.out
go tool cover -html=coverage.out