config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

	// LogLevel controls SDK logging (debug, info, warn, error). Default is error.
	LogLevel string

	// Logger is optional; when set, SDK operations emit diagnostics.
	Logger *zap.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