Versions in this module Expand all Collapse all v0 v0.0.1 May 19, 2021 Changes in this version + const MinFundedRounds + const PriorityAnswerUpdatedLog + const PriorityFlagChangedLog + const PriorityNewRoundLog + var ErrNotEligible = errors.New("not eligible to submit") + var ErrPaymentTooLow = errors.New("round payment amount < minimum contract payment") + var ErrUnderfunded = errors.New("aggregator is underfunded") + var FluxAggregatorABI = eth.MustGetABI(flux_aggregator_wrapper.FluxAggregatorABI) + func NewORM(db *gorm.DB) *orm + func ValidatedFluxMonitorSpec(config *coreorm.Config, ts string) (job.Job, error) + type Config struct + DefaultHTTPTimeout time.Duration + EthGasLimit uint64 + FlagsContractAddress string + MaxUnconfirmedTransactions uint64 + MinContractPayment *assets.Adam + func (c *Config) MinimumPollingInterval() time.Duration + type ContractSubmitter interface + Submit func(roundID *big.Int, submission *big.Int) error + type Delegate struct + func NewDelegate(store *corestore.Store, jobORM job.ORM, pipelineORM pipeline.ORM, ...) *Delegate + func (d *Delegate) JobType() job.Type + func (d *Delegate) ServicesForSpec(spec job.Job) (services []job.Service, err error) + type DeviationChecker struct + Thresholds DeviationThresholds + func NewDeviationChecker(rel, abs float64) *DeviationChecker + func NewZeroDeviationChecker() *DeviationChecker + func (c *DeviationChecker) OutsideDeviation(curAnswer, nextAnswer decimal.Decimal) bool + type DeviationThresholds struct + Abs float64 + Rel float64 + type Flags struct + func NewFlags(addrHex string, ethClient eth.Client) (*Flags, error) + func (f *Flags) Contract() flags_wrapper.FlagsInterface + func (f *Flags) ContractExists() bool + func (f *Flags) IsLowered(contractAddr common.Address) (bool, error) + type FluxAggregatorContractSubmitter struct + func NewFluxAggregatorContractSubmitter(contract flux_aggregator_wrapper.FluxAggregatorInterface, orm ORM, ...) *FluxAggregatorContractSubmitter + func (c *FluxAggregatorContractSubmitter) Submit(roundID *big.Int, submission *big.Int) error + type FluxMonitor struct + func NewFluxMonitor(pipelineRun PipelineRun, orm ORM, jobORM job.ORM, pipelineORM pipeline.ORM, ...) (*FluxMonitor, error) + func NewFromJobSpec(jobSpec job.Job, orm ORM, jobORM job.ORM, pipelineORM pipeline.ORM, ...) (*FluxMonitor, error) + func (fm *FluxMonitor) Close() error + func (fm *FluxMonitor) HandleLog(broadcast log.Broadcast) + func (fm *FluxMonitor) IsHibernating() bool + func (fm *FluxMonitor) IsV2Job() bool + func (fm *FluxMonitor) JobID() models.JobID + func (fm *FluxMonitor) JobIDV2() int32 + func (fm *FluxMonitor) SetOracleAddress() error + func (fm *FluxMonitor) Start() error + type FluxMonitorRoundStatsV2 struct + Aggregator common.Address + ID uint64 + NumNewRoundLogs uint64 + NumSubmissions uint64 + PipelineRunID null.Int64 + RoundID uint32 + type KeyStore struct + func NewKeyStore(store *corestore.Store) *KeyStore + func (ks *KeyStore) Accounts() []accounts.Account + func (ks *KeyStore) GetRoundRobinAddress() (common.Address, error) + type KeyStoreInterface interface + Accounts func() []accounts.Account + GetRoundRobinAddress func() (common.Address, error) + type ORM interface + CreateEthTransaction func(fromAddress, toAddress common.Address, payload []byte, gasLimit uint64, ...) error + DeleteFluxMonitorRoundsBackThrough func(aggregator common.Address, roundID uint32) error + FindOrCreateFluxMonitorRoundStats func(aggregator common.Address, roundID uint32) (FluxMonitorRoundStatsV2, error) + MostRecentFluxMonitorRoundID func(aggregator common.Address) (uint32, error) + UpdateFluxMonitorRoundStats func(aggregator common.Address, roundID uint32, runID int64) error + type PaymentChecker struct + MinContractPayment *assets.Adam + MinJobPayment *assets.Adam + func NewPaymentChecker(minContractPayment, minJobPayment *assets.Adam) *PaymentChecker + func (c *PaymentChecker) SufficientFunds(availableFunds *big.Int, paymentAmount *big.Int, oracleCount uint8) bool + func (c *PaymentChecker) SufficientPayment(payment *big.Int) bool + type PipelineRun struct + func NewPipelineRun(runner pipeline.Runner, spec pipeline.Spec, logger logger.Logger) PipelineRun + func (run *PipelineRun) Execute(meta map[string]interface{}) (int64, *decimal.Decimal, error) + type PollManager struct + func NewPollManager(cfg PollManagerConfig, logger *logger.Logger) *PollManager + func (pm *PollManager) Awaken(roundState flux_aggregator_wrapper.OracleRoundState) + func (pm *PollManager) Hibernate() + func (pm *PollManager) HibernationTimerTicks() <-chan time.Time + func (pm *PollManager) IdleTimerTicks() <-chan time.Time + func (pm *PollManager) Poll() <-chan PollRequest + func (pm *PollManager) PollTickerTicks() <-chan time.Time + func (pm *PollManager) Reset(roundState flux_aggregator_wrapper.OracleRoundState) + func (pm *PollManager) ResetIdleTimer(roundStartedAtUTC uint64) + func (pm *PollManager) RetryTickerTicks() <-chan time.Time + func (pm *PollManager) RoundTimerTicks() <-chan time.Time + func (pm *PollManager) ShouldPerformInitialPoll() bool + func (pm *PollManager) Start(hibernate bool, roundState flux_aggregator_wrapper.OracleRoundState) + func (pm *PollManager) StartRetryTicker() + func (pm *PollManager) Stop() + func (pm *PollManager) StopRetryTicker() + type PollManagerConfig struct + HibernationPollPeriod time.Duration + IdleTimerDisabled bool + IdleTimerPeriod time.Duration + IsHibernating bool + MaxRetryBackoffDuration time.Duration + MinRetryBackoffDuration time.Duration + PollTickerDisabled bool + PollTickerInterval time.Duration + type PollRequest struct + Timestamp time.Time + Type PollRequestType + type PollRequestType int + const PollRequestTypeAwaken + const PollRequestTypeHibernation + const PollRequestTypeIdle + const PollRequestTypeInitial + const PollRequestTypePoll + const PollRequestTypeRetry + const PollRequestTypeRound + const PollRequestTypeUnknown + type SubmissionChecker struct + Max decimal.Decimal + Min decimal.Decimal + func NewSubmissionChecker(min *big.Int, max *big.Int, precision int32) *SubmissionChecker + func (c *SubmissionChecker) IsValid(answer decimal.Decimal) bool