This project creates a blockchain scenario utilizing multiple microservices which are orchestrated via Kubernetes.
It serves as an educational project in order to:
- dive into Go
- learn how TDD works with Go
- become familiar with GitHub & GitHub Actions (the author's a GitLab-guy...)
- increase the author's practical experience with Kubernetes
- understand Blockchain-mechanisms
- evaluate some CNCF graduated & incubating projects like Prometheus, NATS, Jaeger, Flux, ...
Disclaimer:
This project does not claim any correctness regarding topics such as Blockchain, etc.
The easiest way tu run this project is via k3d
# Create k3s cluster
./k8s/create_cluster.sh
kubectl config use-context k3d-mycluster
# Start
kubectl apply -k ./k8s/
# Teardown
kubectl delete -k ./k8s/
This Project will consist of the following components:
Component | Repository | Status |
---|---|---|
Transaction Spawner | philohsophy/transaction-spawner | |
Transaction Pool | philohsophy/transaction-pool | |
Miners | philohsophy/blockchain-miner | |
Blockchain Supervisor | philohsophy/blockchain-supervisor | |
Models | philohsophy/blockchain-models |
Additionally the following external services will be used:
Service | Usage | Added? |
---|---|---|
Grafana | Visualization of Blockchain metrics | Yes |
Prometheus | Monitoring of metrics, i.e.: - amount of transactions waiting to be processed - min/max/avg processing time for transactions - running miner-instances |
In Process |
NATS | Async communication between components | No |
fluentd | Logging | No |
Jaeger | Tracing | No |
Clients for spawning transactions.
When users create transactions and submit them to the network, they are inserted into a pool. Miners can pick transactions from this pool and include them in a block.
Can use different forms of consensus algorithms, like:
- Proof of work
- Proof of stake
- Proof of activity
- ...
- Sets difficulty+Consensus
- Reviews proof-of-work
- Manages Blockchain (inserts new found blocks)
- Provides information about current Block (hash+id)
- Notifies Miners when a new valid Block has been found and accepted
Repository with shared data models used by all services:
- Transaction
- Block
Also provides convinience functions like schema-validation for each model
Hint: Use dark-mode (Profile → Settings → Appearance → "Default dark" / "Dark dimmed")
TODO