This example shows how to use PoW concept to protect server from DDoS attacks. The algorithm is based on SHA-3 family and PoW hashcash because it is the lightweight, simplest and modern proof-of-work algorithm, based firstly on CPU intensive proof of work, but solution can be extended to other PoW algorithms, based on requirements.
- Docker
- Golang
To start server and client with docker, you can use the following commands:
docker-compose up --buildOr it can be started just in separate processes on one host:
go build -o ./build/server ./cmd/server/main.go
go build -o ./build/client ./cmd/client/main.goAnd start in different terminals:
./build/server./build/clientgo test ./...build- build server and client
make buildrun- start server and client in docker
make dctest- run tests server and client with coverage report
make testlint- run linter
make lint