Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PollResult ¶
type PollStatus ¶
type PollStatus int
const ( PollMiss PollStatus = iota PollHit PollFailed PollIllegal )
func (PollStatus) GoString ¶
func (p PollStatus) GoString() string
func (PollStatus) String ¶
func (i PollStatus) String() string
type Poller ¶
type Poller struct { *certexchange.Client Store *certstore.Store SignatureVerifier gpbft.Verifier PowerTable gpbft.PowerEntries NextInstance uint64 // contains filtered or unexported fields }
A Poller will poll specific peers on-demand to try to advance the current GPBFT instance.
func NewPoller ¶
func NewPoller(ctx context.Context, client *certexchange.Client, store *certstore.Store, verifier gpbft.Verifier) (*Poller, error)
NewPoller constructs a new certificate poller and initializes it from the passed certificate store.
func (*Poller) CatchUp ¶
CatchUp attempts to advance to the latest instance from the certificate store without making any network requests. It returns the number of instances we advanced.
func (*Poller) Poll ¶
Poll polls a specific peer, possibly multiple times, in order to advance the instance as much as possible. It returns:
1. A PollResult indicating the outcome: miss, hit, failed, illegal. 2. An error if something went wrong internally (e.g., the certificate store returned an error).
type Subscriber ¶
type Subscriber struct { certexchange.Client Store *certstore.Store SignatureVerifier gpbft.Verifier InitialPollInterval time.Duration MaximumPollInterval time.Duration MinimumPollInterval time.Duration // contains filtered or unexported fields }
A polling Subscriber will continuously poll the network for new finality certificates.