Documentation ¶
Index ¶
- Constants
- Variables
- func NewChain(db *sqlx.DB, ks keystore.Terra, logCfg pg.LogConfig, eb pg.EventBroadcaster, ...) (*chain, error)
- func NewChainSet(opts ChainSetOpts) (*chainSet, error)
- func NewORM(db *sqlx.DB, lggr logger.Logger, cfg pg.LogConfig) types.ORM
- func SetupNodes(db *sqlx.DB, cfg SetupConfig, lggr logger.Logger) (err error)
- type ChainSet
- type ChainSetOpts
- type SetupConfig
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 NewChain ¶
func NewChain(db *sqlx.DB, ks keystore.Terra, logCfg pg.LogConfig, eb pg.EventBroadcaster, dbchain types.Chain, orm types.ORM, lggr logger.Logger) (*chain, error)
NewChain returns a new chain backed by node.
func NewChainSet ¶
func NewChainSet(opts ChainSetOpts) (*chainSet, error)
NewChainSet returns a new chain set for opts.
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.Chain, error) Remove(string) error Configure(ctx context.Context, id string, enabled bool, config db.ChainCfg) (types.Chain, error) ORM() types.ORM }
ChainSet extends terra.ChainSet with mutability and exposes the underlying ORM.
type ChainSetOpts ¶
type ChainSetOpts struct { Config coreconfig.GeneralConfig Logger logger.Logger DB *sqlx.DB KeyStore keystore.Terra EventBroadcaster pg.EventBroadcaster ORM types.ORM }
ChainSetOpts holds options for configuring a ChainSet.