Documentation ¶
Index ¶
Constants ¶
View Source
const HeaderMacaroon = "Macaroon"
HeaderMacaroon is the HTTP header field name that is used to send the macaroon.
View Source
const Subsystem = "LNCS"
Subsystem defines the sub system name of this package.
Variables ¶
View Source
var ( // DefaultConnectionTimetout is the default timeout for a connection // attempt. DefaultConnectionTimetout = time.Second * 10 // DefaultStoreTimetout is the default timeout for a db transaction. DefaultStoreTimetout = time.Second * 10 )
View Source
var ( // ErrSessionNotFound is returned when a session is not found in the // database. ErrSessionNotFound = errors.New("session not found") )
Functions ¶
Types ¶
type NodeConn ¶
type NodeConn struct {
// contains filtered or unexported fields
}
NodeConn handles all the connection logic to a remote LND node using LNC.
func NewNodeConn ¶
NewNodeConn creates a new NodeConn instance.
func (*NodeConn) Client ¶
func (n *NodeConn) Client() (lnrpc.LightningClient, error)
Client returns the gRPC client to the remote node.
type Session ¶
type Session struct { // PassphraseWords is the list of words the PassphraseEntropy is derived // from. PassphraseWords string // PassphraseEntropy is the entropy. This field identifies the session. PassphraseEntropy []byte // RemoteStaticPubKey is the public key of the remote peer. RemoteStaticPubKey *btcec.PublicKey // LocalStaticPrivKey is the private key of the local peer. LocalStaticPrivKey *btcec.PrivateKey // MailboxAddr is the address of the mailbox server. MailboxAddr string // CreatedAt is the time the session was added to the database. CreatedAt time.Time // Expiry is the time the session will expire. Expiry *time.Time // DevServer signals if we need to skip the verification of the server's // tls certificate. DevServer bool }
Session contains all the information needed for an LNC connection.
type Store ¶
type Store interface { // AddSession adds a record for a new session in the database. AddSession(ctx context.Context, session *Session) error // GetSession retrieves the session record matching the passphrase // entropy. GetSession(ctx context.Context, passphraseEntropy []byte) (*Session, error) // SetRemotePubKey sets the remote public key for a session. SetRemotePubKey(ctx context.Context, passphraseEntropy, remotePubKey []byte) error // SetExpiry sets the expiry time for a session. SetExpiry(ctx context.Context, passphraseEntroy []byte, expiry time.Time) error }
Store represents access to a persistent session store.
Click to show internal directories.
Click to hide internal directories.