Go to file
2025-08-23 19:05:21 +07:00
cmd Apply fmt 2025-08-23 18:52:43 +07:00
docs [PHASE-9] Production readiness 2025-08-23 18:33:02 +07:00
internal Apply fmt 2025-08-23 18:52:43 +07:00
test/integration Apply fmt 2025-08-23 18:52:43 +07:00
.mockery.yaml [PHASE-5] Implement application layer 2025-08-23 12:35:04 +07:00
.pre-commit-config.yaml Add pre-commit hook 2025-08-22 19:29:59 +07:00
config.yaml [PHASE-8] Add proper configuration 2025-08-23 17:49:32 +07:00
Dockerfile [PHASE-8] Introduce Dockerfile 2025-08-23 17:49:38 +07:00
go.mod [PHASE-8] Update dependencies 2025-08-23 16:01:09 +07:00
go.sum [PHASE-8] Update dependencies 2025-08-23 16:01:09 +07:00
README.md Update README.md 2025-08-23 19:05:21 +07:00
Taskfile.yml Update Taskfile 2025-08-23 18:57:46 +07:00

Hash of Wisdom

A TCP server implementing the "Word of Wisdom" concept with proof-of-work challenges to protect against DDoS attacks.

Overview

The Hash of Wisdom server requires clients to solve computational puzzles (proof-of-work) before receiving wise quotes. This approach prevents spam and DDoS attacks by requiring clients to invest CPU time for each request.

Quick Start

Prerequisites

  • Go 1.24.3+
  • Docker (optional)
  • Task (optional, but recommended)

Building

# Build server
go build -o hash-of-wisdom ./cmd/server

# Build client
go build -o client ./cmd/client

Running

# Most useful command - run all checks
task check

# Start server
task server -- -config config.yaml

# Connect client
task client -- --addr=localhost:8080

# Run tests
task test

# See coverage
task test-coverage

# See all available commands
task --list

Manual Commands

# Start server (uses config.yaml by default)
./hash-of-wisdom

# Or with custom config
./hash-of-wisdom -config /path/to/config.yaml

# Connect with client
./client -addr localhost:8080

# Run tests
go test ./...

Using Docker

# Build image
docker build -t hash-of-wisdom .

# Run container
docker run -p 8080:8080 -p 8081:8081 hash-of-wisdom

Monitoring

Documentation

Protocol & Implementation

Production Readiness