node

package
v0.54.1-nocontractcheck Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoNodeConfigured       = errors.New("no node configured on round-robin selector")
	ErrNoHealthyNodeAvailable = errors.New("no healthy node available")
)

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode codes.Code

type InsecureGRPCClient

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

func NewInsecureGRPCClient

func NewInsecureGRPCClient(host string) (*InsecureGRPCClient, error)

func (*InsecureGRPCClient) CheckTransaction

func (*InsecureGRPCClient) GetVegaTime

func (*InsecureGRPCClient) Host

func (c *InsecureGRPCClient) Host() string

func (*InsecureGRPCClient) LastBlockHeight

func (*InsecureGRPCClient) Stop

func (c *InsecureGRPCClient) Stop() error

func (*InsecureGRPCClient) SubmitTransaction

type RetryingGRPCNode

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

func BuildGRPCNode

func BuildGRPCNode(log *zap.Logger, client CoreClient, retries uint64) *RetryingGRPCNode

func NewGRPCNode

func NewGRPCNode(log *zap.Logger, host string, retries uint64) (*RetryingGRPCNode, error)

func (*RetryingGRPCNode) CheckTransaction

func (*RetryingGRPCNode) HealthCheck

func (n *RetryingGRPCNode) HealthCheck(ctx context.Context) error

func (*RetryingGRPCNode) Host

func (n *RetryingGRPCNode) Host() string

func (*RetryingGRPCNode) LastBlock

LastBlock returns information about the last block acknowledged by the node.

func (*RetryingGRPCNode) SendTransaction

func (*RetryingGRPCNode) Stop

func (n *RetryingGRPCNode) Stop() error

type RoundRobinSelector

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

RoundRobinSelector uses a classic round-robin algorithm to select a node. When requesting the next node, this is the node right behind the current one that is selected. When the last node is reached, it starts over the first one.

func NewRoundRobinSelector

func NewRoundRobinSelector(log *zap.Logger, nodes ...walletapi.Node) (*RoundRobinSelector, error)

func (*RoundRobinSelector) Node

func (*RoundRobinSelector) Stop

func (ns *RoundRobinSelector) Stop()

Stop stops all the registered nodes. If a node raises an error during closing, the selector ignores it and carry on a best-effort.

type StatusError

type StatusError struct {
	Code    codes.Code
	Details []string
}

func (*StatusError) Error

func (e *StatusError) Error() string

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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