Skip to content

A Go (Golang) client for an experimental blockchain - for educational purposes only!

License

Notifications You must be signed in to change notification settings

daniel-xyz/go-chain

Repository files navigation

Go Report Card GoDoc

This is my personal project to get into the Go programming language (Golang) for the first time. You should not use this Blockchain or Client, except if you want to have some fun! 🤙

Checklist

  • Hash & verify blocks
  • Add Blocks to Blockchain
  • Validate Blockchain
  • Real Mining with Dfficulty (nonce)
  • Transaction Pool & Add Transactions to Blocks
  • Client API
  • Error Management
  • > 90% Test Coverage
  • Wallets
  • P2P-Sync

Have fun ❤️ and give feedback!

Known issues

  • For the purpose of this project, I didn't implement a project structure pattern, like package oriented design. The packages are not designed to be used outside of this project.
  • It's not considered good practice to pack all types in a common /types folder, but it was my first attempt in order to avoid dependency cycles.

Start client

Run make run

Currently it just runs as a simulation and therefore resets the state with every new run.

It will log the output to stdout, so you'll be seeing what is going on in your console. Errors will be written into the errors.log and the current state of the blockchain persisted in state.json. Both files are generated in the root folder.

Make API requests

There is a really small API (without validation) just to get the current state and post new transactions from outside the client.

Response will be with content-type: application/json

Body (content-type: application/json):

{
  "from": "any string",
  "to": "any string",
  "amount": "any integer"
}

Testing

Run make test

Other useful commands

make linter make test-coverage-report

About

A Go (Golang) client for an experimental blockchain - for educational purposes only!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published