cmd/blocowallet/: CLI entry point (version injected at build).internal/: Non-exported app codewallet/(keystore, mnemonics),ui/(Bubble Tea TUI),blockchain/,storage/(GORM+SQLite).
pkg/: Reusable packages —config/(TOML + env),localization/,logger/.build/,dist/(artifacts),docs/(design/testing),fonts/(assets).
make build: Build current platform tobuild/bloco-wallet.make build-all: Cross-compile (Linux/macOS/Windows). Archives indist/.make t/make test-fast: Fast tests (dev parameters).make test: Full suite with race detector (optimized params).make test-production: Tests with production crypto params (-tags=production).make cover/make bench: Coverage HTML and benchmarks.make lint/make fmt/make vet: Lint, format, vet.
Examples:
make deps && make build
CGO_LDFLAGS="-Wl,-ld_classic" make test # macOS
go test ./... -v -tags=production # direct Go- Language: Go 1.23+. Format with
go fmt; lint withgolangci-lint(viamake lint). - Indentation: tabs (Go default). Line length: keep readable; prefer small functions.
- Packages: lower-case short names; files use
snake_case.go. - Exported identifiers:
CamelCase; unexported:camelCase. Errors useerrorvalues, wrap with context. - Module imports: start with
blocowallet/....
- Framework: standard
testingpackage; tests co-located as*_test.go. - Modes: fast (default) vs production (
-tags=production). SeeTESTING.md. - Naming:
TestXxx, short focused cases; add benches for crypto/IO hotspots. - Minimum: ensure
make t,make lintpass before PR; aim to keep/raise coverage.
- Commits: follow Conventional Commits (e.g.,
feat:,fix:,chore:) as seen in history. - PRs: clear description, link issues, include screenshots/GIFs for TUI changes, list test scope.
- Checklist:
make t/make lintgreen, update docs when flags/UI change, avoid committing keys/keystores.
- Do not commit secrets, private keys, or real keystores. Use
internal/wallet/testdataonly for tests. - Config lives under the per-OS app dir (resolved by
pkg/config); env prefix:BLOCO_WALLET_(e.g.,BLOCO_WALLET_APP_APP_DIR). - SQLite requires CGO; macOS linker warnings are handled via
CGO_LDFLAGSin the Makefile.