Documentation
¶
Index ¶
Constants ¶
const ( UDSProtocol = "unix" TCPProtocol = "tcp" )
Constants for the connection protocols.
const MaxMessageSize = 1024 * 1024 // 1MB
MaxMessageSize is the maximum size in bytes of a message that can be sent or received. This needs to be large enough to accommodate genesis transactions, which can contain entire packages of Gno code and exceed 30KB in size.
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{}, ))
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 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.