voter

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpServiceName   = "op-subscriber"
	OpQueryTransfer = "tm.event='Tx' AND new_operation.operation_type='TRANSFER'"
	OpPoolSize      = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Catchupper

type Catchupper struct {
	// contains filtered or unexported fields
}

Catchupper catches up old unsigned operations from core.

func NewCatchupper

func NewCatchupper(rarimo *grpc.ClientConn, voter *Voter, log *logan.Entry) *Catchupper

NewCatchupper creates the catchup instance for adding all unsigned operations to the pool

func (*Catchupper) Run

func (c *Catchupper) Run(ctx context.Context)

type Subscriber

type Subscriber struct {
	// contains filtered or unexported fields
}

Subscriber subscribes to the NewOperation events on the tendermint core.

func NewSubscriber

func NewSubscriber(voter *Voter, client *http.HTTP, rarimo *grpc.ClientConn, query string, log *logan.Entry, cfg SubscriberConfig) *Subscriber

NewSubscriber creates the subscriber instance for listening to new operations

func NewTransferSubscriber

func NewTransferSubscriber(voter *Voter, client *http.HTTP, rarimo *grpc.ClientConn, log *logan.Entry, cfg SubscriberConfig) *Subscriber

func (*Subscriber) Run

func (s *Subscriber) Run(ctx context.Context)

type SubscriberConfig

type SubscriberConfig struct {
	MinRetryPeriod time.Duration `fig:"min_retry_period"`
	MaxRetryPeriod time.Duration `fig:"max_retry_period"`
}

type Subscriberer

type Subscriberer interface {
	Subscriber() SubscriberConfig
}

func NewSubscriberer

func NewSubscriberer(getter kv.Getter) Subscriberer

type Verifier

type Verifier interface {
	Verify(ctx context.Context, operation rarimotypes.Operation) (rarimotypes.VoteType, error)
}

type Voter

type Voter struct {
	// contains filtered or unexported fields
}

func NewVoter

func NewVoter(chain string, log *logan.Entry, broadcaster broadcaster.Broadcaster, verifiers map[rarimotypes.OpType]Verifier) *Voter

func (*Voter) Process

func (v *Voter) Process(ctx context.Context, operation rarimotypes.Operation) error

func (*Voter) Sender

func (v *Voter) Sender() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL