Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultRequestTimeout = 30 * time.Second
DefaultRequestTimeout is the default Solana client timeout.
Variables ¶
This section is empty.
Functions ¶
func NewChain ¶
func NewChain(db *sqlx.DB, ks keystore.Solana, logCfg pg.LogConfig, eb pg.EventBroadcaster, dbchain DBChain, orm ORM, lggr logger.Logger) (*chain, error)
NewChain returns a new chain backed by node.
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.
type ChainSetOpts ¶
type ChainSetOpts struct { Config coreconfig.GeneralConfig Logger logger.Logger DB *sqlx.DB KeyStore keystore.Solana EventBroadcaster pg.EventBroadcaster ORM ORM }
ChainSetOpts holds options for configuring a ChainSet.
func (*ChainSetOpts) NewChain ¶ added in v1.5.0
func (o *ChainSetOpts) NewChain(dbchain DBChain) (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) Node(int32, ...pg.QOpt) (soldb.Node, 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 StoreString(chainID string, key, val string) error Clear(chainID string, key string) error }
ORM manages solana chains and nodes.
type SetupConfig ¶
Click to show internal directories.
Click to hide internal directories.