config

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyWaitTxDefaults

func ApplyWaitTxDefaults(cfg *WaitTxConfig)

ApplyWaitTxDefaults normalizes zero or negative values using defaults.

Types

type Config

type Config struct {
	// Blockchain connection
	ChainID      string
	GRPCEndpoint string // Lumera blockchain gRPC endpoint
	RPCEndpoint  string // Lumera RPC endpoint for websocket subscriptions

	// Account settings
	Address string // Your cosmos address (lumera1...)
	KeyName string // Key name in keyring

	// Timeouts
	BlockchainTimeout time.Duration
	StorageTimeout    time.Duration

	// Optional overrides
	MaxRetries     int
	MaxRecvMsgSize int // Max message size for gRPC (default: 50MB)
	MaxSendMsgSize int

	// WaitTx controls transaction confirmation behaviour.
	WaitTx WaitTxConfig

	// Logger is optional; when set, SDK operations emit diagnostics.
	Logger sdklog.Logger
}

Config holds all configuration for the Lumera client.

func Default

func Default() Config

Default returns a configuration with sensible defaults for testnet.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid and populates defaults.

type WaitTxConfig

type WaitTxConfig struct {
	// SubscriberSetupTimeout defines how long we wait for the websocket subscription to become
	// ready during the initial setup phase.
	SubscriberSetupTimeout time.Duration

	// Polling is a fallback mechanism when a websocket subscription is not available.
	// PollInterval controls how frequently the fallback poller queries gRPC for the tx.
	PollInterval time.Duration
	// PollMaxRetries limits the number of poll attempts before failing (0 => unlimited until ctx deadline).
	PollMaxRetries int
	// PollBackoffMultiplier > 1 enables exponential growth for poll intervals.
	PollBackoffMultiplier float64
	// PollBackoffMaxInterval caps the exponential backoff delay (0 => unlimited).
	PollBackoffMaxInterval time.Duration
	// PollBackoffJitter randomizes delays (0..1) to avoid synced retries.
	PollBackoffJitter float64
}

WaitTxConfig configures how the SDK waits for transaction inclusion.

func DefaultWaitTxConfig

func DefaultWaitTxConfig() WaitTxConfig

DefaultWaitTxConfig returns recommended defaults for wait-tx behaviour.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL