Documentation ¶
Index ¶
- func CheckQuery(logger *zap.Logger) error
- type ChainGovernor
- func (gov *ChainGovernor) CheckPending() ([]*common.MessagePublication, error)
- func (gov *ChainGovernor) CheckPendingForTime(now time.Time) ([]*common.MessagePublication, error)
- func (gov *ChainGovernor) CollectMetrics(hb *gossipv1.Heartbeat, sendC chan<- []byte, gk *ecdsa.PrivateKey, ...)
- func (gov *ChainGovernor) DropPendingVAA(vaaId string) (string, error)
- func (gov *ChainGovernor) GetAvailableNotionalByChain() []*publicrpcv1.GovernorGetAvailableNotionalByChainResponse_Entry
- func (gov *ChainGovernor) GetEnqueuedVAAs() []*publicrpcv1.GovernorGetEnqueuedVAAsResponse_Entry
- func (gov *ChainGovernor) GetTokenList() []*publicrpcv1.GovernorGetTokenListResponse_Entry
- func (gov *ChainGovernor) HashFromMsg(msg *common.MessagePublication) string
- func (gov *ChainGovernor) IsGovernedMsg(msg *common.MessagePublication) (msgIsGoverned bool, err error)
- func (gov *ChainGovernor) IsVAAEnqueued(msgId *publicrpcv1.MessageID) (bool, error)
- func (gov *ChainGovernor) PriceQuery(ctx context.Context) error
- func (gov *ChainGovernor) ProcessMsg(msg *common.MessagePublication) bool
- func (gov *ChainGovernor) ProcessMsgForTime(msg *common.MessagePublication, now time.Time) (bool, error)
- func (gov *ChainGovernor) ReleasePendingVAA(vaaId string) (string, error)
- func (gov *ChainGovernor) Reload() (string, error)
- func (gov *ChainGovernor) ResetReleaseTimer(vaaId string) (string, error)
- func (gov *ChainGovernor) Run(ctx context.Context) error
- func (gov *ChainGovernor) Status() string
- func (gov *ChainGovernor) TrimAndSumValue(transfers []*db.Transfer, startTime time.Time) (uint64, []*db.Transfer, error)
- func (gov *ChainGovernor) TrimAndSumValueForChain(ce *chainEntry, startTime time.Time) (sum uint64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckQuery ¶
CheckQuery is a free function used to test that the CoinGecko query still works after the mainnet token list has been updated.
Types ¶
type ChainGovernor ¶
type ChainGovernor struct {
// contains filtered or unexported fields
}
func NewChainGovernor ¶
func NewChainGovernor( logger *zap.Logger, db db.GovernorDB, env common.Environment, ) *ChainGovernor
func (*ChainGovernor) CheckPending ¶
func (gov *ChainGovernor) CheckPending() ([]*common.MessagePublication, error)
func (*ChainGovernor) CheckPendingForTime ¶
func (gov *ChainGovernor) CheckPendingForTime(now time.Time) ([]*common.MessagePublication, error)
func (*ChainGovernor) CollectMetrics ¶
func (gov *ChainGovernor) CollectMetrics(hb *gossipv1.Heartbeat, sendC chan<- []byte, gk *ecdsa.PrivateKey, ourAddr ethCommon.Address)
func (*ChainGovernor) DropPendingVAA ¶
func (gov *ChainGovernor) DropPendingVAA(vaaId string) (string, error)
Admin command to remove a VAA from the pending list and discard it.
func (*ChainGovernor) GetAvailableNotionalByChain ¶
func (gov *ChainGovernor) GetAvailableNotionalByChain() []*publicrpcv1.GovernorGetAvailableNotionalByChainResponse_Entry
REST query to get the current available notional value per chain.
func (*ChainGovernor) GetEnqueuedVAAs ¶
func (gov *ChainGovernor) GetEnqueuedVAAs() []*publicrpcv1.GovernorGetEnqueuedVAAsResponse_Entry
REST query to get the list of enqueued VAAs.
func (*ChainGovernor) GetTokenList ¶
func (gov *ChainGovernor) GetTokenList() []*publicrpcv1.GovernorGetTokenListResponse_Entry
REST query to get the list of tokens being monitored by the governor.
func (*ChainGovernor) HashFromMsg ¶
func (gov *ChainGovernor) HashFromMsg(msg *common.MessagePublication) string
func (*ChainGovernor) IsGovernedMsg ¶
func (gov *ChainGovernor) IsGovernedMsg(msg *common.MessagePublication) (msgIsGoverned bool, err error)
IsGovernedMsg determines if the message applies to the governor. It grabs the lock.
func (*ChainGovernor) IsVAAEnqueued ¶
func (gov *ChainGovernor) IsVAAEnqueued(msgId *publicrpcv1.MessageID) (bool, error)
REST query to see if a VAA is enqueued.
func (*ChainGovernor) PriceQuery ¶
func (gov *ChainGovernor) PriceQuery(ctx context.Context) error
PriceQuery is the entry point for the routine that periodically queries CoinGecko for prices.
func (*ChainGovernor) ProcessMsg ¶
func (gov *ChainGovernor) ProcessMsg(msg *common.MessagePublication) bool
Returns true if the message can be published, false if it has been added to the pending list.
func (*ChainGovernor) ProcessMsgForTime ¶
func (gov *ChainGovernor) ProcessMsgForTime(msg *common.MessagePublication, now time.Time) (bool, error)
func (*ChainGovernor) ReleasePendingVAA ¶
func (gov *ChainGovernor) ReleasePendingVAA(vaaId string) (string, error)
Admin command to remove a VAA from the pending list and publish it without regard to (or impact on) the daily limit.
func (*ChainGovernor) Reload ¶
func (gov *ChainGovernor) Reload() (string, error)
Admin command to reload the governor state from the database.
func (*ChainGovernor) ResetReleaseTimer ¶
func (gov *ChainGovernor) ResetReleaseTimer(vaaId string) (string, error)
Admin command to reset the release timer for a pending VAA, extending it to the configured limit.
func (*ChainGovernor) Status ¶
func (gov *ChainGovernor) Status() string
Admin command to display status to the log.
func (*ChainGovernor) TrimAndSumValue ¶
func (*ChainGovernor) TrimAndSumValueForChain ¶
func (gov *ChainGovernor) TrimAndSumValueForChain(ce *chainEntry, startTime time.Time) (sum uint64, err error)