Versions in this module Expand all Collapse all v1 v1.0.1 May 26, 2025 v1.0.0 May 8, 2025 Changes in this version + const ActTwoPayloadSize + const HandshakeVersion0 + const HandshakeVersion1 + const HandshakeVersion2 + const KK + const MaxHandshakeVersion + const MinHandshakeVersion + const NumPassphraseEntropyBytes + const NumPassphraseWords + const ProtocolName + const ProtocolVersion + const Subsystem + const XX + var ErrMaxMessageLengthExceeded = errors.New(...) + var ErrMessageNotFlushed = errors.New("prior message not flushed") + var KKPattern = HandshakePattern + var N = btcec.ParsePubKey(nBytes) + var XXPattern = HandshakePattern + func GetSID(sid [64]byte, serverToClient bool) [64]byte + func NewClientWebsocketConn(mailboxServer, pairingPhrase string, localStatic keychain.SingleKeyECDH, ...) (func() ClientStatus, func() (*grpc.ClientConn, error), error) + func NewPassphraseEntropy() ([NumPassphraseWords]string, [NumPassphraseEntropyBytes]byte, error) + func PassphraseEntropyToMnemonic(entropy [NumPassphraseEntropyBytes]byte) ([NumPassphraseWords]string, error) + func PassphraseMnemonicToEntropy(passphrase [NumPassphraseWords]string) [NumPassphraseEntropyBytes]byte + func UseLogger(logger btclog.Logger) + func WithMaxHandshakeVersion(version byte) func(*NoiseGrpcConn) + func WithMinHandshakeVersion(version byte) func(*NoiseGrpcConn) + type ActNum uint8 + type Addr struct + SID [64]byte + Server string + func (b *Addr) Network() string + func (b *Addr) String() string + type AuthInfo struct + func NewAuthInfo() *AuthInfo + func (a *AuthInfo) AuthType() string + type BrontideMachineConfig struct + ConnData ConnectionData + EphemeralGen func() (*btcec.PrivateKey, error) + HandshakePattern HandshakePattern + Initiator bool + MaxHandshakeVersion byte + MinHandshakeVersion byte + type Client struct + func NewClient(ctx context.Context, serverHost string, connData *ConnData, ...) (*Client, error) + func NewGrpcClient(ctx context.Context, serverHost string, connData *ConnData, ...) (*Client, error) + func NewWebsocketsClient(ctx context.Context, serverHost string, connData *ConnData) (*Client, error) + func (c *Client) ConnStatus() ClientStatus + func (c *Client) Dial(_ context.Context, _ string) (net.Conn, error) + type ClientConn struct + func NewClientConn(ctx context.Context, sid [64]byte, serverHost string, ...) (*ClientConn, error) + func RefreshClientConn(ctx context.Context, c *ClientConn) (*ClientConn, error) + func (c *ClientConn) Close() error + func (c *ClientConn) Done() <-chan struct{} + func (c *ClientConn) ReceiveControlMsg(receive ControlMsg) error + func (c *ClientConn) SendControlMsg(controlMsg ControlMsg) error + func (c *ClientConn) SetRecvTimeout(timeout time.Duration) + func (c *ClientConn) SetSendTimeout(timeout time.Duration) + func (k ClientConn) LocalAddr() net.Addr + func (k ClientConn) Read(b []byte) (int, error) + func (k ClientConn) RemoteAddr() net.Addr + func (k ClientConn) SetDeadline(t time.Time) error + func (k ClientConn) SetReadDeadline(t time.Time) error + func (k ClientConn) SetWriteDeadline(t time.Time) error + func (k ClientConn) Write(b []byte) (n int, err error) + type ClientConnTransport interface + CloseReceive func() error + CloseSend func() error + ConnectReceive func(ctx context.Context) error + ConnectSend func(ctx context.Context) error + ReceiveConnected func() bool + Recv func(ctx context.Context) ([]byte, bool, ClientStatus, error) + Refresh func() ClientConnTransport + Send func(ctx context.Context, streamID, payload []byte) (bool, ClientStatus, error) + SendConnected func() bool + type ClientOption func(*Client) + func WithGrpcConn(conn *grpc.ClientConn) ClientOption + type ClientStatus string + const ClientStatusConnected + const ClientStatusNotConnected + const ClientStatusSessionInUse + const ClientStatusSessionNotFound + func (c ClientStatus) String() string + type ConnData struct + func NewConnData(localKey keychain.SingleKeyECDH, remoteKey *btcec.PublicKey, ...) *ConnData + func (s *ConnData) AuthData() []byte + func (s *ConnData) HandshakePattern() HandshakePattern + func (s *ConnData) LocalKey() keychain.SingleKeyECDH + func (s *ConnData) PassphraseEntropy() []byte + func (s *ConnData) RemoteKey() *btcec.PublicKey + func (s *ConnData) SID() ([64]byte, error) + func (s *ConnData) SetAuthData(data []byte) error + func (s *ConnData) SetRemote(key *btcec.PublicKey) error + type ConnectionData interface + AuthData func() []byte + LocalKey func() keychain.SingleKeyECDH + PassphraseEntropy func() []byte + RemoteKey func() *btcec.PublicKey + SetAuthData func(data []byte) error + SetRemote func(key *btcec.PublicKey) error + type ControlMsg interface + Deserialize func([]byte) error + ProtocolVersion func() uint8 + Serialize func() ([]byte, error) + type GrpcLogLogger struct + func (l GrpcLogLogger) Errorln(args ...interface{}) + func (l GrpcLogLogger) Fatal(args ...interface{}) + func (l GrpcLogLogger) Fatalf(format string, args ...interface{}) + func (l GrpcLogLogger) Fatalln(args ...interface{}) + func (l GrpcLogLogger) Info(args ...interface{}) + func (l GrpcLogLogger) Infof(format string, args ...interface{}) + func (l GrpcLogLogger) Infoln(args ...interface{}) + func (l GrpcLogLogger) V(level int) bool + func (l GrpcLogLogger) Warning(args ...interface{}) + func (l GrpcLogLogger) Warningf(format string, args ...interface{}) + func (l GrpcLogLogger) Warningln(args ...interface{}) + type HandshakePattern struct + Name string + Pattern []MessagePattern + PreMessages []MessagePattern + type Listener struct + func NewListener(passphrase []byte, localStatic keychain.SingleKeyECDH, listenAddr string, ...) (*Listener, error) + func (l *Listener) Accept() (net.Conn, error) + func (l *Listener) Addr() net.Addr + func (l *Listener) Close() error + type Machine struct + func NewBrontideMachine(cfg *BrontideMachineConfig) (*Machine, error) + func (b *Machine) DoHandshake(rw io.ReadWriter) error + func (b *Machine) Flush(w io.Writer) (int, error) + func (b *Machine) ReadBody(r io.Reader, buf []byte) ([]byte, error) + func (b *Machine) ReadHeader(r io.Reader) (uint32, error) + func (b *Machine) ReadMessage(r io.Reader) ([]byte, error) + func (b *Machine) WriteMessage(p []byte) error + type MessagePattern struct + ActNum ActNum + Initiator bool + Tokens []Token + type MsgData struct + Payload []byte + func NewMsgData(version uint8, payload []byte) *MsgData + func (m *MsgData) Deserialize(b []byte) error + func (m *MsgData) ProtocolVersion() uint8 + func (m *MsgData) Serialize() ([]byte, error) + type NoiseAddr struct + PubKey *btcec.PublicKey + Server string + func (b *NoiseAddr) Network() string + func (b *NoiseAddr) String() string + type NoiseConn struct + func Dial(localPriv keychain.SingleKeyECDH, netAddr net.Addr, passphrase []byte, ...) (*NoiseConn, error) + func (c *NoiseConn) Close() error + func (c *NoiseConn) Flush() (int, error) + func (c *NoiseConn) LocalAddr() net.Addr + func (c *NoiseConn) LocalPub() *btcec.PublicKey + func (c *NoiseConn) Read(b []byte) (n int, err error) + func (c *NoiseConn) ReadNextBody(buf []byte) ([]byte, error) + func (c *NoiseConn) ReadNextHeader() (uint32, error) + func (c *NoiseConn) ReadNextMessage() ([]byte, error) + func (c *NoiseConn) RemoteAddr() net.Addr + func (c *NoiseConn) RemotePub() *btcec.PublicKey + func (c *NoiseConn) SetDeadline(t time.Time) error + func (c *NoiseConn) SetReadDeadline(t time.Time) error + func (c *NoiseConn) SetWriteDeadline(t time.Time) error + func (c *NoiseConn) Write(b []byte) (n int, err error) + func (c *NoiseConn) WriteMessage(b []byte) error + type NoiseGrpcConn struct + func NewNoiseGrpcConn(connData *ConnData, options ...func(conn *NoiseGrpcConn)) *NoiseGrpcConn + func (c *NoiseGrpcConn) ClientHandshake(_ context.Context, _ string, conn net.Conn) (net.Conn, credentials.AuthInfo, error) + func (c *NoiseGrpcConn) Clone() credentials.TransportCredentials + func (c *NoiseGrpcConn) Close() error + func (c *NoiseGrpcConn) GetRequestMetadata(_ context.Context, _ ...string) (map[string]string, error) + func (c *NoiseGrpcConn) Info() credentials.ProtocolInfo + func (c *NoiseGrpcConn) LocalAddr() net.Addr + func (c *NoiseGrpcConn) OverrideServerName(_ string) error + func (c *NoiseGrpcConn) Read(b []byte) (n int, err error) + func (c *NoiseGrpcConn) RemoteAddr() net.Addr + func (c *NoiseGrpcConn) RequireTransportSecurity() bool + func (c *NoiseGrpcConn) ServerHandshake(conn net.Conn) (net.Conn, credentials.AuthInfo, error) + func (c *NoiseGrpcConn) Write(b []byte) (int, error) + type ProxyConn interface + type Server struct + func NewServer(serverHost string, connData *ConnData, onNewStatus func(status ServerStatus), ...) (*Server, error) + func (s *Server) Accept() (net.Conn, error) + func (s *Server) Addr() net.Addr + func (s *Server) Close() error + type ServerConn struct + func NewServerConn(ctx context.Context, serverHost string, client hashmailrpc.HashMailClient, ...) (*ServerConn, error) + func RefreshServerConn(s *ServerConn) (*ServerConn, error) + func (c *ServerConn) Close() error + func (c *ServerConn) Done() <-chan struct{} + func (c *ServerConn) ReceiveControlMsg(receive ControlMsg) error + func (c *ServerConn) SendControlMsg(controlMsg ControlMsg) error + func (c *ServerConn) SetRecvTimeout(timeout time.Duration) + func (c *ServerConn) SetSendTimeout(timeout time.Duration) + func (c *ServerConn) Stop() error + func (k ServerConn) LocalAddr() net.Addr + func (k ServerConn) Read(b []byte) (int, error) + func (k ServerConn) RemoteAddr() net.Addr + func (k ServerConn) SetDeadline(t time.Time) error + func (k ServerConn) SetReadDeadline(t time.Time) error + func (k ServerConn) SetWriteDeadline(t time.Time) error + func (k ServerConn) Write(b []byte) (n int, err error) + type ServerStatus uint8 + const ServerStatusIdle + const ServerStatusInUse + const ServerStatusNotConnected + type Token string Other modules containing this package github.com/lightninglabs/lightning-node-connect