remote

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UDSProtocol = "unix"
	TCPProtocol = "tcp"
)

Constants for the connection protocols.

View Source
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

View Source
var (
	ErrUnauthorizedPubKey = errors.New("unauthorized remote public key")
	ErrSecretConnFailed   = errors.New("secret connection handshake failed")
	ErrNilConn            = errors.New("nil connection")
)

Errors returned by the TCP connection configuration.

View Source
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

type PubKeyResponse struct {
	PubKey crypto.PubKey
}

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.

type TCPConnConfig

type TCPConnConfig struct {
	KeepAlivePeriod  time.Duration
	HandshakeTimeout time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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