Quick setup guide for getting TinkerDB up and running. Please note that these steps set up the database to work as I intended it to. If you wish to tinker with the code (pun intended) then feel free to set the project up as per your requirements.
Verify:
go version # Should show Go 1.21 or laterVerify:
protoc --version # Should show libprotoc 3.x or latercd TinkerDBmake depsThis installs:
protoc-gen-go- Protocol Buffers Go pluginprotoc-gen-go-grpc- gRPC Go plugin- All Go dependencies from
go.mod
make protoThis generates:
proto/kvstore/kvstore.pb.go- Protocol Buffers messagesproto/kvstore/kvstore_grpc.pb.go- gRPC service code
make testExpected output: All tests pass with coverage report.
make buildThis creates: bin/tinkerdb-server
Option 1: Using Make
make serverOption 2: Using Go
go run cmd/server/main.goTo use a custom Port:
TINKERDB_PORT=<port number> make serverTinkerDB server starting on port 50051...
Server is ready to accept connections
Solution: Install Protocol Buffers compiler (see Prerequisites)
Solution:
go mod download
go mod tidySolution:
make protoSolution:
# Find and kill process using port 50051
lsof -ti:50051 | xargs kill -9
# Or use a different port
TINKERDB_PORT=8080 make server- Go: 1.21 or later
- Protocol Buffers: 3.x or later
- OS: macOS, Linux, or Windows
- Memory: 100MB minimum
- Disk: 50MB for dependencies and build artifacts
All tests:
make testWith coverage report:
make test-coverage
open coverage.htmlSpecific package:
go test -v ./internal/storage/
go test -v ./internal/server/
go test -v ./test/Run benchmarks:
go test -bench=. -benchmem ./...