Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigureTCPConnection(conn *net.TCPConn, localPrivKey ed25519.PrivKeyEd25519, ...) (net.Conn, error)
- type PingRequest
- type PingResponse
- type PubKeyRequest
- type PubKeyResponse
- type RemoteSignerError
- type RemoteSignerMessage
- type SignRequest
- type SignResponse
- type TCPConnConfig
Constants ¶
const ( UDSProtocol = "unix" TCPProtocol = "tcp" )
Constants for the connection protocols.
const MaxMessageSize = 10 * 1024
MaxMessageSize is the maximum size in bytes of a message that can be sent or received.
Variables ¶
var ( ErrSecretConnFailed = errors.New("secret connection handshake failed") ErrNilConn = errors.New("nil connection") )
Errors returned by the TCP connection configuration.
var Package = amino.RegisterPackage( amino.NewPackage( "github.com/gnolang/gno/tm2/pkg/bft/privval/signer/remote", "tm.remotesigner", amino.GetCallersDirname(), ). WithDependencies(). WithTypes( &PubKeyRequest{}, &PubKeyResponse{}, &SignRequest{}, &SignResponse{}, &PingRequest{}, &PingResponse{}, ))
Register Amino package with remote signer message types.
Functions ¶
func ConfigureTCPConnection ¶
func ConfigureTCPConnection( conn *net.TCPConn, localPrivKey ed25519.PrivKeyEd25519, authorizedKeys []ed25519.PubKeyEd25519, cfg TCPConnConfig, ) (net.Conn, error)
configureTCPConnection configures the linger and keep alive options for a TCP connection. It also secures the connection and mutually authenticates with the remote peer using the provided localPrivKey and a list of authorizedKeys.
Types ¶
type PingRequest ¶
type PingRequest struct{}
PingRequest is a request to confirm that the connection is alive.
type PingResponse ¶
type PingResponse struct{}
PingResponse is a response to confirm that the connection is alive.
type PubKeyRequest ¶
type PubKeyRequest struct{}
PubKeyRequest requests the signing public key from the remote signer.
type PubKeyResponse ¶
PubKeyResponse is a response containing the public key.
type RemoteSignerError ¶
type RemoteSignerError struct {
Err string
}
RemoteSignerError is an error returned by the remote signer. Necessary because golang errors are not serializable (private fields).
func (*RemoteSignerError) Error ¶
func (rse *RemoteSignerError) Error() string
Error implements error.
type RemoteSignerMessage ¶
type RemoteSignerMessage interface{}
RemoteSignerMessage is sent between Remote Signer clients and servers.
type SignRequest ¶
type SignRequest struct {
SignBytes []byte
}
SignRequest is a request to sign arbitrary bytes.
type SignResponse ¶
type SignResponse struct { Signature []byte Error *RemoteSignerError }
SignResponse is a response containing the signature or an error.