grpc

package
v0.35.9 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 22 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDialOptions

func DefaultDialOptions(
	extraOpts ...grpc.DialOption,
) []grpc.DialOption

DefaultDialOptions constructs a list of grpc dial options

func GenerateTLS

func GenerateTLS(certPath, keyPath, ca string, log log.Logger) grpc.DialOption

Types

type SignerClient

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

SignerClient implements PrivValidator. Handles remote validator connections that provide signing services

func DialRemoteSigner

func DialRemoteSigner(
	cfg *config.PrivValidatorConfig,
	chainID string,
	logger log.Logger,
	usePrometheus bool,
) (*SignerClient, error)

DialRemoteSigner is a generalized function to dial the gRPC server.

func NewSignerClient

func NewSignerClient(conn *grpc.ClientConn,
	chainID string, log log.Logger) (*SignerClient, error)

NewSignerClient returns an instance of SignerClient. it will start the endpoint (if not already started)

func (*SignerClient) Close

func (sc *SignerClient) Close() error

Close closes the underlying connection

func (*SignerClient) GetPubKey

func (sc *SignerClient) GetPubKey(ctx context.Context) (crypto.PubKey, error)

GetPubKey retrieves a public key from a remote signer returns an error if client is not able to provide the key

func (*SignerClient) SignProposal

func (sc *SignerClient) SignProposal(ctx context.Context, chainID string, proposal *tmproto.Proposal) error

SignProposal requests a remote signer to sign a proposal

func (*SignerClient) SignVote

func (sc *SignerClient) SignVote(ctx context.Context, chainID string, vote *tmproto.Vote) error

SignVote requests a remote signer to sign a vote

type SignerServer

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

SignerServer implements PrivValidatorAPIServer 9generated via protobuf services) Handles remote validator connections that provide signing services

func NewSignerServer

func NewSignerServer(chainID string,
	privVal types.PrivValidator, log log.Logger) *SignerServer

func (*SignerServer) GetPubKey

PubKey receives a request for the pubkey returns the pubkey on success and error on failure

func (*SignerServer) SignProposal

SignProposal receives a proposal sign requests, attempts to sign it returns SignedProposalResponse on success and error on failure

func (*SignerServer) SignVote

SignVote receives a vote sign requests, attempts to sign it returns SignedVoteResponse on success and error on failure

Jump to

Keyboard shortcuts

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