Versions in this module Expand all Collapse all v1 v1.0.1 Sep 18, 2024 v1.0.0 May 17, 2024 Changes in this version + var ErrConnectionTimeout = EndpointTimeoutError + var ErrDialRetryMax = errors.New("dialed maximum retries") + var ErrNoConnection = errors.New("endpoint is not connected") + var ErrReadTimeout = errors.New("endpoint read timed out") + var ErrSmallOrderRemotePubKey = errors.New("detected low order point from remote peer") + var ErrUnexpectedResponse = errors.New("empty response") + var ErrWriteTimeout = errors.New("endpoint write timed out") + func DefaultValidationRequestHandler(ctx context.Context, privVal types.PrivValidator, req privvalproto.Message, ...) (privvalproto.Message, error) + func IsConnTimeout(err error) bool + type EndpointTimeoutError struct + func (e EndpointTimeoutError) Error() string + func (e EndpointTimeoutError) Temporary() bool + func (e EndpointTimeoutError) Timeout() bool + type FilePV struct + Key FilePVKey + LastSignState FilePVLastSignState + func GenFilePV(keyFilePath, stateFilePath, keyType string) (*FilePV, error) + func LoadFilePV(keyFilePath, stateFilePath string) (*FilePV, error) + func LoadFilePVEmptyState(keyFilePath, stateFilePath string) (*FilePV, error) + func LoadOrGenFilePV(keyFilePath, stateFilePath string) (*FilePV, error) + func NewFilePV(privKey crypto.PrivKey, keyFilePath, stateFilePath string) *FilePV + func (pv *FilePV) GetAddress() types.Address + func (pv *FilePV) GetPubKey(ctx context.Context) (crypto.PubKey, error) + func (pv *FilePV) Reset() error + func (pv *FilePV) Save() error + func (pv *FilePV) SignProposal(ctx context.Context, chainID string, proposal *tmproto.Proposal) error + func (pv *FilePV) SignVote(ctx context.Context, chainID string, vote *tmproto.Vote) error + func (pv *FilePV) String() string + type FilePVKey struct + Address types.Address + PrivKey crypto.PrivKey + PubKey crypto.PubKey + func (pvKey *FilePVKey) UnmarshalJSON(data []byte) error + func (pvKey FilePVKey) MarshalJSON() ([]byte, error) + func (pvKey FilePVKey) Save() error + type FilePVLastSignState struct + Height int64 + Round int32 + SignBytes tmbytes.HexBytes + Signature []byte + Step int8 + func (lss *FilePVLastSignState) Save() error + type RemoteSignerError struct + Code int + Description string + func (e *RemoteSignerError) Error() string + type RetrySignerClient struct + func NewRetrySignerClient(sc *SignerClient, retries int, timeout time.Duration) *RetrySignerClient + func (sc *RetrySignerClient) Close() error + func (sc *RetrySignerClient) GetPubKey(ctx context.Context) (crypto.PubKey, error) + func (sc *RetrySignerClient) IsConnected() bool + func (sc *RetrySignerClient) Ping(ctx context.Context) error + func (sc *RetrySignerClient) SignProposal(ctx context.Context, chainID string, proposal *tmproto.Proposal) error + func (sc *RetrySignerClient) SignVote(ctx context.Context, chainID string, vote *tmproto.Vote) error + func (sc *RetrySignerClient) WaitForConnection(ctx context.Context, maxWait time.Duration) error + type SecretConnection struct + func MakeSecretConnection(conn io.ReadWriteCloser, locPrivKey crypto.PrivKey) (*SecretConnection, error) + func (sc *SecretConnection) Close() error + func (sc *SecretConnection) LocalAddr() net.Addr + func (sc *SecretConnection) Read(data []byte) (n int, err error) + func (sc *SecretConnection) RemoteAddr() net.Addr + func (sc *SecretConnection) RemotePubKey() crypto.PubKey + func (sc *SecretConnection) SetDeadline(t time.Time) error + func (sc *SecretConnection) SetReadDeadline(t time.Time) error + func (sc *SecretConnection) SetWriteDeadline(t time.Time) error + func (sc *SecretConnection) Write(data []byte) (n int, err error) + type SignerClient struct + func NewSignerClient(ctx context.Context, endpoint *SignerListenerEndpoint, chainID string) (*SignerClient, error) + func (sc *SignerClient) Close() error + func (sc *SignerClient) GetPubKey(ctx context.Context) (crypto.PubKey, error) + func (sc *SignerClient) IsConnected() bool + func (sc *SignerClient) Ping(ctx context.Context) error + func (sc *SignerClient) SignProposal(ctx context.Context, chainID string, proposal *tmproto.Proposal) error + func (sc *SignerClient) SignVote(ctx context.Context, chainID string, vote *tmproto.Vote) error + func (sc *SignerClient) WaitForConnection(ctx context.Context, maxWait time.Duration) error + type SignerDialerEndpoint struct + func NewSignerDialerEndpoint(logger log.Logger, dialer SocketDialer, options ...SignerServiceEndpointOption) *SignerDialerEndpoint + func (sd *SignerDialerEndpoint) OnStart(context.Context) error + func (sd *SignerDialerEndpoint) OnStop() + func (se *SignerDialerEndpoint) Close() error + func (se *SignerDialerEndpoint) DropConnection() + func (se *SignerDialerEndpoint) GetAvailableConnection(connectionAvailableCh chan net.Conn) bool + func (se *SignerDialerEndpoint) IsConnected() bool + func (se *SignerDialerEndpoint) ReadMessage() (msg privvalproto.Message, err error) + func (se *SignerDialerEndpoint) SetConnection(newConnection net.Conn) + func (se *SignerDialerEndpoint) WaitConnection(ctx context.Context, connectionAvailableCh chan net.Conn, ...) error + func (se *SignerDialerEndpoint) WriteMessage(msg privvalproto.Message) (err error) + type SignerListenerEndpoint struct + func NewSignerListener(listenAddr string, logger log.Logger) (*SignerListenerEndpoint, error) + func NewSignerListenerEndpoint(logger log.Logger, listener net.Listener, ...) *SignerListenerEndpoint + func (se *SignerListenerEndpoint) Close() error + func (se *SignerListenerEndpoint) DropConnection() + func (se *SignerListenerEndpoint) GetAvailableConnection(connectionAvailableCh chan net.Conn) bool + func (se *SignerListenerEndpoint) IsConnected() bool + func (se *SignerListenerEndpoint) ReadMessage() (msg privvalproto.Message, err error) + func (se *SignerListenerEndpoint) SetConnection(newConnection net.Conn) + func (se *SignerListenerEndpoint) WaitConnection(ctx context.Context, connectionAvailableCh chan net.Conn, ...) error + func (se *SignerListenerEndpoint) WriteMessage(msg privvalproto.Message) (err error) + func (sl *SignerListenerEndpoint) OnStart(ctx context.Context) error + func (sl *SignerListenerEndpoint) OnStop() + func (sl *SignerListenerEndpoint) SendRequest(ctx context.Context, request privvalproto.Message) (*privvalproto.Message, error) + func (sl *SignerListenerEndpoint) WaitForConnection(ctx context.Context, maxWait time.Duration) error + type SignerListenerEndpointOption func(*SignerListenerEndpoint) + func SignerListenerEndpointTimeoutReadWrite(timeout time.Duration) SignerListenerEndpointOption + type SignerServer struct + func NewSignerServer(endpoint *SignerDialerEndpoint, chainID string, privVal types.PrivValidator) *SignerServer + func (ss *SignerServer) OnStart(ctx context.Context) error + func (ss *SignerServer) OnStop() + func (ss *SignerServer) SetRequestHandler(validationRequestHandler ValidationRequestHandlerFunc) + type SignerServiceEndpointOption func(*SignerDialerEndpoint) + func SignerDialerEndpointConnRetries(retries int) SignerServiceEndpointOption + func SignerDialerEndpointRetryWaitInterval(interval time.Duration) SignerServiceEndpointOption + func SignerDialerEndpointTimeoutReadWrite(timeout time.Duration) SignerServiceEndpointOption + type SocketDialer func() (net.Conn, error) + func DialTCPFn(addr string, timeoutReadWrite time.Duration, privKey crypto.PrivKey) SocketDialer + func DialUnixFn(addr string) SocketDialer + type TCPListener struct + func NewTCPListener(ln net.Listener, secretConnKey ed25519.PrivKey) *TCPListener + func (ln *TCPListener) Accept() (net.Conn, error) + type TCPListenerOption func(*TCPListener) + func TCPListenerTimeoutAccept(timeout time.Duration) TCPListenerOption + func TCPListenerTimeoutReadWrite(timeout time.Duration) TCPListenerOption + type UnixListener struct + func NewUnixListener(ln net.Listener) *UnixListener + func (ln *UnixListener) Accept() (net.Conn, error) + type UnixListenerOption func(*UnixListener) + func UnixListenerTimeoutAccept(timeout time.Duration) UnixListenerOption + func UnixListenerTimeoutReadWrite(timeout time.Duration) UnixListenerOption + type ValidationRequestHandlerFunc func(ctx context.Context, privVal types.PrivValidator, ...) (privvalproto.Message, error)