This guide gets you from zero to running tests in under 5 minutes.
Prerequisites
| Tool | Required | Version | Install |
|---|---|---|---|
| Go | Yes | 1.26+ | go.dev/dl |
| Git | Yes | 2.x | system package manager |
| Fossil | For sim/interop tests | 2.x | brew install fossil / apt install fossil |
| Doppler | For OTel export only | any | brew install doppler then doppler login |
Check your environment at any time:
bin/edgesync doctor
Setup
git clone https://github.com/danmestas/EdgeSync.git
cd EdgeSync
make setup-hooks # installs pre-commit test gate (~8s)
make build # produces bin/edgesync, bin/leaf, bin/bridge
make test # run CI-level tests (~15s)
That's it. You're ready to develop.
Key Commands
# Daily development
make test # unit + DST + sim serve + interop-short
make dst # deterministic sim: 8 seeds (~2s)
# Deeper testing (requires fossil binary)
make sim # integration sim: 1 seed (~120s)
make sim-full # 16 seeds x 3 fault severities
make test-interop # wire-compatible with real fossil
# SQLite driver matrix
make drivers # test modernc, ncruces, mattn
# Build targets
make build # all binaries
make wasm # WASM builds (wasip1 + browser)
Running a Leaf Agent
# Create a test repo
bin/edgesync repo new /tmp/test.fossil
# Start leaf agent with verbose output
bin/leaf --repo /tmp/test.fossil --serve-http :8080 --verbose
# In another terminal, clone via stock fossil:
fossil clone http://localhost:8080 /tmp/cloned.fossil
Project Structure (Reading Order)
Start broad, go deep as needed:
- README.md -- Architecture diagram, project layout, module table
- docs/leaf-agent.md -- Leaf agent usage, flags, config
- docs/bridge.md -- Bridge usage and deployment
- Architecture docs (in
docs/architecture/):core-library.md-- libfossil package design, blob format, SQLite driverssync-protocol.md-- xfer card protocol, client/server flow, UV synctesting-strategy.md-- test tiers (unit, DST, sim, interop), BUGGIFYagent-deployment.md-- Docker, Hetzner VPS, Cloudflare Tunnelcheckout-merge.md-- checkout/checkin, merge strategies, fork preventionrepo-operations.md-- CLI, tags, FTS, auth, shun/purge
Things to Know
-buildvcs=falseis required for rawgo build(dual VCS: git + fossil). The Makefile handles this for you.- Five Go modules in a workspace (
go.work): root, libfossil, leaf, bridge, dst. Usego test ./libfossil/...etc. - Three SQLite drivers: modernc (default, pure Go), ncruces (WASM-based), mattn (CGo). Switch via build tags.
fossil/andlibfossil/directories are gitignored -- upstream C reference checkouts for porting. They exist on some dev machines but aren't tracked.- Pre-commit hook runs ~8s of tests. Skip with
git commit --no-verify(emergency only). - Telemetry is optional. Everything works without Doppler/OTel. Set
OTEL_EXPORTER_OTLP_ENDPOINTto enable.