# All tests
go test ./... -v
# Specific packages
go test ./storage/... -v
go test ./middleware/... -v
go test ./broker/... -v# Terminal 1: Start broker
go run ./cmd/broker -id node-1
# You should see:
# 🚀 Starting Broker Node: node-1
# 📊 Metrics server started on :9090
# ✅ Server ready!# Terminal 2: Run demo client
go run ./examples/demo
# Expected output:
# ✅ Produced message 0 at offset 0
# 📖 Offset 0: Hello, World!
# ...curl http://localhost:9090/health
# OK
curl http://localhost:9090/ready
# LEADER (or FOLLOWER)
curl http://localhost:9090/metrics
# Prometheus metrics# Run all integration tests (single and multi-node)
go test -v ./tests/integration/... -timeout 180s
# Specific multi-node tests
go test -v ./tests/integration/... -run TestMultiNode# Terminal 1: Bootstrap node
go run . -id node-1 -grpc-port 8080 -raft-port 9080
# Terminal 2: Join cluster
go run . -id node-2 -grpc-port 8081 -raft-port 9081 -join localhost:8080
# Terminal 3: Join cluster
go run . -id node-3 -grpc-port 8082 -raft-port 9082 -join localhost:8080# Produce to leader
go run ./examples/demo
# Kill leader (Ctrl+C in Terminal 1)
# New leader elected automatically
# Produce still works on new leader
go run ./examples/demo# Throughput test (100k messages)
go test -v -run TestHighThroughput -timeout 2m
# Benchmark storage
go test -bench=. ./storage/...
# Benchmark compression
go test -bench=. ./middleware/...# Install grpcurl
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
# Produce
grpcurl -plaintext -d '{"topic":"test","record":"SGVsbG8="}' \
localhost:8080 v1.Log/Produce
# Consume
grpcurl -plaintext -d '{"topic":"test","offset":0}' \
localhost:8080 v1.Log/Consume
# List topics
grpcurl -plaintext -d '{}' \
localhost:8080 v1.Log/ListTopicsSee examples/demo/main.go for complete example.
- Check if ports are available:
8080,9080,9090 - Delete data directory:
rm -rf data/
- Ensure no broker is running
- Clean data:
rm -rf data/
- Ensure unique node IDs
- Ensure unique ports
- Check firewall settings