You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,14 @@
1
1
# Lumera SDK Agent Guide
2
2
3
3
## Architecture & Config
4
-
-`client.Client` (`client/client.go`) fans out to both `blockchain.Client` and `cascade.Client`; add new modules by extending `client.New` so options/config stay in lockstep.
5
-
-`client/config.go` hydrates timeouts, 50 MB gRPC limits, retry counts, and `WaitTx` knobs; use `DefaultConfig()` in samples/tests to avoid zero durations.
6
-
-`blockchain/client.go` enforces `ensureLumeraBech32Prefixes` and selects TLS using `shouldUseTLS`; follow this heuristic instead of forcing creds per call.
4
+
-`client.Client` ([client/client.go](../client/client.go)) fans out to both `blockchain.Client` and `cascade.Client`; add new modules by extending `client.New` so options/config stay in lockstep.
5
+
- Config defaults live in `client/config/config.go`; `Config.Validate()` hydrates timeouts, 50 MB gRPC limits, retry counts, and `WaitTx` knobs. Use `client.DefaultConfig()` (alias in `client/config_alias.go`) in samples/tests to avoid zero durations.
6
+
- TLS selection lives in `blockchain/base/client.go` (`shouldUseTLS`); follow this heuristic instead of forcing creds per call (unless `InsecureGRPC` is set).
7
+
- Address derivation uses `pkg/crypto.AddressFromKey` to avoid mutating global Bech32 config; do not call Cosmos prefix setters in SDK flows.
7
8
-`cascade/client.go` wraps the SuperNode SDK via `snconfig.NewConfig`; new Cascade entry points must reuse the same keyring/key name to share signatures.
8
9
9
10
## Transactions & Waiting
10
-
-`blockchain/tx.go` centralizes the tx lifecycle: build with `NewDefaultTxConfig`, resolve account/sequence, simulate gas (adds 30 % buffer), set min `ulume` fees (0.025 gas price), sign with `internal/crypto.SignTxWithKeyring`.
11
+
-`blockchain/base/tx.go` centralizes the tx lifecycle: build with `pkg/crypto.NewDefaultTxConfig`, resolve account/sequence, simulate gas (default 1.3x buffer), set min fees from `Config.GasPrice`/`Config.FeeDenom` (defaults set in `blockchain.New`), sign with `pkg/crypto.SignTxWithKeyring`.
11
12
- Always broadcast through `Client.Broadcast` + `WaitForTxInclusion`; the waiter (`internal/wait-tx`) prefers CometBFT websockets via `WaitTxConfig.RPCEndpoint` and falls back to gRPC polling.
12
13
-`blockchain.Client.ExtractEventAttribute` is how examples retrieve IDs; keep event parsing there so higher layers stay clean.
13
14
@@ -22,13 +23,13 @@
22
23
-`cascade.TaskManager` polls `snsdk.Client.GetTask` every second until `COMPLETED`/`FAILED`; extend this manager for new task types instead of bespoke loops.
23
24
24
25
## Keyring & Examples
25
-
-`internal/crypto.NewKeyring`, `GetKey`, and `NewDefaultTxConfig` wrap Cosmos keyring and proto registration; all examples (`examples/*`) show the expected bootstrapping/flag pattern.
26
-
-`ensureLumeraBech32Prefixes` seals global Bech32 config once; avoid calling Cosmos prefix setters elsewhere to prevent panics.
26
+
-`pkg/crypto.NewKeyring`, `GetKey`, and `NewDefaultTxConfig` wrap Cosmos keyring and proto registration; all examples (`examples/*`) show the expected bootstrapping/flag pattern.
27
+
-`pkg/crypto.AddressFromKey` derives bech32 addresses without mutating global prefixes; avoid calling Cosmos prefix setters elsewhere to prevent panics.
27
28
28
29
## Developer Workflows
29
30
-`make sdk` (same as `make build`) compiles all packages; `make examples` or `make example-<name>` drops binaries into `build/`.
30
31
-`make test` runs `go test -race -coverprofile=coverage.out ./...` and emits `coverage.html`; `make lint` requires `golangci-lint`.
31
-
- Stick to Go 1.25.1 (per `go.mod`) and respect the `replace` pins for CometBFT/Cosmos; update both blockchain + SuperNode deps together when bumping versions.
32
+
- Stick to Go 1.25.5 (per `go.mod`) and respect the `replace` pins for CometBFT/Cosmos; update both blockchain + SuperNode deps together when bumping versions.
32
33
33
34
## Conventions
34
35
- Errors wrap context with `fmt.Errorf("context: %w", err)` so callers can unwrap lower layers.
0 commit comments