Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReqContext ¶
Types ¶
type BchdWatcher ¶
type BchdWatcher struct { Nodes *Nodes BlocksBehindWarning uint32 LatestBlockWithin time.Duration MaxDroppedConnectionsPerHour uint32 // contains filtered or unexported fields }
func NewBchdWatcher ¶
func NewBchdWatcher(logger log.Logger, monitor *monitoring.HttpMonitoring) (*BchdWatcher, error)
func (*BchdWatcher) ReadGrpcStreams ¶
func (w *BchdWatcher) ReadGrpcStreams(ctx context.Context)
type BestBlockHeight ¶
type GRPCClient ¶
type GRPCClient struct { Node *Node Client pb.BchrpcClient // contains filtered or unexported fields }
func NewGrpcClient ¶
func NewGrpcClient(node Node, logger log.Logger, monitor *monitoring.HttpMonitoring) (grpcClient *GRPCClient, err error)
func (*GRPCClient) Close ¶
func (gc *GRPCClient) Close() error
func (*GRPCClient) ReadTransactionStream ¶
func (gc *GRPCClient) ReadTransactionStream(reqCtx context.Context, cancel context.CancelFunc) error
type Node ¶
type Node struct { // config Address string `mapstructure:"Address"` AuthenticationToken string `mapstructure:"AuthenticationToken"` // gRPC metadata with auth token RootCertFile string `mapstructure:"RootCertFile"` // path to self-signed cert CaDomain string `mapstructure:"CaDomain"` // domain to validate certificate against (to override the domain in Address) AllowSelfSigned bool `mapstructure:"AllowSelfSigned"` Notify []notification.NotificationReceiver `mapstructure:"Notify"` // contains filtered or unexported fields }
func (*Node) AddConnectError ¶
Adds a connection error such as dropped gRPC stream. We use this to monitor reliability of nodes.
func (*Node) NotifyError ¶
Sends the error message to the operator(s) of this node.
func (*Node) SetBlockHeight ¶
func (*Node) SetConnected ¶
func (n *Node) SetConnected()
func (*Node) SetLastReceive ¶
func (n *Node) SetLastReceive()
type NodeConnectError ¶
type NodeStats ¶
type NodeStats struct { Connected time.Time `json:"connected"` LastReceive time.Time `json:"last_receive"` BlockHeight BestBlockHeight `json:"block_height"` LostConnections []*NodeConnectError `json:"lost_connections"` LastNotified time.Time `json:"last_notified"` }
Node stats available via HTTP API as JSON
type Nodes ¶
type Nodes struct {
Nodes []*Node
}
func (*Nodes) GetBestBlockHeight ¶
func (nodes *Nodes) GetBestBlockHeight() BestBlockHeight
Click to show internal directories.
Click to hide internal directories.