Documentation
¶
Index ¶
- Constants
- Variables
- func ExtractFeedURLs(feeds models.Feeds, orm *orm.ORM) ([]*url.URL, error)
- func GetBridgeURLFromName(name string, orm *orm.ORM) (*url.URL, error)
- func MakeIdleTimer(log contracts.LogNewRound, idleThreshold models.Duration, ...) <-chan time.Time
- func OutsideDeviation(curAnswer, nextAnswer decimal.Decimal, threshold float64) bool
- type DeviationChecker
- type DeviationCheckerFactory
- type Fetcher
- type PollingDeviationChecker
- func (p *PollingDeviationChecker) HandleLog(lb eth.LogBroadcast, err error)
- func (p *PollingDeviationChecker) JobID() *models.ID
- func (p *PollingDeviationChecker) OnConnect()
- func (p *PollingDeviationChecker) OnDisconnect()
- func (p *PollingDeviationChecker) Start()
- func (p *PollingDeviationChecker) Stop()
- func (p *PollingDeviationChecker) SufficientFunds(state contracts.FluxAggregatorRoundState) bool
- func (p *PollingDeviationChecker) SufficientPayment(payment *big.Int) bool
- type ResettableTicker
- type RunManager
- type Service
Constants ¶
const MinFundedRounds int64 = 3
Variables ¶
Functions ¶
func ExtractFeedURLs ¶
ExtractFeedURLs extracts a list of url.URLs from the feeds parameter of the initiator params
func GetBridgeURLFromName ¶
GetBridgeURLFromName looks up a bridge in the DB by name, then extracts the url
func MakeIdleTimer ¶ added in v0.8.3
func MakeIdleTimer(log contracts.LogNewRound, idleThreshold models.Duration, clock utils.AfterNower) <-chan time.Time
MakeIdleTimer checks the log timestamp and calculates the idle time from that.
This function makes the assumption that the local system time is relatively accurate (to within a second or so) and all participating nodes agree on that.
If system time is not accurate (compared to the cluster) then you should expect poor behaviour here.
Types ¶
type DeviationChecker ¶
type DeviationChecker interface { Start() Stop() }
DeviationChecker encapsulate methods needed to initialize and check prices for price deviations.
type DeviationCheckerFactory ¶
type DeviationCheckerFactory interface {
New(models.Initiator, RunManager, *orm.ORM, models.Duration) (DeviationChecker, error)
}
DeviationCheckerFactory holds the New method needed to create a new instance of a DeviationChecker.
type PollingDeviationChecker ¶
type PollingDeviationChecker struct {
// contains filtered or unexported fields
}
PollingDeviationChecker polls external price adapters via HTTP to check for price swings.
func NewPollingDeviationChecker ¶
func NewPollingDeviationChecker( store *store.Store, fluxAggregator contracts.FluxAggregator, initr models.Initiator, runManager RunManager, fetcher Fetcher, pollDelay models.Duration, readyForLogs func(), ) (*PollingDeviationChecker, error)
NewPollingDeviationChecker returns a new instance of PollingDeviationChecker.
func (*PollingDeviationChecker) HandleLog ¶
func (p *PollingDeviationChecker) HandleLog(lb eth.LogBroadcast, err error)
func (*PollingDeviationChecker) JobID ¶ added in v0.8.3
func (p *PollingDeviationChecker) JobID() *models.ID
func (*PollingDeviationChecker) OnConnect ¶
func (p *PollingDeviationChecker) OnConnect()
func (*PollingDeviationChecker) OnDisconnect ¶
func (p *PollingDeviationChecker) OnDisconnect()
func (*PollingDeviationChecker) Start ¶
func (p *PollingDeviationChecker) Start()
Start begins the CSP consumer in a single goroutine to poll the price adapters and listen to NewRound events.
func (*PollingDeviationChecker) Stop ¶
func (p *PollingDeviationChecker) Stop()
Stop stops this instance from polling, cleaning up resources.
func (*PollingDeviationChecker) SufficientFunds ¶ added in v0.8.3
func (p *PollingDeviationChecker) SufficientFunds(state contracts.FluxAggregatorRoundState) bool
Checks if the available payment is enough to submit an answer.
func (*PollingDeviationChecker) SufficientPayment ¶ added in v0.8.3
func (p *PollingDeviationChecker) SufficientPayment(payment *big.Int) bool
Checks if the available payment is enough to submit an answer.
type ResettableTicker ¶
func NewResettableTicker ¶
func NewResettableTicker(d models.Duration) *ResettableTicker
NewResettableTicker creates a new ResettableTicker. If d is zero, the ticker never ticks.
func (*ResettableTicker) Reset ¶
func (t *ResettableTicker) Reset()
func (*ResettableTicker) Stop ¶
func (t *ResettableTicker) Stop()
func (*ResettableTicker) Tick ¶
func (t *ResettableTicker) Tick() <-chan time.Time