This project implements a simplified version of the Casper FFG (Friendly Finality Gadget) consensus mechanism in Go. It simulates a blockchain network with validators, voting, and finalization processes.
casperffg/
│
├── cmd/
│ └── simulator/
│ └── main.go
├── blockchain/
│ ├── block.go
│ └── chain.go
├── consensus/
│ ├── casper.go
│ └── vote.go
├── validator/
│ └── validator.go
├── config/
│ └── config.go
├── utils/
│ └── hashing.go
├── test/
│ └── simulation_test.go
├── README.md
└── go.mod
- Clone the repository
- Navigate to the project directory
- Run
go mod tidy
to ensure all dependencies are correctly managed - Run the simulation with
go run cmd/simulator/main.go
To run the tests, use the following command:
go test ./test
- Implement more sophisticated fork resolution mechanisms
- Add support for transactions within blocks
- Implement a simple API for interacting with the simulation
- Improve test coverage and add benchmarks
- Add logging and error handling