subscriber

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscriber

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

Subscriber is responsible for subscribing on chain's ICQ events. It parses incoming events, filters them in accordance with the Registry configuration and watchedTypes, and provides a stream of split to KV and TX messages.

func NewSubscriber

func NewSubscriber(
	cfg *SubscriberConfig,
	logger *zap.Logger,
) (*Subscriber, error)

NewSubscriber creates a new Subscriber instance ready to subscribe to Neutron events.

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, tasks chan neutrontypes.RegisteredQuery) error

Subscribe subscribes to 3 types of events: 1. a new block was created, 2. a query was updated (created / updated), 3. a query was removed.

type SubscriberConfig added in v0.2.0

type SubscriberConfig struct {
	// RPCAddress represents the address for RPC calls to the chain.
	RPCAddress string
	// RESTAddress represents the address for REST calls to the chain.
	RESTAddress string
	// Timeout defines time limit for requests executed by the Subscriber.
	Timeout time.Duration
	// ConnectionID is the Neutron's side connection ID used to filter out queries.
	ConnectionID string
	// WatchedTypes is the list of query types to be observed and handled.
	WatchedTypes []neutrontypes.InterchainQueryType
	// Registry is a watch list registry. It contains a list of addresses, and the Subscriber only
	// works with interchain queries and events that are under these addresses' ownership.
	Registry *rg.Registry
}

SubscriberConfig contains configurable fields for the Subscriber.

Directories

Path Synopsis
querier

Jump to

Keyboard shortcuts

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