Documentation ¶
Index ¶
- Constants
- Variables
- func NewORM(db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig) types.ORM
- func NewORMImmut(cfgs chains.ChainConfig[string, *terradb.ChainCfg, terradb.Node]) types.ORM
- func SetupNodes(db *sqlx.DB, cfg SetupConfig, lggr logger.Logger) (err error)
- type ChainSet
- type ChainSetOpts
- type SetupConfig
- type TerraConfig
- func (c *TerraConfig) AsV1() types.DBChain
- func (c *TerraConfig) BlockRate() time.Duration
- func (c *TerraConfig) BlocksUntilTxTimeout() int64
- func (c *TerraConfig) ConfirmPollPeriod() time.Duration
- func (c *TerraConfig) FCDURL() url.URL
- func (c *TerraConfig) FallbackGasPriceULuna() sdk.Dec
- func (c *TerraConfig) GasLimitMultiplier() float64
- func (c *TerraConfig) IsEnabled() bool
- func (c *TerraConfig) MaxMsgsPerBatch() int64
- func (c *TerraConfig) OCR2CachePollPeriod() time.Duration
- func (c *TerraConfig) OCR2CacheTTL() time.Duration
- func (c *TerraConfig) SetFromDB(ch types.DBChain, nodes []db.Node) error
- func (c *TerraConfig) TxMsgTimeout() time.Duration
- func (c *TerraConfig) Update(cfg db.ChainCfg)
- func (c *TerraConfig) ValidateConfig() (err error)
- type TerraConfigs
- type TerraNodes
Constants ¶
const DefaultRequestTimeout = 30 * time.Second
DefaultRequestTimeout is the default Terra client timeout. Note that while the terra node is processing a heavy block, requests can be delayed significantly (https://github.com/tendermint/tendermint/issues/6899), however there's nothing we can do but wait until the block is processed. So we set a fairly high timeout here.
Variables ¶
var ( // ErrChainIDEmpty is returned when chain is required but was empty. ErrChainIDEmpty = errors.New("chain id empty") // ErrChainIDInvalid is returned when a chain id does not match any configured chains. ErrChainIDInvalid = errors.New("chain id does not match any local chains") )
Functions ¶
func NewORM ¶
NewORM returns an ORM backed by db. https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config
func NewORMImmut ¶ added in v1.10.0
func SetupNodes ¶ added in v1.4.0
SetupNodes is a hack/shim method to allow node operators to specify multiple nodes via ENV. See: https://app.shortcut.com/chainlinklabs/epic/33587/overhaul-config?cf_workflow=500000005&ct_workflow=all
Types ¶
type ChainSet ¶
type ChainSet interface { terra.ChainSet Add(context.Context, string, *db.ChainCfg) (types.DBChain, error) Remove(string) error Configure(ctx context.Context, id string, enabled bool, config *db.ChainCfg) (types.DBChain, error) Show(id string) (types.DBChain, error) Index(offset, limit int) ([]types.DBChain, int, error) GetNodes(ctx context.Context, offset, limit int) (nodes []db.Node, count int, err error) GetNodesForChain(ctx context.Context, chainID string, offset, limit int) (nodes []db.Node, count int, err error) CreateNode(ctx context.Context, data db.Node) (db.Node, error) DeleteNode(ctx context.Context, id int32) error }
ChainSet extends terra.ChainSet with mutability and exposes the underlying ORM.
func NewChainSet ¶
func NewChainSet(opts ChainSetOpts) (ChainSet, error)
NewChainSet returns a new chain set for opts. https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config
func NewChainSetImmut ¶ added in v1.10.0
func NewChainSetImmut(opts ChainSetOpts, cfgs TerraConfigs) (ChainSet, error)
type ChainSetOpts ¶
type ChainSetOpts struct { Config coreconfig.BasicConfig Logger logger.Logger DB *sqlx.DB KeyStore keystore.Terra EventBroadcaster pg.EventBroadcaster ORM types.ORM }
ChainSetOpts holds options for configuring a ChainSet.
func (*ChainSetOpts) NewChain ¶ added in v1.5.0
https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config
func (*ChainSetOpts) NewTOMLChain ¶ added in v1.10.0
func (o *ChainSetOpts) NewTOMLChain(cfg *TerraConfig) (terra.Chain, error)
func (*ChainSetOpts) ORMAndLogger ¶ added in v1.5.0
func (*ChainSetOpts) Validate ¶ added in v1.5.0
func (o *ChainSetOpts) Validate() (err error)
type SetupConfig ¶ added in v1.4.0
type TerraConfig ¶ added in v1.10.0
type TerraConfig struct { ChainID *string Enabled *bool tercfg.Chain Nodes TerraNodes }
func (*TerraConfig) AsV1 ¶ added in v1.10.0
func (c *TerraConfig) AsV1() types.DBChain
func (*TerraConfig) BlockRate ¶ added in v1.10.0
func (c *TerraConfig) BlockRate() time.Duration
func (*TerraConfig) BlocksUntilTxTimeout ¶ added in v1.10.0
func (c *TerraConfig) BlocksUntilTxTimeout() int64
func (*TerraConfig) ConfirmPollPeriod ¶ added in v1.10.0
func (c *TerraConfig) ConfirmPollPeriod() time.Duration
func (*TerraConfig) FCDURL ¶ added in v1.10.0
func (c *TerraConfig) FCDURL() url.URL
func (*TerraConfig) FallbackGasPriceULuna ¶ added in v1.10.0
func (c *TerraConfig) FallbackGasPriceULuna() sdk.Dec
func (*TerraConfig) GasLimitMultiplier ¶ added in v1.10.0
func (c *TerraConfig) GasLimitMultiplier() float64
func (*TerraConfig) IsEnabled ¶ added in v1.10.0
func (c *TerraConfig) IsEnabled() bool
func (*TerraConfig) MaxMsgsPerBatch ¶ added in v1.10.0
func (c *TerraConfig) MaxMsgsPerBatch() int64
func (*TerraConfig) OCR2CachePollPeriod ¶ added in v1.10.0
func (c *TerraConfig) OCR2CachePollPeriod() time.Duration
func (*TerraConfig) OCR2CacheTTL ¶ added in v1.10.0
func (c *TerraConfig) OCR2CacheTTL() time.Duration
func (*TerraConfig) TxMsgTimeout ¶ added in v1.10.0
func (c *TerraConfig) TxMsgTimeout() time.Duration
func (*TerraConfig) Update ¶ added in v1.10.0
func (c *TerraConfig) Update(cfg db.ChainCfg)
func (*TerraConfig) ValidateConfig ¶ added in v1.10.0
func (c *TerraConfig) ValidateConfig() (err error)
type TerraConfigs ¶ added in v1.10.0
type TerraConfigs []*TerraConfig
func (TerraConfigs) Chains ¶ added in v1.10.0
func (cs TerraConfigs) Chains(ids ...string) (chains []types.DBChain)
func (TerraConfigs) Node ¶ added in v1.10.0
func (cs TerraConfigs) Node(name string) (n db.Node, err error)
func (TerraConfigs) Nodes ¶ added in v1.10.0
func (cs TerraConfigs) Nodes() (ns []db.Node)
func (TerraConfigs) NodesByID ¶ added in v1.10.0
func (cs TerraConfigs) NodesByID(chainIDs ...string) (ns []db.Node)
func (TerraConfigs) ValidateConfig ¶ added in v1.10.0
func (cs TerraConfigs) ValidateConfig() (err error)