context

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ChainID             string        `mapstructure:"chain-id"`              // ChainID of the target chain
	NodeURI             string        `mapstructure:"node"`                  // Remote RPC URI of BandChain node to connect to
	Granter             string        `mapstructure:"granter"`               // The granter address
	GasPrices           string        `mapstructure:"gas-prices"`            // Gas prices of the transaction
	LogLevel            string        `mapstructure:"log-level"`             // Log level of the logger
	BroadcastTimeout    time.Duration `mapstructure:"broadcast-timeout"`     // The time that cylinder will wait for tx commit
	RPCPollInterval     time.Duration `mapstructure:"rpc-poll-interval"`     // The duration of rpc poll interval
	MaxTry              uint64        `mapstructure:"max-try"`               // The maximum number of tries to submit a report transaction
	GasAdjustStart      float64       `mapstructure:"gas-adjust-start"`      // The start value of gas adjustment
	GasAdjustStep       float64       `mapstructure:"gas-adjust-step"`       // The increment step of gas adjustment
	RandomSecret        tss.Scalar    `mapstructure:"random-secret"`         // The secret value that is used for random D,E
	CheckDEInterval     time.Duration `mapstructure:"check-de-interval"`     // The interval for updating DE
	CheckStatusInterval time.Duration `mapstructure:"check-status-interval"` // The interval for checking the status of the member
	MetricsListenAddr   string        `mapstructure:"metrics-listen-addr"`   // Address to use for metrics server
}

Config data structure for Cylinder process.

type Context

type Context struct {
	Config            *Config
	Keyring           keyring.Keyring
	Home              string
	Cdc               codec.Codec             // Codec for serialization.
	TxConfig          client.TxConfig         // Transaction configuration.
	InterfaceRegistry types.InterfaceRegistry // Interface registry for protobuf types.

	Logger *logger.Logger

	ErrCh                chan error
	PriorityMsgRequestCh chan msg.Request
	MsgRequestCh         chan msg.Request

	DataDir string
	Store   *store.Store
}

Context holds the context information for the Cylinder process.

func NewContext

func NewContext(
	cfg *Config,
	kr keyring.Keyring,
	home string,
	cdc codec.Codec,
	txConfig client.TxConfig,
	interfaceRegistry types.InterfaceRegistry,
) (*Context, error)

NewContext creates a new instance of the Context.

func (*Context) InitLog

func (ctx *Context) InitLog() error

func (*Context) WithDB

func (ctx *Context) WithDB(db dbm.DB) (*Context, error)

WithDB sets the DB for the context.

func (*Context) WithGoLevelDB

func (ctx *Context) WithGoLevelDB() (*Context, error)

WithGoLevelDB initializes the database of the context with GoLevelDB.

Jump to

Keyboard shortcuts

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