Documentation
¶
Overview ¶
Package app owns node workflows independently of terminal presentation.
Index ¶
- func SendLightningPayment(client LightningPaymentClient, payment PreparedPayment) (*lndrpc.SendPaymentResult, error)
- func StatusServices(cfg config.AppConfig) []string
- func UpdateUnlockArguments(s protocol.Status) ([]string, error)
- func ValidateChannelAmount(amount int64) error
- func ValidateChannelPeer(pubkey, host string) (string, string, error)
- type AccountAccess
- type AccountDetails
- type AccountKeyImport
- type AutoUnlockChanges
- type AutoUnlockObservation
- type AutoUnlockResult
- type ChannelCloseClient
- type ChannelCloseInput
- type ChannelCloseOutcome
- type ChannelCloseResult
- type ChannelHistoryEntry
- type ChannelHistoryReader
- type ChannelHistorySnapshot
- type ChannelHistorySource
- type ChannelOpenClient
- type ChannelOpenInput
- type ChannelOpenResult
- type ChannelOpenState
- type ChannelStatus
- type CoinSelection
- type ConnectionCredential
- type ConnectionInfo
- type ConnectionInfoReader
- type ConnectionTarget
- type FeeReader
- type FeeSuggestions
- type HelperOperation
- type HelperProgress
- type HelperWorkflowKind
- type HelperWorkflowResult
- type HelperWorkflows
- func (w *HelperWorkflows) Close()
- func (w *HelperWorkflows) InstallSyncthing() *HelperOperation
- func (w *HelperWorkflows) ReadP2PAddress(parent context.Context) (p2p.UpgradeRequest, error)
- func (w *HelperWorkflows) UpdateSelf(version string) *HelperOperation
- func (w *HelperWorkflows) UpgradeP2P(request p2p.UpgradeRequest, client P2PConnection) *HelperOperation
- type InvoiceRequest
- type InvoiceState
- type LightningInvoice
- type LightningInvoiceClient
- type LightningPaymentClient
- type NodeUpdates
- func (w *NodeUpdates) Cancel(id string) (protocol.Status, error)
- func (w *NodeUpdates) Close()
- func (w *NodeUpdates) Prepare(version string) (protocol.Review, error)
- func (w *NodeUpdates) Resume(id string) (protocol.Status, error)
- func (w *NodeUpdates) Start(token string) (protocol.Status, error)
- func (w *NodeUpdates) Status() (protocol.Status, error)
- type Observation
- type OnChainReader
- func (r *OnChainReader) Close()
- func (r *OnChainReader) Collect(source OnChainSource) OnChainSnapshot
- func (r *OnChainReader) ReadTransactions(caller context.Context, source OnChainSource) Observation[[]lndrpc.OnChainTx]
- func (r *OnChainReader) ReadUnspent(caller context.Context, source OnChainSource, minConfs, maxConfs int32) Observation[[]lndrpc.UTXO]
- type OnChainReceiveAddress
- type OnChainReceiveClient
- type OnChainSendClient
- type OnChainSendInput
- type OnChainSendResult
- type OnChainSendState
- type OnChainSnapshot
- type OnChainSource
- type P2PConnection
- type PackageUpdateOutcome
- type PackageUpdateResult
- type PackageUpdates
- type PaymentHistoryReader
- type PaymentHistorySnapshot
- type PaymentHistorySource
- type PaymentRequest
- type PreparedChannelClose
- type PreparedChannelOpen
- type PreparedOnChainSend
- type PreparedPayment
- type PreparedTransactionLabel
- type RebootOutcome
- type RebootResult
- type Reboots
- type SSHAccess
- type SSHAuth
- type SSHKey
- type SSHLoginVerifier
- type SSHVerification
- type ServiceActionOutcome
- type ServiceActionResult
- type ServiceControls
- type StatusChannel
- type StatusCollector
- type StatusLND
- type StatusSnapshot
- type Syncthing
- type SyncthingClient
- type SyncthingOutcome
- type SyncthingResult
- type TransactionLabelClient
- type TransactionLabelOutcome
- type TransactionLabelResult
- type WalletClientResult
- type WalletCreation
- type WalletCreationResult
- type WalletExecution
- type WalletObservation
- type WalletPresence
- type WalletRuntime
- func (r *WalletRuntime) Claim(client *lndrpc.Client) bool
- func (r *WalletRuntime) Close()
- func (r *WalletRuntime) Discard(client *lndrpc.Client)
- func (r *WalletRuntime) Open(caller context.Context, stagedOnly bool) WalletClientResult
- func (r *WalletRuntime) Read(caller context.Context) WalletObservation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendLightningPayment ¶
func SendLightningPayment(client LightningPaymentClient, payment PreparedPayment) (*lndrpc.SendPaymentResult, error)
SendLightningPayment submits a prepared invoice with at most one daemon call. It does not retry or reinterpret the outcome. Callers own confirmation and duplicate-action prevention; PreparedPayment is not a single-use token. LND revalidates the invoice at execution and retains its existing fee policy.
func StatusServices ¶
func UpdateUnlockArguments ¶
UpdateUnlockArguments selects LND's native password prompt. VPN never stores the entered secret.
func ValidateChannelAmount ¶
Types ¶
type AccountAccess ¶
type AccountAccess struct {
// contains filtered or unexported fields
}
AccountAccess owns bounded helper observations and owner-side key imports. Close cancels helper waits and joins admitted work, including a local write already in progress. The helper never writes an owner's home for this flow.
func NewAccountAccess ¶
func NewAccountAccess(ssh *SSHAccess) *AccountAccess
func (*AccountAccess) Close ¶
func (a *AccountAccess) Close()
func (*AccountAccess) Import ¶
func (a *AccountAccess) Import(review AccountKeyImport) error
func (*AccountAccess) Inspect ¶
func (a *AccountAccess) Inspect(ref accountaccess.Ref) (AccountDetails, error)
func (*AccountAccess) List ¶
func (a *AccountAccess) List() (accountaccess.Inventory, error)
type AccountDetails ¶
type AccountDetails struct {
accountaccess.Detail
Authorized map[string]bool
OwnerKeysProblem string
}
type AccountKeyImport ¶
type AccountKeyImport struct {
Account accountaccess.Account
Key sshkeys.Key
}
AccountKeyImport freezes the reviewed source identity and exact public key.
type AutoUnlockChanges ¶
type AutoUnlockChanges struct {
// contains filtered or unexported fields
}
AutoUnlockChanges owns the local readers for one TUI. Accepted root operations continue independently when the TUI exits or stops observing.
func NewAutoUnlockChanges ¶
func NewAutoUnlockChanges() *AutoUnlockChanges
NewAutoUnlockChanges creates a lifetime owner for helper-backed transitions.
func (*AutoUnlockChanges) Close ¶
func (w *AutoUnlockChanges) Close()
Close cancels and joins readers, including those with no remaining consumer.
func (*AutoUnlockChanges) Disable ¶
func (w *AutoUnlockChanges) Disable() <-chan AutoUnlockResult
Disable immediately starts observation of the host's locked-state transition.
func (*AutoUnlockChanges) Enable ¶
func (w *AutoUnlockChanges) Enable(password autounlock.Password) <-chan AutoUnlockResult
Enable immediately starts observation of one exact password verification.
type AutoUnlockObservation ¶
type AutoUnlockObservation int
AutoUnlockObservation describes what the local caller knows about the request.
const ( AutoUnlockUnknown AutoUnlockObservation = iota AutoUnlockNotStarted AutoUnlockObserved )
type AutoUnlockResult ¶
type AutoUnlockResult struct {
Observation AutoUnlockObservation
Transition autounlock.Result
Err error
}
AutoUnlockResult separates local observation from the host's proven outcome. A lost response is never evidence of rollback or a stopped root operation.
type ChannelCloseClient ¶
type ChannelCloseClient interface {
ChannelCloseState(string) (lndrpc.ChannelCloseState, error)
CloseChannel(lndrpc.ChannelCloseRequest) lndrpc.ChannelCloseResult
}
type ChannelCloseInput ¶
type ChannelCloseOutcome ¶
type ChannelCloseOutcome int
const ( CloseNotSubmitted ChannelCloseOutcome = iota ClosePending CloseConfirmed CloseOutcomeUnknown )
type ChannelCloseResult ¶
type ChannelCloseResult struct {
State ChannelCloseOutcome
Txid string
Err error
}
func CloseChannel ¶
func CloseChannel(client ChannelCloseClient, prepared PreparedChannelClose) ChannelCloseResult
CloseChannel rechecks the initial-close state before one RPC. Other operators and peers can still change LND state between the reads and submission.
type ChannelHistoryEntry ¶
type ChannelHistoryEntry struct {
ChannelPoint string
PeerAlias string
RemotePubkey string
Capacity int64
Status string
CloseType string
BlocksRemaining int32
}
ChannelHistoryEntry preserves source identity without claiming that independent current and closed observations form an atomic channel lifecycle snapshot.
type ChannelHistoryReader ¶
type ChannelHistoryReader struct {
// contains filtered or unexported fields
}
ChannelHistoryReader owns the additional closed-channel read. Open and pending channels are reused from status, with independent freshness retained by callers.
func NewChannelHistoryReader ¶
func NewChannelHistoryReader() *ChannelHistoryReader
func (*ChannelHistoryReader) Close ¶
func (r *ChannelHistoryReader) Close()
Close cancels and joins admitted work. Shared client reconnect mutex waits can delay cancellation; this does not own the reconnect or root worker.
func (*ChannelHistoryReader) Collect ¶
func (r *ChannelHistoryReader) Collect(source ChannelHistorySource) ChannelHistorySnapshot
type ChannelHistorySnapshot ¶
type ChannelHistorySnapshot struct {
Closed Observation[[]lndrpc.ClosedChannel]
}
func (ChannelHistorySnapshot) Entries ¶
func (s ChannelHistorySnapshot) Entries(current Observation[ChannelStatus]) []ChannelHistoryEntry
func (ChannelHistorySnapshot) Retain ¶
func (s ChannelHistorySnapshot) Retain(previous ChannelHistorySnapshot) ChannelHistorySnapshot
type ChannelHistorySource ¶
type ChannelHistorySource interface {
ListClosedChannelsContext(context.Context) ([]lndrpc.ClosedChannel, error)
}
type ChannelOpenClient ¶
type ChannelOpenInput ¶
type ChannelOpenResult ¶
type ChannelOpenResult struct {
State ChannelOpenState
Txid string
OutputIndex uint32
Err error
}
func OpenChannel ¶
func OpenChannel(client ChannelOpenClient, prepared PreparedChannelOpen) ChannelOpenResult
OpenChannel checks peer readiness and selected availability before one funding call. Preflight reserves nothing; LND checks coins under its wallet lock.
type ChannelOpenState ¶
type ChannelOpenState int
const ( ChannelNotSubmitted ChannelOpenState = iota ChannelBroadcast ChannelOutcomeUnknown )
type ChannelStatus ¶
type ChannelStatus struct {
Channels []StatusChannel
Pending lndrpc.PendingChannelInfo
}
type CoinSelection ¶
type CoinSelection struct {
// contains filtered or unexported fields
}
CoinSelection retains outpoint identity even when a refresh removes a coin. Missing coins must be reviewed or cleared, never replaced by automatic selection.
func (*CoinSelection) Clear ¶
func (s *CoinSelection) Clear()
func (CoinSelection) Len ¶
func (s CoinSelection) Len() int
func (CoinSelection) Outpoints ¶
func (s CoinSelection) Outpoints() []string
func (*CoinSelection) Toggle ¶
func (s *CoinSelection) Toggle(coin lndrpc.UTXO)
type ConnectionCredential ¶
type ConnectionCredential string
ConnectionCredential holds raw staged bytes. String formatting deliberately redacts them; callers must explicitly convert for a credential display.
func (ConnectionCredential) GoString ¶
func (c ConnectionCredential) GoString() string
func (ConnectionCredential) String ¶
func (ConnectionCredential) String() string
type ConnectionInfo ¶
type ConnectionInfo struct {
Address string
AddressErr error
CredentialErr error
Credential ConnectionCredential
Target ConnectionTarget
}
ConnectionInfo is one read of an endpoint and its deliberately staged credential. It does not prove remote reachability or successful authentication. The credential is explicit; default string formatting redacts it.
func (ConnectionInfo) CredentialText ¶
func (i ConnectionInfo) CredentialText() string
CredentialText is for an explicit credential display, never diagnostics.
func (ConnectionInfo) GoString ¶
func (i ConnectionInfo) GoString() string
func (ConnectionInfo) HasCredential ¶
func (i ConnectionInfo) HasCredential() bool
func (ConnectionInfo) String ¶
func (i ConnectionInfo) String() string
func (ConnectionInfo) URL ¶
func (i ConnectionInfo) URL(host string) string
URL formats the existing REST connection contract. The caller supplies a freshly observed public IP for the optional clearnet endpoint.
type ConnectionInfoReader ¶
type ConnectionInfoReader struct {
// contains filtered or unexported fields
}
ConnectionInfoReader owns read cancellation and joining for one terminal. Helper reads have a 30-second local deadline including queue time. This does not interrupt root work. Ordinary staged-file reads finish before Close returns.
func NewConnectionInfoReader ¶
func NewConnectionInfoReader() *ConnectionInfoReader
func (*ConnectionInfoReader) Close ¶
func (r *ConnectionInfoReader) Close()
func (*ConnectionInfoReader) Read ¶
func (r *ConnectionInfoReader) Read(target ConnectionTarget) ConnectionInfo
type ConnectionTarget ¶
type ConnectionTarget int
ConnectionTarget selects one of the existing operator connection displays.
const ( LNDRESTConnection ConnectionTarget = iota SyncthingWebConnection )
type FeeReader ¶
type FeeReader struct {
// contains filtered or unexported fields
}
FeeReader owns local read lifetimes for one terminal session. Callers own scheduling, request identity and publication; no cross-form cache is kept.
func NewFeeReader ¶
func NewFeeReader() *FeeReader
func (*FeeReader) Collect ¶
func (r *FeeReader) Collect(caller context.Context, network string) FeeSuggestions
Collect bounds the whole collection and cancels it when either its form or terminal session closes. An individual unavailable estimate does not discard the other targets; cancellation discards the interrupted collection.
type FeeSuggestions ¶
type FeeSuggestions struct {
Tiers [3]bitcoin.FeeEstimate
Err error
}
FeeSuggestions contains independent estimates for the fast, medium and slow requested targets. A zero entry is unavailable; successful entries retain the actual target returned by Core. These are hints, not exact transaction quotes.
type HelperOperation ¶
type HelperOperation struct {
// contains filtered or unexported fields
}
func (*HelperOperation) Events ¶
func (o *HelperOperation) Events() <-chan HelperProgress
func (*HelperOperation) Kind ¶
func (o *HelperOperation) Kind() HelperWorkflowKind
func (*HelperOperation) Steps ¶
func (o *HelperOperation) Steps() []string
type HelperProgress ¶
type HelperProgress struct {
Index int
Result *HelperWorkflowResult
}
HelperProgress reports one completed step, or the terminal result at Index. The terminal event occupies the next index and is emitted exactly once.
type HelperWorkflowKind ¶
type HelperWorkflowKind int
const ( SyncthingInstall HelperWorkflowKind = iota P2PUpgrade SelfUpdate )
type HelperWorkflowResult ¶
HelperWorkflowResult distinguishes successful mutation from a failed local configuration read. An error never establishes that earlier changes were undone.
type HelperWorkflows ¶
type HelperWorkflows struct {
// contains filtered or unexported fields
}
HelperWorkflows owns this client's streaming operations. Close cancels local observation and waits for its readers to release their connections. The helper retains authority to finish accepted operations, including after this TUI exits.
func NewHelperWorkflows ¶
func NewHelperWorkflows(syncthingVersion string) *HelperWorkflows
func (*HelperWorkflows) Close ¶
func (w *HelperWorkflows) Close()
func (*HelperWorkflows) InstallSyncthing ¶
func (w *HelperWorkflows) InstallSyncthing() *HelperOperation
func (*HelperWorkflows) ReadP2PAddress ¶
func (w *HelperWorkflows) ReadP2PAddress(parent context.Context) (p2p.UpgradeRequest, error)
ReadP2PAddress makes a fresh, bounded observation for one confirmation screen. Both screen cancellation and terminal shutdown release the read.
func (*HelperWorkflows) UpdateSelf ¶
func (w *HelperWorkflows) UpdateSelf(version string) *HelperOperation
func (*HelperWorkflows) UpgradeP2P ¶
func (w *HelperWorkflows) UpgradeP2P(request p2p.UpgradeRequest, client P2PConnection) *HelperOperation
type InvoiceRequest ¶
type InvoiceState ¶
type InvoiceState int
const ( InvoicePending InvoiceState = iota InvoicePaid InvoiceExpired InvoiceCanceled InvoiceMissing )
func CheckLightningInvoice ¶
func CheckLightningInvoice(client LightningInvoiceClient, invoice LightningInvoice) (InvoiceState, error)
CheckLightningInvoice distinguishes a missing record from a failed lookup. Neither establishes whether payment succeeded.
type LightningInvoice ¶
type LightningInvoice struct {
// contains filtered or unexported fields
}
LightningInvoice binds the displayed invoice to the hash used to check it.
func CreateLightningInvoice ¶
func CreateLightningInvoice(client LightningInvoiceClient, request InvoiceRequest) (LightningInvoice, error)
func (LightningInvoice) AmountSats ¶
func (i LightningInvoice) AmountSats() int64
func (LightningInvoice) PaymentRequest ¶
func (i LightningInvoice) PaymentRequest() string
type LightningInvoiceClient ¶
type LightningPaymentClient ¶
type LightningPaymentClient interface {
DecodePayReq(string) (*lndrpc.DecodedPayReq, error)
SendPayment(string) (*lndrpc.SendPaymentResult, error)
}
LightningPaymentClient is the daemon access needed to prepare and pay an invoice. LND retains responsibility for routing and recovering stream outcomes.
type NodeUpdates ¶
type NodeUpdates struct {
// contains filtered or unexported fields
}
NodeUpdates owns observation lifetimes. Canceling a client never cancels the root-owned job; another terminal can read and resume that same job.
func NewNodeUpdates ¶
func NewNodeUpdates() *NodeUpdates
func (*NodeUpdates) Close ¶
func (w *NodeUpdates) Close()
type Observation ¶
Observation retains the last successful value and the latest read error. A zero observation is unavailable, not a successful zero or empty result.
func (Observation[T]) Fresh ¶
func (o Observation[T]) Fresh() bool
func (Observation[T]) Known ¶
func (o Observation[T]) Known() bool
type OnChainReader ¶
type OnChainReader struct {
// contains filtered or unexported fields
}
OnChainReader owns local read lifetimes. Scheduling and same-wallet retention belong to its caller; the two reads do not form an atomic wallet snapshot.
func NewOnChainReader ¶
func NewOnChainReader() *OnChainReader
func (*OnChainReader) Close ¶
func (r *OnChainReader) Close()
Close cancels and joins local reads. Shared LND reconnect mutex waits can still delay the join; this owner does not change connection recovery.
func (*OnChainReader) Collect ¶
func (r *OnChainReader) Collect(source OnChainSource) OnChainSnapshot
func (*OnChainReader) ReadTransactions ¶
func (r *OnChainReader) ReadTransactions(caller context.Context, source OnChainSource) Observation[[]lndrpc.OnChainTx]
func (*OnChainReader) ReadUnspent ¶
func (r *OnChainReader) ReadUnspent(caller context.Context, source OnChainSource, minConfs, maxConfs int32) Observation[[]lndrpc.UTXO]
ReadUnspent and ReadTransactions share the terminal owner while allowing forms to publish each observation as soon as it completes. Each caller can cancel its own reads without canceling another form or the On-Chain view.
type OnChainReceiveAddress ¶
type OnChainReceiveAddress struct {
// contains filtered or unexported fields
}
OnChainReceiveAddress is a validated P2TR address returned by LND.
func CreateOnChainAddress ¶
func CreateOnChainAddress(client OnChainReceiveClient, network, previous string) (OnChainReceiveAddress, error)
CreateOnChainAddress requests once. An error does not prove LND failed to derive an address; an explicit retry requests another, without retiring any previously issued address. Network encoding cannot distinguish signet from testnet4, so the installed daemon remains the authority for chain identity.
func (OnChainReceiveAddress) Text ¶
func (a OnChainReceiveAddress) Text() string
type OnChainReceiveClient ¶
type OnChainReceiveClient interface {
GetNewAddress() (*lndrpc.OnChainAddress, error)
}
type OnChainSendClient ¶
type OnChainSendClient interface {
ListUnspent(int32, int32) ([]lndrpc.UTXO, error)
SendCoins(lndrpc.SendCoinsRequest) (*lndrpc.SendCoinsResult, error)
}
type OnChainSendInput ¶
type OnChainSendResult ¶
type OnChainSendResult struct {
State OnChainSendState
Txid string
Err error
}
func SendOnChain ¶
func SendOnChain(client OnChainSendClient, prepared PreparedOnChainSend) OnChainSendResult
SendOnChain rechecks explicit inputs and makes at most one send RPC. LND validates and selects under its own wallet lock; this precheck reserves nothing. A lost RPC response cannot prove that no transaction was published.
type OnChainSendState ¶
type OnChainSendState int
const ( OnChainNotSubmitted OnChainSendState = iota OnChainBroadcast OnChainOutcomeUnknown )
type OnChainSnapshot ¶
type OnChainSnapshot struct {
Utxos Observation[[]lndrpc.UTXO]
OnChainTxs Observation[[]lndrpc.OnChainTx]
}
func (OnChainSnapshot) Retain ¶
func (s OnChainSnapshot) Retain(previous OnChainSnapshot) OnChainSnapshot
func (OnChainSnapshot) Unavailable ¶
func (s OnChainSnapshot) Unavailable(err error) OnChainSnapshot
type OnChainSource ¶
type P2PConnection ¶
type PackageUpdateOutcome ¶
type PackageUpdateOutcome int
const ( PackageUpdateUnconfirmed PackageUpdateOutcome = iota PackageUpdateNotStarted PackageUpdateCompleted )
type PackageUpdateResult ¶
type PackageUpdateResult struct {
Outcome PackageUpdateOutcome
Err error
}
type PackageUpdates ¶
type PackageUpdates struct {
// contains filtered or unexported fields
}
PackageUpdates owns local observation, not the accepted root transaction. Closing it releases and joins readers without killing apt or retrying work.
func NewPackageUpdates ¶
func NewPackageUpdates() *PackageUpdates
func (*PackageUpdates) Close ¶
func (u *PackageUpdates) Close()
func (*PackageUpdates) Update ¶
func (u *PackageUpdates) Update() <-chan PackageUpdateResult
type PaymentHistoryReader ¶
type PaymentHistoryReader struct {
// contains filtered or unexported fields
}
PaymentHistoryReader owns collection and local cancellation. The independent RPC windows are not a complete ledger or an atomic balance snapshot.
func NewPaymentHistoryReader ¶
func NewPaymentHistoryReader() *PaymentHistoryReader
func (*PaymentHistoryReader) Close ¶
func (r *PaymentHistoryReader) Close()
Close joins admitted reads. Existing shared reconnect mutex waits can delay cancellation; this owner does not change connection or root-worker recovery.
func (*PaymentHistoryReader) Collect ¶
func (r *PaymentHistoryReader) Collect(source PaymentHistorySource) PaymentHistorySnapshot
type PaymentHistorySnapshot ¶
type PaymentHistorySnapshot struct {
Invoices Observation[[]lndrpc.PaymentEntry]
Payments Observation[[]lndrpc.PaymentEntry]
}
func (PaymentHistorySnapshot) Entries ¶
func (s PaymentHistorySnapshot) Entries() []lndrpc.PaymentEntry
Entries merges the two recent windows without changing either observation. Stable ties use direction and the daemon's index, not reply order.
func (PaymentHistorySnapshot) Fresh ¶
func (s PaymentHistorySnapshot) Fresh() bool
func (PaymentHistorySnapshot) Retain ¶
func (s PaymentHistorySnapshot) Retain(previous PaymentHistorySnapshot) PaymentHistorySnapshot
func (PaymentHistorySnapshot) Unavailable ¶
func (s PaymentHistorySnapshot) Unavailable(err error) PaymentHistorySnapshot
type PaymentHistorySource ¶
type PaymentRequest ¶
type PaymentRequest struct {
// contains filtered or unexported fields
}
PaymentRequest contains an invoice that passed the installed network prefilter. LND must still decode and validate the invoice; a prefix is not proof of validity.
func ParseLightningPayment ¶
func ParseLightningPayment(network, raw string) (PaymentRequest, error)
ParseLightningPayment normalizes pasted input and applies the node's network policy before any daemon call. It does not authorize sending a payment.
func (PaymentRequest) Invoice ¶
func (r PaymentRequest) Invoice() string
type PreparedChannelClose ¶
type PreparedChannelClose struct {
// contains filtered or unexported fields
}
PreparedChannelClose owns the channel, mode and fee policy shown for approval.
func PrepareChannelClose ¶
func PrepareChannelClose(input ChannelCloseInput) (PreparedChannelClose, error)
func (PreparedChannelClose) Request ¶
func (p PreparedChannelClose) Request() lndrpc.ChannelCloseRequest
type PreparedChannelOpen ¶
type PreparedChannelOpen struct {
// contains filtered or unexported fields
}
PreparedChannelOpen owns the reviewed request. Selected coins are the allowed funding pool; LND can use a subset and determines fees, capacity and change. Preparation does not reserve coins or construct a funding transaction.
func PrepareChannelOpen ¶
func PrepareChannelOpen(input ChannelOpenInput, available []lndrpc.UTXO) (PreparedChannelOpen, error)
func (PreparedChannelOpen) Request ¶
func (p PreparedChannelOpen) Request() lndrpc.ChannelOpenRequest
func (PreparedChannelOpen) SelectedTotal ¶
func (p PreparedChannelOpen) SelectedTotal() int64
type PreparedOnChainSend ¶
type PreparedOnChainSend struct {
// contains filtered or unexported fields
}
PreparedOnChainSend owns the reviewed intent, including automatic selection when Outpoints is empty. It is not a signed transaction or a single-use token. LND's pinned EstimateFee API cannot quote manual-rate or send-all requests; no total fee, net Max amount, or change amount is promised here.
func PrepareOnChainSend ¶
func PrepareOnChainSend(network string, input OnChainSendInput, available []lndrpc.UTXO) (PreparedOnChainSend, error)
func (PreparedOnChainSend) Coins ¶
func (p PreparedOnChainSend) Coins() []lndrpc.UTXO
func (PreparedOnChainSend) Request ¶
func (p PreparedOnChainSend) Request() lndrpc.SendCoinsRequest
type PreparedPayment ¶
type PreparedPayment struct {
// contains filtered or unexported fields
}
PreparedPayment keeps the decoded details and their exact invoice together. Its fields are private so editing a form or a details copy cannot change what will be submitted after confirmation.
func PrepareLightningPayment ¶
func PrepareLightningPayment(client LightningPaymentClient, request PaymentRequest) (PreparedPayment, error)
func (PreparedPayment) Details ¶
func (p PreparedPayment) Details() lndrpc.DecodedPayReq
type PreparedTransactionLabel ¶
type PreparedTransactionLabel struct {
// contains filtered or unexported fields
}
PreparedTransactionLabel keeps the transaction and text fixed after Save. Labels belong to a transaction, including all of its wallet outputs.
func PrepareTransactionLabel ¶
func PrepareTransactionLabel(txid, label string) (PreparedTransactionLabel, error)
type RebootOutcome ¶
type RebootOutcome int
const ( RebootUnconfirmed RebootOutcome = iota RebootNotStarted RebootAccepted )
type RebootResult ¶
type RebootResult struct {
Outcome RebootOutcome
Err error
}
type Reboots ¶
type Reboots struct {
// contains filtered or unexported fields
}
Reboots owns local observation for one terminal session. Close cancels and joins readers without canceling an accepted host request or retrying it.
func NewReboots ¶
func NewReboots() *Reboots
func (*Reboots) Request ¶
func (r *Reboots) Request() <-chan RebootResult
type SSHAccess ¶
func NewSSHAccess ¶
func NewSSHAccess() *SSHAccess
func (*SSHAccess) PasswordAuth ¶
func (*SSHAccess) RemoveKey ¶
RemoveKey evaluates the current file and password setting at apply time. All copies of the selected fingerprint are removed; duplicates are one credential.
func (*SSHAccess) SetPasswordAuthDisabled ¶
type SSHAuth ¶
type SSHAuth interface {
PasswordAuth() (bool, error)
SetPasswordAuthDisabled(disabled bool) error
}
SSHAuth is the narrow privileged boundary. Key files are edited as the operator.
type SSHKey ¶
func ParseSSHKey ¶
type SSHLoginVerifier ¶
type SSHLoginVerifier struct {
// contains filtered or unexported fields
}
SSHLoginVerifier asks the helper to verify first-login evidence and may clear the pending marker. Close cancels and joins local waits, not accepted root work.
func NewSSHLoginVerifier ¶
func NewSSHLoginVerifier() *SSHLoginVerifier
func (*SSHLoginVerifier) Close ¶
func (r *SSHLoginVerifier) Close()
func (*SSHLoginVerifier) Verify ¶
func (r *SSHLoginVerifier) Verify() SSHVerification
Verify may clear the root-owned pending marker when sshd evidence verifies the login. An already-clear marker also succeeds. Address is only a hint.
type SSHVerification ¶
SSHVerification is one completed first-login observation. Address is only a display hint; failure to observe it must not change the verification fact.
type ServiceActionOutcome ¶
type ServiceActionOutcome int
const ( ServiceActionUnconfirmed ServiceActionOutcome = iota ServiceActionNotStarted ServiceActionCompleted )
type ServiceActionResult ¶
type ServiceActionResult struct {
Outcome ServiceActionOutcome
Err error
}
type ServiceControls ¶
type ServiceControls struct {
// contains filtered or unexported fields
}
ServiceControls owns bounded helper observation for one terminal session. Close cancels and joins local work, not root mutations already accepted.
func NewServiceControls ¶
func NewServiceControls() *ServiceControls
func (*ServiceControls) Close ¶
func (s *ServiceControls) Close()
func (*ServiceControls) Control ¶
func (s *ServiceControls) Control(request servicecontrol.Request) <-chan ServiceActionResult
type StatusChannel ¶
type StatusCollector ¶
type StatusCollector struct {
// contains filtered or unexported fields
}
StatusCollector owns observation I/O and its cache for one terminal session. Scheduling and publication stay with the caller. RPCs and helper reads share a deadline; separate daemon RPCs are not an atomic snapshot.
func NewStatusCollector ¶
func NewStatusCollector() *StatusCollector
func (*StatusCollector) Close ¶
func (c *StatusCollector) Close()
Close cancels and joins local readers. Existing shared LND client mutex waits can delay the join; automatic reconnection is not owned by this collector.
func (*StatusCollector) Collect ¶
func (c *StatusCollector) Collect(cfg config.AppConfig, walletExists bool, client StatusLND) StatusSnapshot
type StatusLND ¶
type StatusLND interface {
GetStateContext(context.Context) (lndrpc.WalletState, error)
GetInfoContext(context.Context) (*lndrpc.NodeInfo, error)
GetWalletBalanceContext(context.Context) (*lndrpc.WalletBalance, error)
ListChannelsContext(context.Context) ([]lndrpc.Channel, error)
GetPendingChannelsContext(context.Context) (*lndrpc.PendingChannelInfo, error)
}
type StatusSnapshot ¶
type StatusSnapshot struct {
Services map[string]Observation[bool]
Disk Observation[system.DiskInfo]
Memory Observation[system.MemInfo]
Bitcoin Observation[bitcoin.BlockchainInfo]
LNDSize Observation[string]
Reboot Observation[bool]
PublicIP Observation[string]
WalletState Observation[lndrpc.WalletState]
Node Observation[lndrpc.NodeInfo]
Balance Observation[lndrpc.WalletBalance]
Channels Observation[ChannelStatus]
}
func (StatusSnapshot) Retain ¶
func (s StatusSnapshot) Retain(previous StatusSnapshot) StatusSnapshot
Retain combines failures with last-good values from the same observation scope. Callers must discard the previous snapshot when that scope changes.
func (StatusSnapshot) WalletUnavailable ¶
func (s StatusSnapshot) WalletUnavailable(err error) StatusSnapshot
WalletUnavailable preserves observations for display without treating a failed presence read as a change of wallet or proof of current balances.
type Syncthing ¶
type Syncthing struct {
// contains filtered or unexported fields
}
Syncthing owns bounded runtime workflows; the daemon remains configuration authority. A successful pair configures this node, not the remote receiver.
func NewSyncthing ¶
func NewSyncthing() *Syncthing
func (*Syncthing) Close ¶
func (s *Syncthing) Close()
Close cancels and joins local calls. Accepted daemon writes are not rolled back.
func (*Syncthing) Pair ¶
func (s *Syncthing) Pair(input string) SyncthingResult
func (*Syncthing) Remove ¶
func (s *Syncthing) Remove(input string) SyncthingResult
type SyncthingClient ¶
type SyncthingClient interface {
CanonicalID(context.Context, string) (string, error)
LocalID(context.Context) (string, error)
ListDevices(context.Context) ([]syncthing.Device, error)
ConfirmPrivacy(context.Context) error
BackupFolder(context.Context, string) (syncthing.BackupFolder, error)
AddDevice(context.Context, string) error
RemoveDevice(context.Context, string) error
}
type SyncthingOutcome ¶
type SyncthingOutcome int
const ( SyncthingNotChanged SyncthingOutcome = iota SyncthingComplete SyncthingPartial SyncthingUnknown )
type SyncthingResult ¶
type SyncthingResult struct {
Outcome SyncthingOutcome
DeviceID string
LocalID string
Err error
}
type TransactionLabelClient ¶
type TransactionLabelClient interface {
SetTransactionLabel(lndrpc.TransactionLabelRequest) lndrpc.TransactionLabelResult
}
type TransactionLabelOutcome ¶
type TransactionLabelOutcome int
const ( TransactionLabelUnknown TransactionLabelOutcome = iota TransactionLabelNotSaved TransactionLabelSaved )
type TransactionLabelResult ¶
type TransactionLabelResult struct {
Outcome TransactionLabelOutcome
Err error
}
func SaveTransactionLabel ¶
func SaveTransactionLabel(client TransactionLabelClient, prepared PreparedTransactionLabel) TransactionLabelResult
SaveTransactionLabel makes one request. An attempted RPC with a lost response does not establish whether LND saved the label, and is never retried here.
type WalletClientResult ¶
type WalletCreation ¶
type WalletCreation struct {
// contains filtered or unexported fields
}
WalletCreation owns bounded readiness and finalization calls for one TUI. Interactive password and seed input stays with the terminal adapter. Close cancels local observation, not an accepted LND or helper mutation.
func NewWalletCreation ¶
func NewWalletCreation() *WalletCreation
func (*WalletCreation) Close ¶
func (w *WalletCreation) Close()
func (*WalletCreation) Finalize ¶
func (w *WalletCreation) Finalize(execution WalletExecution) WalletCreationResult
Finalize can be called again to reobserve and stage credentials. It never invokes wallet creation or infers seed acknowledgement from wallet existence.
func (*WalletCreation) Prepare ¶
func (w *WalletCreation) Prepare(network string) (string, error)
Prepare returns the validated lncli network only after a fresh NON_EXISTING observation. The deadline includes RPC duration and retry waits. Another process may still create a wallet afterward; LND remains the final authority.
type WalletCreationResult ¶
type WalletCreationResult struct {
Presence WalletPresence
CredentialsStaged bool
SeedAcknowledged bool
Err error
}
func (WalletCreationResult) CanRetryFinalization ¶
func (r WalletCreationResult) CanRetryFinalization() bool
type WalletExecution ¶
WalletExecution records process evidence separately from terminal restoration. A failed command does not establish that InitWallet was rejected by LND.
type WalletObservation ¶
type WalletObservation struct {
Presence WalletPresence
Err error
}
type WalletPresence ¶
type WalletPresence int
const ( WalletUnknown WalletPresence = iota WalletAbsent WalletPresent )
type WalletRuntime ¶
type WalletRuntime struct {
// contains filtered or unexported fields
}
WalletRuntime owns local presence reads and unpublished clients for one TUI. Claim transfers a client to the caller. Close cancels and joins local work, and closes any client whose completion was never claimed by the event loop. Cancellation cannot undo credential staging already accepted by the helper.
func NewWalletRuntime ¶
func NewWalletRuntime() *WalletRuntime
func (*WalletRuntime) Close ¶
func (r *WalletRuntime) Close()
func (*WalletRuntime) Discard ¶
func (r *WalletRuntime) Discard(client *lndrpc.Client)
Discard only closes a still-unclaimed client. Duplicate or obsolete messages cannot close a client already published to the rest of the application.
func (*WalletRuntime) Open ¶
func (r *WalletRuntime) Open(caller context.Context, stagedOnly bool) WalletClientResult
Open keeps ordinary startup's probe/repair separate from the staged-only post-creation path. The deadline includes any helper queue and retry waits. Ordinary file reads must finish before cancellation can join the worker.
func (*WalletRuntime) Read ¶
func (r *WalletRuntime) Read(caller context.Context) WalletObservation
Source Files
¶
- account_access.go
- auto_unlock.go
- channel_close.go
- channel_history.go
- channel_open.go
- coin_selection.go
- connection_info.go
- fees.go
- helper_workflows.go
- lightning_invoice.go
- lightning_payment.go
- node_updates.go
- onchain_observations.go
- onchain_receive.go
- onchain_send.go
- package_update.go
- payment_history.go
- reboot.go
- service_control.go
- ssh_access.go
- ssh_verification.go
- status.go
- syncthing.go
- transaction_label.go
- wallet_creation.go
- wallet_runtime.go