Skip to content

clients/go: bootstrap the Go SDK module - #512

Open
bkeroack wants to merge 1 commit into
masterfrom
feat/go-sdk-bootstrap
Open

clients/go: bootstrap the Go SDK module#512
bkeroack wants to merge 1 commit into
masterfrom
feat/go-sdk-bootstrap

Conversation

@bkeroack

@bkeroack bkeroack commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

First of an 8-PR stack implementing the official Go SDK for satd's streaming events API, per SATD_GO_SDK_PLAN.md. Merge bottom-up in stack order.

What this lands

clients/go as an independently versioned Go module inside this repo — module path github.com/epochbtc/satd/clients/go, released as clients/go/vX.Y.Z tags. No collision with the node's v0.5.0 tags because there is no go.mod at the repo root; consumers pull a zip of the module subtree only, not the Rust tree.

  • go.modgo directive at (latest stable − 1) for Go's two-release support window; dependencies are gRPC + protobuf only.
  • tools/go.mod — pinned buf, protoc-gen-go, protoc-gen-go-grpc, staticcheck, errcheck, in their own module so the whole buf tree never enters a consumer's graph or forces an MVS bump on an application that just imports the client.
  • buf.gen.yaml + gen.sh — buf with managed mode injects go_package at generation time, so the shared satd-events-proto/proto/satd/events/v1/events.proto needs no Go-specific edit and the Rust prost build is untouched. buf brings its own compiler, so nothing needs a system protoc.
  • eventspb/ — the generated bindings, committed: go get must work with no protoc, no buf, and no Rust toolchain.
  • lint.sh, staticcheck.conf, doc.go, README.md.

CI

  • Tests job: actions/setup-go (version from go.mod, module cache on) + go test ./clients/go/....
  • Lint job: gofmt, go vet, staticcheck (SA + unused classes; style classes off), errcheck, and the codegen drift check (gen.sh then git diff --exit-code clients/go/eventspb) — so a proto change that lands without regenerated bindings fails the PR that made it.

The SDK will not be dogfooded directly, so CI is the only thing between a green badge and a rotted client. Every layer gates PRs from its first landing; the E2E and differential-parity layers arrive with the surfaces they cover in later PRs of the stack.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GJqZbJtTUo7K7G9wJcrvHv

Stands up `clients/go` as an independently versioned Go module inside this
repo (module path github.com/epochbtc/satd/clients/go, released as
`clients/go/vX.Y.Z` tags — no collision with the node's own tags because
there is no go.mod at the repo root).

Why in-repo rather than a separate SDK repository: the Go E2E suite drives
the same freshly built satd binary the Rust E2E suite does and gates every
PR, proto changes and both SDKs land atomically, and nothing rots between
releases in a repo nobody watches. The SDK will not be dogfooded directly,
so CI is the only thing standing between a green badge and a rotted client.

Codegen is buf with managed mode: `go_package` is injected at generation
time, so the shared satd.events.v1 proto needs no Go-specific edit and the
Rust prost build is untouched. The bindings are committed (`go get` must
work with no protoc, no buf, no Rust toolchain) and CI re-runs `gen.sh` and
fails on a diff, so they cannot drift from the proto.

The generators and linters live in a sibling `tools` module. Declaring them
in the SDK's own go.mod would put the whole buf tree in every consumer's
module graph and could force MVS version bumps on applications that only
import the client; this way the published graph stays exactly gRPC +
protobuf.

CI wiring:
- Tests job: setup-go + `go test ./clients/go/...`.
- Lint job: gofmt, go vet, staticcheck (SA + unused classes; style classes
  stay off), errcheck, and the codegen drift check.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GJqZbJtTUo7K7G9wJcrvHv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant