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 --build
Or 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.go
And start in different terminals:
./build/server
./build/client
go test ./...
build
- build server and client
make build
run
- start server and client in docker
make dc
test
- run tests server and client with coverage report
make test
lint
- run linter
make lint