rpcserver

package
v0.0.0-...-cc54612 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: ISC, MIT Imports: 7 Imported by: 1

Documentation

Overview

Package rpcserver implements the RPC API and is used by the main package to start gRPC services.

Full documentation of the API implemented by this package is maintained in a language-agnostic document:

TODO Document gRPC API like hcwallet once the API is stable

Index

Constants

View Source
const (
	// The most probable reason for a command timing out would be because a
	// deadlock has occurred in the main process.  We want to reply with an
	// error message in this case before hcstakepool applies a client timeout.
	// The commands are basic map operations and copies and typically complete
	// within one millisecond.  It is possible for an abnormally long garbage
	// collection cycle to also trigger a timeout but the current allocation
	// pattern of stakepoold is not known to cause such conditions at this time.
	GRPCCommandTimeout = time.Millisecond * 100
)

Public API version constants

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func StartStakepooldService

func StartStakepooldService(grpcCommandQueueChan chan *GRPCCommandQueue, server *grpc.Server)

StartStakepooldService creates an implementation of the StakepooldService and registers it.

func StartVersionService

func StartVersionService(server *grpc.Server)

StartVersionService creates an implementation of the VersionService and registers it with the gRPC server.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type CommandName

type CommandName int

CommandName maps function names to an integer.

const (
	GetAddedLowFeeTickets CommandName = iota
	GetIgnoredLowFeeTickets
	GetLiveTickets
	SetAddedLowFeeTickets
	SetUserVotingPrefs
)

func (CommandName) String

func (s CommandName) String() string

type GRPCCommandQueue

type GRPCCommandQueue struct {
	Command                CommandName
	RequestTicketData      map[chainhash.Hash]string
	RequestUserData        map[string]userdata.UserVotingConfig
	ResponseEmptyChan      chan struct{}
	ResponseTicketsMSAChan chan map[chainhash.Hash]string
}

Jump to

Keyboard shortcuts

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