Documentation ¶
Index ¶
- Constants
- Variables
- func MigrateTowerToSessionIndex(tx kvdb.RwTx) error
- func ReadElement(r io.Reader, element interface{}) error
- func ReadElements(r io.Reader, elements ...interface{}) error
- func UseLogger(logger btclog.Logger)
- func WriteElement(w io.Writer, element interface{}) error
- func WriteElements(w io.Writer, elements ...interface{}) error
- type CSessionStatus
- type ClientSession
- type ClientSessionBody
- type SessionID
- type TowerID
- type UnknownElementType
Constants ¶
const SessionIDSize = 33
SessionIDSize is 33-bytes; it is a serialized, compressed public key.
Variables ¶
var ( // ErrUninitializedDB signals that top-level buckets for the database // have not been initialized. ErrUninitializedDB = errors.New("db not initialized") // ErrClientSessionNotFound signals that the requested client session // was not found in the database. ErrClientSessionNotFound = errors.New("client session not found") // ErrCorruptClientSession signals that the client session's on-disk // structure deviates from what is expected. ErrCorruptClientSession = errors.New("client session corrupted") )
Functions ¶
func MigrateTowerToSessionIndex ¶
MigrateTowerToSessionIndex constructs a new towerID-to-sessionID for the watchtower client DB.
func ReadElement ¶
ReadElement deserializes a single element from the provided io.Reader.
func ReadElements ¶
ReadElements deserializes the provided io.Reader into a variadic list of target elements.
func WriteElement ¶
WriteElement serializes a single element into the provided io.Writer.
func WriteElements ¶
WriteElements serializes a variadic list of elements into the given io.Writer.
Types ¶
type CSessionStatus ¶
type CSessionStatus uint8
CSessionStatus is a bit-field representing the possible statuses of ClientSessions.
type ClientSession ¶
type ClientSession struct { // ID is the client's public key used when authenticating with the // tower. ID SessionID ClientSessionBody }
ClientSession encapsulates a SessionInfo returned from a successful session negotiation, and also records the tower and ephemeral secret used for communicating with the tower.
type ClientSessionBody ¶
type ClientSessionBody struct { // SeqNum is the next unallocated sequence number that can be sent to // the tower. SeqNum uint16 // TowerLastApplied the last last-applied the tower has echoed back. TowerLastApplied uint16 // TowerID is the unique, db-assigned identifier that references the // Tower with which the session is negotiated. TowerID TowerID // KeyIndex is the index of key locator used to derive the client's // session key so that it can authenticate with the tower to update its // session. In order to rederive the private key, the key locator should // use the keychain.KeyFamilyTowerSession key family. KeyIndex uint32 // Policy holds the negotiated session parameters. Policy wtpolicy.Policy // Status indicates the current state of the ClientSession. Status CSessionStatus // RewardPkScript is the pkscript that the tower's reward will be // deposited to if a sweep transaction confirms and the sessions // specifies a reward output. RewardPkScript []byte }
type SessionID ¶
type SessionID [SessionIDSize]byte
SessionID is created from the remote public key of a client, and serves as a unique identifier and authentication for sending state updates.
type TowerID ¶
type TowerID uint64
TowerID is a unique 64-bit identifier allocated to each unique watchtower. This allows the client to conserve on-disk space by not needing to always reference towers by their pubkey.
type UnknownElementType ¶
type UnknownElementType = channeldb.UnknownElementType
UnknownElementType is an alias for channeldb.UnknownElementType.