Documentation ¶
Index ¶
- Constants
- func SetupNodes(db *sqlx.DB, cfg SetupConfig, lggr logger.Logger) (err error)
- type ChainSet
- type ChainSetOpts
- type DBChain
- type ORM
- type SetupConfig
- type SolanaConfig
- func (c *SolanaConfig) AsV1() DBChain
- func (c *SolanaConfig) BalancePollPeriod() time.Duration
- func (c *SolanaConfig) Commitment() rpc.CommitmentType
- func (c *SolanaConfig) ConfirmPollPeriod() time.Duration
- func (c *SolanaConfig) IsEnabled() bool
- func (c *SolanaConfig) MaxRetries() *uint
- func (c *SolanaConfig) OCR2CachePollPeriod() time.Duration
- func (c *SolanaConfig) OCR2CacheTTL() time.Duration
- func (c *SolanaConfig) SetFrom(f *SolanaConfig)
- func (c *SolanaConfig) SetFromDB(ch DBChain, nodes []soldb.Node) error
- func (c *SolanaConfig) SkipPreflight() bool
- func (c *SolanaConfig) TxConfirmTimeout() time.Duration
- func (c *SolanaConfig) TxRetryTimeout() time.Duration
- func (c *SolanaConfig) TxTimeout() time.Duration
- func (c *SolanaConfig) Update(cfg soldb.ChainCfg)
- func (c *SolanaConfig) ValidateConfig() (err error)
- type SolanaConfigs
- func (cs SolanaConfigs) Chains(ids ...string) (chains []DBChain)
- func (cs SolanaConfigs) Node(name string) (soldb.Node, error)
- func (cs SolanaConfigs) Nodes() (ns []soldb.Node)
- func (cs SolanaConfigs) NodesByID(chainIDs ...string) (ns []soldb.Node)
- func (cs *SolanaConfigs) SetFrom(fs *SolanaConfigs)
- func (cs SolanaConfigs) ValidateConfig() (err error)
- type SolanaNodes
Constants ¶
const DefaultRequestTimeout = 30 * time.Second
DefaultRequestTimeout is the default Solana client timeout.
Variables ¶
This section is empty.
Functions ¶
func SetupNodes ¶
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 { solana.ChainSet Add(context.Context, string, *db.ChainCfg) (DBChain, error) Remove(string) error Configure(ctx context.Context, id string, enabled bool, config *db.ChainCfg) (DBChain, error) Show(id string) (DBChain, error) Index(offset, limit int) ([]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 solana.ChainSet with mutability.
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 SolanaConfigs) (ChainSet, error)
type ChainSetOpts ¶
ChainSetOpts holds options for configuring a ChainSet.
func (*ChainSetOpts) NewChain ¶ added in v1.5.0
func (o *ChainSetOpts) NewChain(dbchain DBChain) (solana.Chain, error)
https://app.shortcut.com/chainlinklabs/story/33622/remove-legacy-config
func (*ChainSetOpts) NewTOMLChain ¶ added in v1.10.0
func (o *ChainSetOpts) NewTOMLChain(cfg *SolanaConfig) (solana.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 ORM ¶
type ORM interface { Chain(string, ...pg.QOpt) (DBChain, error) Chains(offset, limit int, qopts ...pg.QOpt) ([]DBChain, int, error) CreateChain(id string, config *soldb.ChainCfg, qopts ...pg.QOpt) (DBChain, error) UpdateChain(id string, enabled bool, config *soldb.ChainCfg, qopts ...pg.QOpt) (DBChain, error) DeleteChain(id string, qopts ...pg.QOpt) error GetChainsByIDs(ids []string) (chains []DBChain, err error) EnabledChains(...pg.QOpt) ([]DBChain, error) CreateNode(soldb.Node, ...pg.QOpt) (soldb.Node, error) DeleteNode(int32, ...pg.QOpt) error GetNodesByChainIDs(chainIDs []string, qopts ...pg.QOpt) (nodes []soldb.Node, err error) NodeNamed(string, ...pg.QOpt) (soldb.Node, error) Nodes(offset, limit int, qopts ...pg.QOpt) (nodes []soldb.Node, count int, err error) NodesForChain(chainID string, offset, limit int, qopts ...pg.QOpt) (nodes []soldb.Node, count int, err error) SetupNodes([]soldb.Node, []string) error EnsureChains([]string, ...pg.QOpt) error StoreString(chainID string, key, val string) error Clear(chainID string, key string) error }
ORM manages solana chains and nodes.
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
type SetupConfig ¶
type SolanaConfig ¶ added in v1.10.0
type SolanaConfig struct { ChainID *string Enabled *bool solcfg.Chain Nodes SolanaNodes }
func (*SolanaConfig) AsV1 ¶ added in v1.10.0
func (c *SolanaConfig) AsV1() DBChain
func (*SolanaConfig) BalancePollPeriod ¶ added in v1.10.0
func (c *SolanaConfig) BalancePollPeriod() time.Duration
func (*SolanaConfig) Commitment ¶ added in v1.10.0
func (c *SolanaConfig) Commitment() rpc.CommitmentType
func (*SolanaConfig) ConfirmPollPeriod ¶ added in v1.10.0
func (c *SolanaConfig) ConfirmPollPeriod() time.Duration
func (*SolanaConfig) IsEnabled ¶ added in v1.10.0
func (c *SolanaConfig) IsEnabled() bool
func (*SolanaConfig) MaxRetries ¶ added in v1.10.0
func (c *SolanaConfig) MaxRetries() *uint
func (*SolanaConfig) OCR2CachePollPeriod ¶ added in v1.10.0
func (c *SolanaConfig) OCR2CachePollPeriod() time.Duration
func (*SolanaConfig) OCR2CacheTTL ¶ added in v1.10.0
func (c *SolanaConfig) OCR2CacheTTL() time.Duration
func (*SolanaConfig) SetFrom ¶ added in v1.11.0
func (c *SolanaConfig) SetFrom(f *SolanaConfig)
func (*SolanaConfig) SetFromDB ¶ added in v1.10.0
func (c *SolanaConfig) SetFromDB(ch DBChain, nodes []soldb.Node) error
func (*SolanaConfig) SkipPreflight ¶ added in v1.10.0
func (c *SolanaConfig) SkipPreflight() bool
func (*SolanaConfig) TxConfirmTimeout ¶ added in v1.10.0
func (c *SolanaConfig) TxConfirmTimeout() time.Duration
func (*SolanaConfig) TxRetryTimeout ¶ added in v1.10.0
func (c *SolanaConfig) TxRetryTimeout() time.Duration
func (*SolanaConfig) TxTimeout ¶ added in v1.10.0
func (c *SolanaConfig) TxTimeout() time.Duration
func (*SolanaConfig) Update ¶ added in v1.10.0
func (c *SolanaConfig) Update(cfg soldb.ChainCfg)
func (*SolanaConfig) ValidateConfig ¶ added in v1.10.0
func (c *SolanaConfig) ValidateConfig() (err error)
type SolanaConfigs ¶ added in v1.10.0
type SolanaConfigs []*SolanaConfig
func (SolanaConfigs) Chains ¶ added in v1.10.0
func (cs SolanaConfigs) Chains(ids ...string) (chains []DBChain)
func (SolanaConfigs) Node ¶ added in v1.10.0
func (cs SolanaConfigs) Node(name string) (soldb.Node, error)
func (SolanaConfigs) Nodes ¶ added in v1.10.0
func (cs SolanaConfigs) Nodes() (ns []soldb.Node)
func (SolanaConfigs) NodesByID ¶ added in v1.10.0
func (cs SolanaConfigs) NodesByID(chainIDs ...string) (ns []soldb.Node)
func (*SolanaConfigs) SetFrom ¶ added in v1.11.0
func (cs *SolanaConfigs) SetFrom(fs *SolanaConfigs)
func (SolanaConfigs) ValidateConfig ¶ added in v1.10.0
func (cs SolanaConfigs) ValidateConfig() (err error)
type SolanaNodes ¶ added in v1.10.0
func (*SolanaNodes) SetFrom ¶ added in v1.11.0
func (ns *SolanaNodes) SetFrom(fs *SolanaNodes)