grpc

package
v1.2.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

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(
	_ctx context.Context,
	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) ExtractIntoValidator

func (sc *SignerClient) ExtractIntoValidator(ctx context.Context, quorumHash crypto.QuorumHash) *types.Validator

func (*SignerClient) GetFirstQuorumHash

func (sc *SignerClient) GetFirstQuorumHash(_ctx context.Context) (crypto.QuorumHash, error)

func (*SignerClient) GetHeight

func (sc *SignerClient) GetHeight(_ctx context.Context, quorumHash crypto.QuorumHash) (int64, error)

func (*SignerClient) GetPrivateKey

func (sc *SignerClient) GetPrivateKey(_ctx context.Context, _quorumHash crypto.QuorumHash) (crypto.PrivKey, error)

func (*SignerClient) GetProTxHash

func (sc *SignerClient) GetProTxHash(ctx context.Context) (crypto.ProTxHash, error)

func (*SignerClient) GetPubKey

func (sc *SignerClient) GetPubKey(ctx context.Context, quorumHash crypto.QuorumHash) (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) GetThresholdPublicKey

func (sc *SignerClient) GetThresholdPublicKey(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PubKey, error)

func (*SignerClient) SignProposal

func (sc *SignerClient) SignProposal(
	ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, proposal *tmproto.Proposal,
) (tmbytes.HexBytes, error)

SignProposal requests a remote signer to sign a proposal

func (*SignerClient) SignVote

func (sc *SignerClient) SignVote(
	ctx context.Context, _chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash,
	vote *tmproto.Vote, _logger log.Logger) error

SignVote requests a remote signer to sign a vote

func (*SignerClient) UpdatePrivateKey

func (sc *SignerClient) UpdatePrivateKey(
	_ctx context.Context, _privateKey crypto.PrivKey, _quorumHash crypto.QuorumHash, _thresholdPublicKey crypto.PubKey, _height int64,
)

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(logger log.Logger, chainID string, privVal types.PrivValidator) *SignerServer

func (*SignerServer) GetProTxHash

GetProTxHash receives a request for the proTxHash returns the proTxHash on success and error on failure

func (*SignerServer) GetPubKey

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

func (*SignerServer) GetThresholdPubKey

GetThresholdPubKey receives a request for the threshold 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