Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertLNDShortChannelID(LNDShortChannelID uint64) string
- func ConvertShortChannelIDToLND(ShortChannelID string) (uint64, error)
- func CreateChannelPoint(fundingTransactionHash string, fundingOutputIndex int) string
- func GetActiveChannelIdByFundingTransaction(fundingTransactionHash string, fundingOutputIndex int) int
- func GetActiveChannelIdByShortChannelId(shortChannelId string) int
- func GetActiveNodeIdByPublicKey(publicKey string, chain Chain, network Network) int
- func GetAllActiveTorqNodeIds(chain *Chain, network *Network) []int
- func GetAllChannelPublicKeys(chain Chain, network Network) []string
- func GetAllTorqNodeIds(chain Chain, network Network) []int
- func GetAllTorqPublicKeys(chain Chain, network Network) []string
- func GetChannelIdByChannelPoint(channelPoint string) int
- func GetChannelIdByFundingTransaction(fundingTransactionHash string, fundingOutputIndex int) int
- func GetChannelIdByLndShortChannelId(lndShortChannelId uint64) int
- func GetChannelIdByShortChannelId(shortChannelId string) int
- func GetChannelIdsByNodeId(peerNodeId int) []int
- func GetChannelNodeIds(chain Chain, network Network) []int
- func GetChannelPublicKeys(chain Chain, network Network) []string
- func GetNodeIdByPublicKey(publicKey string, chain Chain, network Network) int
- func InactivateChannelNode(publicKey string, chain Chain, network Network)
- func ManagedChannelCache(ch chan ManagedChannel, ctx context.Context)
- func ManagedChannelGroupCache(ch chan ManagedChannelGroup, ctx context.Context)
- func ManagedChannelStateCache(ch chan ManagedChannelState, broadcaster broadcast.BroadcastServer, ...)
- func ManagedNodeCache(ch chan ManagedNode, ctx context.Context)
- func ManagedSettingsCache(ch chan ManagedSettings, ctx context.Context)
- func MutexLocked(m *sync.Mutex) bool
- func ParseChannelPoint(channelPoint string) (string, int)
- func RWMutexReadLocked(rw *sync.RWMutex) bool
- func RWMutexWriteLocked(rw *sync.RWMutex) bool
- func SendToManagedChannelBalanceStateSettingsChannel(ch chan *ManagedChannelBalanceStateSettings, ...)
- func SendToManagedChannelBalanceStatesSettingsChannel(ch chan []ManagedChannelBalanceStateSettings, ...)
- func SendToManagedChannelChannel(ch chan ManagedChannel, managedChannel ManagedChannel)
- func SendToManagedChannelGroupSettingsChannel(ch chan *ManagedChannelGroupSettings, ...)
- func SendToManagedChannelIdsChannel(ch chan []int, channelIds []int)
- func SendToManagedChannelSettingChannel(ch chan ManagedChannelSettings, channelSettings ManagedChannelSettings)
- func SendToManagedChannelSettingsChannel(ch chan []ManagedChannelSettings, channelSettings []ManagedChannelSettings)
- func SendToManagedChannelStateSettingsChannel(ch chan *ManagedChannelStateSettings, ...)
- func SendToManagedChannelStatesSettingsChannel(ch chan []ManagedChannelStateSettings, ...)
- func SendToManagedNodeChannel(ch chan ManagedNode, managedNode ManagedNode)
- func SendToManagedNodeIdsChannel(ch chan []int, nodeIds []int)
- func SendToManagedNodeSettingsChannel(ch chan ManagedNodeSettings, nodeSettings ManagedNodeSettings)
- func SendToManagedPublicKeysChannel(ch chan []string, publicKeys []string)
- func SendToManagedSettingsChannel(ch chan ManagedSettings, managedSettings ManagedSettings)
- func SetChannel(channelId int, shortChannelId *string, status ChannelStatus, ...)
- func SetChannelGroupsByChannelId(channelId int, channelGroups []ChannelGroup)
- func SetChannelNode(nodeId int, publicKey string, chain Chain, network Network, ...)
- func SetChannelStateBalanceHtlcEvent(htlcEvent HtlcEvent)
- func SetChannelStateBalanceUpdate(nodeId int, channelId int, increaseBalance bool, amount int64)
- func SetChannelStateBalanceUpdateMsat(nodeId int, channelId int, increaseBalance bool, amount uint64)
- func SetChannelStateChannelStatus(nodeId int, channelId int, status Status)
- func SetChannelStateNodeStatus(nodeId int, status Status)
- func SetChannelStateRoutingPolicy(nodeId int, channelId int, local bool, disabled bool, timeLockDelta uint32, ...)
- func SetChannelStates(nodeId int, channelStateSettings []ManagedChannelStateSettings)
- func SetChannelStatus(channelId int, status ChannelStatus)
- func SetInactiveChannelNode(nodeId int, publicKey string, chain Chain, network Network)
- func SetSettings(defaultDateRange, defaultLanguage, weekStartsOn, preferredTimeZone string)
- func SetTorqNode(nodeId int, name string, status Status, publicKey string, chain Chain, ...)
- type BlockEvent
- type Chain
- type ChannelBalanceStateHtlcInclude
- type ChannelEvent
- type ChannelGraphEvent
- type ChannelGraphEventData
- type ChannelGroup
- type ChannelGroupInclude
- type ChannelStateInclude
- type ChannelStatus
- type EventData
- type ForwardEvent
- type GraphEventData
- type Htlc
- type HtlcEvent
- type Implementation
- type ImportRequest
- type ImportType
- type InvoiceEvent
- type ManagedChannel
- type ManagedChannelBalanceStateSettings
- type ManagedChannelCacheOperationType
- type ManagedChannelGroup
- type ManagedChannelGroupCacheOperationType
- type ManagedChannelGroupSettings
- type ManagedChannelSettings
- type ManagedChannelState
- type ManagedChannelStateCacheOperationType
- type ManagedChannelStateSettings
- type ManagedNode
- type ManagedNodeCacheOperationType
- type ManagedNodeSettings
- type ManagedSettings
- type ManagedSettingsCacheOperationType
- type Network
- type NodeConnectionDetailCustomSettings
- type NodeGraphEvent
- type NodeGraphEventData
- type PaymentEvent
- type PeerEvent
- type PingSystem
- type ServiceChannelMessage
- type ServiceCommand
- type ServiceEvent
- type ServiceType
- type Services
- func (rs *Services) AddSubscription(nodeId int, cancelFunc func(), eventChannel chan interface{})
- func (rs *Services) Booted(nodeId int, bootLock *sync.Mutex, eventChannel chan interface{})
- func (rs *Services) Cancel(nodeId int, enforcedServiceStatus *Status, noDelay bool, ...) Status
- func (rs *Services) GetActiveNodeIds() []int
- func (rs *Services) GetBootLock(nodeId int) *sync.Mutex
- func (rs *Services) GetBootTime(nodeId int) *time.Time
- func (rs *Services) GetChannelBalanceCacheStreamStatus(nodeId int) Status
- func (rs *Services) GetEnforcedServiceStatusCheck(nodeId int) *Status
- func (rs *Services) GetIncludeIncomplete(nodeId int) bool
- func (rs *Services) GetNodeIds() []int
- func (rs *Services) GetStatus(nodeId int) Status
- func (rs *Services) GetStreamBootTime(nodeId int, stream SubscriptionStream) *time.Time
- func (rs *Services) GetStreamInitializationPingTime(nodeId int, stream SubscriptionStream) *time.Time
- func (rs *Services) GetStreamStatus(nodeId int, stream SubscriptionStream) Status
- func (rs *Services) Initialising(nodeId int, eventChannel chan interface{})
- func (rs *Services) IsNoDelay(nodeId int) bool
- func (rs *Services) RemoveSubscription(nodeId int, eventChannel chan interface{})
- func (rs *Services) SetIncludeIncomplete(nodeId int, includeIncomplete bool)
- func (rs *Services) SetStreamStatus(nodeId int, stream SubscriptionStream, status Status, ...)
- type Status
- type SubscriptionStream
- type TransactionEvent
Constants ¶
const ( LndService = ServiceType(iota) VectorService AmbossService TorqService )
const ( Boot = ServiceCommand(iota) // Kill requires Out return channel // status: Active => Service kill initiated // status: Pending => Service is booting and cannot be killed // status: Inactive => Service was not running and could not be killed Kill )
const ( Inactive = Status(iota) Active Pending Deleted Initializing )
const ( LND = Implementation(iota) CLN )
const ( Bitcoin = Chain(iota) Litecoin )
const ( MainNet = Network(iota) SigNet SimNet RegTest TestNet )
const ( Opening = ChannelStatus(iota) Open Closing CooperativeClosed = 100 LocalForceClosed = 101 RemoteForceClosed = 102 BreachClosed = 103 FundingCancelledClosed = 104 AbandonedClosed = 105 )
const ( TransactionStream = SubscriptionStream(iota) HtlcEventStream ChannelEventStream GraphEventStream ForwardStream InvoiceStream PaymentStream InFlightPaymentStream PeerEventStream ChannelBalanceCacheStream )
const ( ImportChannelAndRoutingPolicies = ImportType(iota) ImportNodeInformation )
const AMBOSS_SLEEP_SECONDS = 25
const AVOID_CHANNEL_AND_POLICY_IMPORT_RERUN_TIME_SECONDS = 70
70 because a reconnection is attempted every 60 seconds
const BOOTSTRAPPING_TIME_MINUTES = 8 * 60
const CHANNELBALANCE_BOOTSTRAP_TICKER_SECONDS = 10
const CHANNELBALANCE_TICKER_SECONDS = 150
const GENERIC_BOOTSTRAPPING_TIME_SECONDS = 60
const INVOICE_BOOTSTRAPPING_TIME_SECONDS = 60
const NodeConnectionDetailCustomSettingsMax = int(ImportFailedPayments)*2 - 1
const PingSystemMax = int(Vector)*2 - 1
const SERVICES_ERROR_SLEEP_SECONDS = 60
const STREAM_BOOTED_CHECK_SECONDS = 5
const STREAM_ERROR_SLEEP_SECONDS = 60
const STREAM_FORWARDS_TICKER_SECONDS = 10
const STREAM_INFLIGHT_PAYMENTS_TICKER_SECONDS = 60
const STREAM_LND_INVOICES_DELTA_TIME_MILLISECONDS = 1000
const STREAM_LND_INVOICES_INTERVAL_SLEEP = 10
const STREAM_LND_INVOICES_SLEEP_MILLISECONDS = 1000
const STREAM_PAYMENTS_TICKER_SECONDS = 10
const TOLERATED_SUBSCRIPTION_DOWNTIME_SECONDS = 15
const TorqDummyNodeId = -1337
const VECTOR_SLEEP_SECONDS = 20
Variables ¶
var ManagedChannelChannel = make(chan ManagedChannel) //nolint:gochecknoglobals
var ManagedChannelGroupChannel = make(chan ManagedChannelGroup) //nolint:gochecknoglobals
var ManagedChannelStateChannel = make(chan ManagedChannelState) //nolint:gochecknoglobals
var ManagedNodeChannel = make(chan ManagedNode) //nolint:gochecknoglobals
var ManagedSettingsChannel = make(chan ManagedSettings) //nolint:gochecknoglobals
var RunningServices map[ServiceType]*Services //nolint:gochecknoglobals
var SubscriptionStreams = []SubscriptionStream{ TransactionStream, HtlcEventStream, ChannelEventStream, GraphEventStream, ForwardStream, InvoiceStream, PaymentStream, InFlightPaymentStream, PeerEventStream, ChannelBalanceCacheStream, }
Functions ¶
func ConvertLNDShortChannelID ¶ added in v0.14.0
func ConvertShortChannelIDToLND ¶ added in v0.14.0
func CreateChannelPoint ¶ added in v0.14.0
func GetActiveChannelIdByFundingTransaction ¶ added in v0.13.0
func GetActiveChannelIdByShortChannelId ¶ added in v0.13.0
func GetActiveNodeIdByPublicKey ¶ added in v0.13.0
func GetAllActiveTorqNodeIds ¶ added in v0.13.0
func GetAllChannelPublicKeys ¶
func GetAllTorqNodeIds ¶
func GetAllTorqPublicKeys ¶
func GetChannelIdByChannelPoint ¶ added in v0.14.0
func GetChannelIdByFundingTransaction ¶ added in v0.13.0
func GetChannelIdByLndShortChannelId ¶ added in v0.14.0
func GetChannelIdByShortChannelId ¶ added in v0.13.0
func GetChannelIdsByNodeId ¶ added in v0.14.0
func GetChannelNodeIds ¶
func GetChannelPublicKeys ¶
func GetNodeIdByPublicKey ¶ added in v0.13.0
func InactivateChannelNode ¶
func ManagedChannelCache ¶
func ManagedChannelCache(ch chan ManagedChannel, ctx context.Context)
func ManagedChannelGroupCache ¶ added in v0.12.0
func ManagedChannelGroupCache(ch chan ManagedChannelGroup, ctx context.Context)
func ManagedChannelStateCache ¶ added in v0.14.0
func ManagedChannelStateCache(ch chan ManagedChannelState, broadcaster broadcast.BroadcastServer, ctx context.Context)
ManagedChannelStateCache parameter Context is for test cases...
func ManagedNodeCache ¶
func ManagedNodeCache(ch chan ManagedNode, ctx context.Context)
ManagedNodeCache parameter Context is for test cases...
func ManagedSettingsCache ¶
func ManagedSettingsCache(ch chan ManagedSettings, ctx context.Context)
func MutexLocked ¶ added in v0.11.0
func ParseChannelPoint ¶ added in v0.14.0
func RWMutexReadLocked ¶ added in v0.13.0
func RWMutexWriteLocked ¶ added in v0.13.0
func SendToManagedChannelBalanceStateSettingsChannel ¶ added in v0.14.0
func SendToManagedChannelBalanceStateSettingsChannel(ch chan *ManagedChannelBalanceStateSettings, managedChannelBalanceStateSettings *ManagedChannelBalanceStateSettings)
func SendToManagedChannelBalanceStatesSettingsChannel ¶ added in v0.14.0
func SendToManagedChannelBalanceStatesSettingsChannel(ch chan []ManagedChannelBalanceStateSettings, managedChannelBalanceStateSettings []ManagedChannelBalanceStateSettings)
func SendToManagedChannelChannel ¶
func SendToManagedChannelChannel(ch chan ManagedChannel, managedChannel ManagedChannel)
func SendToManagedChannelGroupSettingsChannel ¶ added in v0.12.0
func SendToManagedChannelGroupSettingsChannel(ch chan *ManagedChannelGroupSettings, managedChannelGroupSettings *ManagedChannelGroupSettings)
func SendToManagedChannelIdsChannel ¶ added in v0.14.0
func SendToManagedChannelSettingChannel ¶ added in v0.13.0
func SendToManagedChannelSettingChannel(ch chan ManagedChannelSettings, channelSettings ManagedChannelSettings)
func SendToManagedChannelSettingsChannel ¶
func SendToManagedChannelSettingsChannel(ch chan []ManagedChannelSettings, channelSettings []ManagedChannelSettings)
func SendToManagedChannelStateSettingsChannel ¶ added in v0.14.0
func SendToManagedChannelStateSettingsChannel(ch chan *ManagedChannelStateSettings, managedChannelStateSettings *ManagedChannelStateSettings)
func SendToManagedChannelStatesSettingsChannel ¶ added in v0.14.0
func SendToManagedChannelStatesSettingsChannel(ch chan []ManagedChannelStateSettings, managedChannelBalanceStateSettings []ManagedChannelStateSettings)
func SendToManagedNodeChannel ¶
func SendToManagedNodeChannel(ch chan ManagedNode, managedNode ManagedNode)
func SendToManagedNodeSettingsChannel ¶
func SendToManagedNodeSettingsChannel(ch chan ManagedNodeSettings, nodeSettings ManagedNodeSettings)
func SendToManagedSettingsChannel ¶
func SendToManagedSettingsChannel(ch chan ManagedSettings, managedSettings ManagedSettings)
func SetChannel ¶
func SetChannelGroupsByChannelId ¶ added in v0.12.0
func SetChannelGroupsByChannelId(channelId int, channelGroups []ChannelGroup)
func SetChannelNode ¶
func SetChannelNode(nodeId int, publicKey string, chain Chain, network Network, status ChannelStatus)
func SetChannelStateBalanceHtlcEvent ¶ added in v0.14.0
func SetChannelStateBalanceHtlcEvent(htlcEvent HtlcEvent)
func SetChannelStateBalanceUpdate ¶ added in v0.14.0
func SetChannelStateBalanceUpdateMsat ¶ added in v0.14.0
func SetChannelStateChannelStatus ¶ added in v0.14.0
func SetChannelStateNodeStatus ¶ added in v0.14.0
func SetChannelStateRoutingPolicy ¶ added in v0.14.0
func SetChannelStates ¶ added in v0.14.0
func SetChannelStates(nodeId int, channelStateSettings []ManagedChannelStateSettings)
func SetChannelStatus ¶
func SetChannelStatus(channelId int, status ChannelStatus)
func SetInactiveChannelNode ¶
func SetSettings ¶
func SetSettings(defaultDateRange, defaultLanguage, weekStartsOn, preferredTimeZone string)
Types ¶
type BlockEvent ¶ added in v0.13.0
type ChannelBalanceStateHtlcInclude ¶ added in v0.14.0
type ChannelBalanceStateHtlcInclude uint
const ( PENDING_HTLCS_IGNORED ChannelBalanceStateHtlcInclude = iota // PENDING_HTLCS_LOCAL_BALANCE_ADJUSTED_DOWNWARDS: // LocalBalance = ConfirmedLocalBalance - PendingDecreasingForwardHTLCsAmount - PendingPaymentHTLCsAmount PENDING_HTLCS_LOCAL_BALANCE_ADJUSTED_DOWNWARDS // PENDING_HTLCS_REMOTE_BALANCE_ADJUSTED_DOWNWARDS: // RemoteBalance = ConfirmedRemoteBalance - PendingIncreasingForwardHTLCsAmount - PendingInvoiceHTLCsAmount PENDING_HTLCS_REMOTE_BALANCE_ADJUSTED_DOWNWARDS // PENDING_HTLCS_LOCAL_AND_REMOTE_BALANCE_ADJUSTED_DOWNWARDS: // LocalBalance = ConfirmedLocalBalance - PendingDecreasingForwardHTLCsAmount - PendingPaymentHTLCsAmount // RemoteBalance = ConfirmedRemoteBalance - PendingIncreasingForwardHTLCsAmount - PendingInvoiceHTLCsAmount PENDING_HTLCS_LOCAL_AND_REMOTE_BALANCE_ADJUSTED_DOWNWARDS // PENDING_HTLCS_LOCAL_BALANCE_ADJUSTED_UPWARDS: // LocalBalance = ConfirmedLocalBalance + PendingIncreasingForwardHTLCsAmount + PendingInvoiceHTLCsAmount PENDING_HTLCS_LOCAL_BALANCE_ADJUSTED_UPWARDS // RemoteBalance = ConfirmedRemoteBalance + PendingDecreasingForwardHTLCsAmount + PendingPaymentHTLCsAmount PENDING_HTLCS_REMOTE_BALANCE_ADJUSTED_UPWARDS // PENDING_HTLCS_LOCAL_AND_REMOTE_BALANCE_ADJUSTED_UPWARDS: // LocalBalance = ConfirmedLocalBalance + PendingIncreasingForwardHTLCsAmount + PendingInvoiceHTLCsAmount // RemoteBalance = ConfirmedRemoteBalance + PendingDecreasingForwardHTLCsAmount + PendingPaymentHTLCsAmount PENDING_HTLCS_LOCAL_AND_REMOTE_BALANCE_ADJUSTED_UPWARDS )
type ChannelEvent ¶ added in v0.13.0
type ChannelEvent struct { EventData Type lnrpc.ChannelEventUpdate_UpdateType `json:"type"` ChannelId int `json:"channelId"` }
type ChannelGraphEvent ¶ added in v0.13.0
type ChannelGraphEvent struct { GraphEventData ChannelGraphEventData PreviousEventTime time.Time `json:"previousEventTime"` PreviousEventData ChannelGraphEventData `json:"previous"` }
type ChannelGraphEventData ¶ added in v0.13.0
type ChannelGroup ¶ added in v0.12.0
type ChannelGroup struct { TagId *int `json:"tagId" db:"tag_id"` TagName *string `json:"tagName" db:"tag_name"` TagStyle *string `json:"tagStyle" db:"tag_style"` CategoryId *int `json:"categoryId" db:"category_id"` CategoryName *string `json:"categoryName" db:"category_name"` CategoryStyle *string `json:"categoryStyle" db:"category_style"` }
type ChannelGroupInclude ¶ added in v0.12.0
type ChannelGroupInclude uint
const ( CATEGORIES_ONLY ChannelGroupInclude = iota DISTINCT_REGULAR_AND_TAG_CATEGORIES ALL_REGULAR_AND_TAG_CATEGORIES TAGS_ONLY )
type ChannelStateInclude ¶ added in v0.14.0
type ChannelStateInclude uint
const ( ALL_LOCAL_ACTIVE_CHANNELS ChannelStateInclude = iota ALL_LOCAL_AND_REMOTE_ACTIVE_CHANNELS ALL_CHANNELS )
type ChannelStatus ¶
type ChannelStatus int
func GetChannelStatusByChannelId ¶ added in v0.13.0
func GetChannelStatusByChannelId(channelId int) ChannelStatus
type ForwardEvent ¶ added in v0.13.0
type GraphEventData ¶ added in v0.13.0
type Htlc ¶ added in v0.14.0
type Htlc struct { Incoming bool Amount int64 HashLock []byte ExpirationHeight uint32 // Index identifying the htlc on the channel. HtlcIndex uint64 // If this HTLC is involved in a forwarding operation, this field indicates // the forwarding channel. For an outgoing htlc, it is the incoming channel. // For an incoming htlc, it is the outgoing channel. When the htlc // originates from this node or this node is the final destination, // forwarding_channel will be zero. The forwarding channel will also be zero // for htlcs that need to be forwarded but don't have a forwarding decision // persisted yet. ForwardingChannel uint64 // Index identifying the htlc on the forwarding channel. ForwardingHtlcIndex uint64 }
type HtlcEvent ¶ added in v0.13.0
type HtlcEvent struct { EventData Timestamp time.Time `json:"timestamp"` Data string `json:"data"` EventOrigin *string `json:"eventOrigin"` EventType *string `json:"eventType"` OutgoingHtlcId *uint64 `json:"outgoingHtlcId"` IncomingHtlcId *uint64 `json:"incomingHtlcId"` TimestampNs *uint64 `json:"timestampNs"` IncomingAmtMsat *uint64 `json:"incomingAmtMsat"` OutgoingAmtMsat *uint64 `json:"outgoingAmtMsat"` IncomingTimelock *uint32 `json:"incomingTimelock"` OutgoingTimelock *uint32 `json:"outgoingTimelock"` BoltFailureCode *string `json:"boltFailureCode"` BoltFailureString *string `json:"boltFailureString"` LndFailureDetail *string `json:"lndFailureDetail"` OutgoingChannelId *int `json:"outgoingChannelId"` IncomingChannelId *int `json:"incomingChannelId"` }
type Implementation ¶
type Implementation int
type ImportRequest ¶ added in v0.13.0
type ImportRequest struct { ImportType ImportType Out chan error }
type ImportType ¶ added in v0.13.0
type ImportType int
type InvoiceEvent ¶ added in v0.13.0
type ManagedChannel ¶
type ManagedChannel struct { Type ManagedChannelCacheOperationType ChannelId int ShortChannelId string LndShortChannelId uint64 FundingTransactionHash string FundingOutputIndex int Capacity int64 NodeId int FirstNodeId int SecondNodeId int InitiatingNodeId *int AcceptingNodeId *int Private bool Status ChannelStatus Out chan ManagedChannel ChannelSettingOut chan ManagedChannelSettings ChannelSettingsOut chan []ManagedChannelSettings ChannelIdsOut chan []int }
type ManagedChannelBalanceStateSettings ¶ added in v0.14.0
type ManagedChannelBalanceStateSettings struct { NodeId int `json:"nodeId"` RemoteNodeId int `json:"remoteNodeId"` ChannelId int `json:"channelId"` HtlcInclude ChannelBalanceStateHtlcInclude `json:"htlcInclude"` LocalBalance int64 `json:"localBalance"` LocalBalancePerMilleRatio int `json:"localBalancePerMilleRatio"` RemoteBalance int64 `json:"remoteBalance"` RemoteBalancePerMilleRatio int `json:"remoteBalancePerMilleRatio"` }
func GetChannelBalanceState ¶ added in v0.14.0
func GetChannelBalanceState(nodeId, channelId int, htlcInclude ChannelBalanceStateHtlcInclude) *ManagedChannelBalanceStateSettings
func GetChannelBalanceStates ¶ added in v0.14.0
func GetChannelBalanceStates(nodeId int, channelStateInclude ChannelStateInclude, htlcInclude ChannelBalanceStateHtlcInclude) []ManagedChannelBalanceStateSettings
type ManagedChannelCacheOperationType ¶
type ManagedChannelCacheOperationType uint
const ( // READ_ACTIVE_CHANNELID_BY_SHORTCHANNELID please provide ShortChannelId and Out READ_ACTIVE_CHANNELID_BY_SHORTCHANNELID ManagedChannelCacheOperationType = iota // READ_CHANNELID_BY_SHORTCHANNELID please provide ShortChannelId and Out READ_CHANNELID_BY_SHORTCHANNELID // READ_ACTIVE_CHANNELID_BY_FUNDING_TRANSACTION please provide FundingTransactionHash, FundingOutputIndex and Out READ_ACTIVE_CHANNELID_BY_FUNDING_TRANSACTION // READ_CHANNELID_BY_FUNDING_TRANSACTION please provide FundingTransactionHash, FundingOutputIndex and Out READ_CHANNELID_BY_FUNDING_TRANSACTION // READ_CHANNELIDS_BY_NODE_ID please provide NodeId and ChannelIdsOut READ_CHANNELIDS_BY_NODE_ID // READ_STATUSID_BY_CHANNELID please provide ChannelId and Out READ_STATUSID_BY_CHANNELID // READ_CHANNEL_SETTINGS please provide ChannelId and ChannelSettingOut READ_CHANNEL_SETTINGS // READ_ALL_CHANNEL_SETTINGS please provide FirstNodeId and ChannelSettingsOut READ_ALL_CHANNEL_SETTINGS // WRITE_CHANNEL Please provide ChannelId, FundingTransactionHash, FundingOutputIndex and Status (other values are optional in case of pending open channel) WRITE_CHANNEL // WRITE_CHANNELSTATUSID Please provide ChannelId and Status WRITE_CHANNELSTATUSID )
type ManagedChannelGroup ¶ added in v0.12.0
type ManagedChannelGroup struct { Type ManagedChannelGroupCacheOperationType ChannelId int Include ChannelGroupInclude ChannelGroups []ChannelGroup Out chan *ManagedChannelGroupSettings }
type ManagedChannelGroupCacheOperationType ¶ added in v0.12.0
type ManagedChannelGroupCacheOperationType uint
const ( // READ_CHANNELGROUPS please provide ChannelId and Out READ_CHANNELGROUPS ManagedChannelGroupCacheOperationType = iota // WRITE_CHANNELGROUPS Please provide ChannelId, ChannelGroups WRITE_CHANNELGROUPS )
type ManagedChannelGroupSettings ¶ added in v0.12.0
type ManagedChannelGroupSettings struct { ChannelId int ChannelGroups []ChannelGroup }
func GetChannelGroupsByChannelId ¶ added in v0.12.0
func GetChannelGroupsByChannelId(channelId int, include ChannelGroupInclude) *ManagedChannelGroupSettings
type ManagedChannelSettings ¶
type ManagedChannelSettings struct { ChannelId int ShortChannelId string LndShortChannelId uint64 FundingTransactionHash string FundingOutputIndex int Capacity int64 FirstNodeId int SecondNodeId int InitiatingNodeId *int AcceptingNodeId *int Private bool Status ChannelStatus }
func GetChannelSettingByChannelId ¶ added in v0.13.0
func GetChannelSettingByChannelId(channelId int) ManagedChannelSettings
func GetChannelSettingsByNodeId ¶ added in v0.13.0
func GetChannelSettingsByNodeId(nodeId int) []ManagedChannelSettings
type ManagedChannelState ¶ added in v0.14.0
type ManagedChannelState struct { Type ManagedChannelStateCacheOperationType NodeId int RemoteNodeId int ChannelId int Status Status Local bool Balance int64 Disabled bool FeeBaseMsat uint64 FeeRateMilliMsat uint64 MinHtlc int64 MaxHtlcMsat uint64 TimeLockDelta uint32 Amount int64 ForceResponse bool HtlcEvent HtlcEvent ChannelStateSettings []ManagedChannelStateSettings HtlcInclude ChannelBalanceStateHtlcInclude StateInclude ChannelStateInclude StateOut chan *ManagedChannelStateSettings StatesOut chan []ManagedChannelStateSettings BalanceStateOut chan *ManagedChannelBalanceStateSettings BalanceStatesOut chan []ManagedChannelBalanceStateSettings }
type ManagedChannelStateCacheOperationType ¶ added in v0.14.0
type ManagedChannelStateCacheOperationType uint
const ( // READ_CHANNELSTATE please provide NodeId, ChannelId and StateOut READ_CHANNELSTATE ManagedChannelStateCacheOperationType = iota // READ_ALL_CHANNELSTATES please provide NodeId and StatesOut READ_ALL_CHANNELSTATES // READ_CHANNELBALANCESTATE please provide NodeId, ChannelId, HtlcInclude and BalanceStateOut READ_CHANNELBALANCESTATE // READ_ALL_CHANNELBALANCESTATES please provide NodeId, StateInclude, HtlcInclude and BalanceStatesOut READ_ALL_CHANNELBALANCESTATES // WRITE_INITIAL_CHANNELSTATES This requires the lock being active for writing! Please provide the complete information set WRITE_INITIAL_CHANNELSTATES WRITE_CHANNELSTATE_NODESTATUS WRITE_CHANNELSTATE_CHANNELSTATUS WRITE_CHANNELSTATE_ROUTINGPOLICY WRITE_CHANNELSTATE_UPDATEBALANCE WRITE_CHANNELSTATE_UPDATEHTLCEVENT )
type ManagedChannelStateSettings ¶ added in v0.14.0
type ManagedChannelStateSettings struct { NodeId int `json:"nodeId"` RemoteNodeId int `json:"remoteNodeId"` ChannelId int `json:"channelId"` LocalBalance int64 `json:"localBalance"` LocalDisabled bool `json:"localDisabled"` LocalFeeBaseMsat uint64 `json:"localFeeBaseMsat"` LocalFeeRateMilliMsat uint64 `json:"localFeeRateMilliMsat"` LocalMinHtlc int64 `json:"localMinHtlc"` LocalMaxHtlcMsat uint64 `json:"localMaxHtlcMsat"` LocalTimeLockDelta uint32 `json:"localTimeLockDelta"` RemoteBalance int64 `json:"remoteBalance"` RemoteDisabled bool `json:"remoteDisabled"` RemoteFeeBaseMsat uint64 `json:"remoteFeeBaseMsat"` RemoteFeeRateMilliMsat uint64 `json:"remoteFeeRateMilliMsat"` RemoteMinHtlc int64 `json:"remoteMinHtlc"` RemoteMaxHtlcMsat uint64 `json:"remoteMaxHtlcMsat"` RemoteTimeLockDelta uint32 `json:"remoteTimeLockDelta"` UnsettledBalance int64 `json:"unsettledBalance"` PendingHtlcs []Htlc `json:"pendingHtlcs"` // INCREASING LOCAL BALANCE HTLCs PendingIncomingHtlcCount int `json:"pendingIncomingHtlcCount"` PendingIncomingHtlcAmount int64 `json:"pendingIncomingHtlcAmount"` // DECREASING LOCAL BALANCE HTLCs PendingOutgoingHtlcCount int `json:"pendingOutgoingHtlcCount"` PendingOutgoingHtlcAmount int64 `json:"pendingOutgoingHtlcAmount"` // STALE INFORMATION ONLY OBTAINED VIA LND REGULAR CHECKINS SO NOT MAINTAINED CommitFee int64 `json:"commitFee"` CommitWeight int64 `json:"commitWeight"` FeePerKw int64 `json:"feePerKw"` NumUpdates uint64 `json:"numUpdates"` ChanStatusFlags string `json:"chanStatusFlags"` CommitmentType lnrpc.CommitmentType `json:"commitmentType"` Lifetime int64 `json:"lifetime"` TotalSatoshisReceived int64 `json:"totalSatoshisReceived"` TotalSatoshisSent int64 `json:"totalSatoshisSent"` }
func GetChannelState ¶ added in v0.14.0
func GetChannelState(nodeId, channelId int) *ManagedChannelStateSettings
func GetChannelStates ¶ added in v0.14.0
func GetChannelStates(nodeId int, forceResponse bool) []ManagedChannelStateSettings
type ManagedNode ¶
type ManagedNode struct { Type ManagedNodeCacheOperationType NodeId int Chain *Chain Network *Network PublicKey string Name *string Out chan ManagedNode NodeIdsOut chan []int NodeIdSettingsOut chan ManagedNodeSettings PublicKeysOut chan []string }
type ManagedNodeCacheOperationType ¶
type ManagedNodeCacheOperationType uint
const ( READ_ALL_TORQ_NODE ManagedNodeCacheOperationType = iota WRITE_INACTIVE_TORQ_NODE READ_ALL_TORQ_NODEIDS READ_ALL_TORQ_PUBLICKEYS READ_ACTIVE_TORQ_NODE WRITE_ACTIVE_TORQ_NODE READ_ACTIVE_TORQ_NODEIDS READ_ACTIVE_TORQ_PUBLICKEYS READ_ALL_ACTIVE_TORQ_NODEIDS READ_ACTIVE_CHANNEL_NODE READ_CHANNEL_NODE WRITE_ACTIVE_CHANNEL_NODE WRITE_INACTIVE_CHANNEL_NODE INACTIVATE_CHANNEL_NODE READ_ALL_CHANNEL_NODEIDS READ_ALL_CHANNEL_PUBLICKEYS READ_NODE_SETTINGS )
type ManagedNodeSettings ¶
type ManagedNodeSettings struct { NodeId int Chain Chain Network Network PublicKey string Name *string Status Status }
func GetNodeSettingsByNodeId ¶
func GetNodeSettingsByNodeId(nodeId int) ManagedNodeSettings
type ManagedSettings ¶
type ManagedSettings struct { Type ManagedSettingsCacheOperationType DefaultLanguage string PreferredTimeZone string DefaultDateRange string WeekStartsOn string Out chan ManagedSettings }
func GetSettings ¶
func GetSettings() ManagedSettings
type ManagedSettingsCacheOperationType ¶
type ManagedSettingsCacheOperationType uint
const ( // READ_SETTINGS please provide Out READ_SETTINGS ManagedSettingsCacheOperationType = iota // WRITE_SETTINGS please provide defaultLanguage, preferredTimeZone, defaultDateRange and weekStartsOn WRITE_SETTINGS )
type Network ¶
type Network int
func GetNetwork ¶
GetNetwork defaults to MainNet when no match is found
type NodeConnectionDetailCustomSettings ¶ added in v0.13.0
type NodeConnectionDetailCustomSettings byte
const (
ImportFailedPayments NodeConnectionDetailCustomSettings = 1 << iota
)
type NodeGraphEvent ¶ added in v0.13.0
type NodeGraphEvent struct { GraphEventData NodeGraphEventData PreviousEventTime time.Time `json:"previousEventTime"` PreviousEventData NodeGraphEventData `json:"previous"` }
type NodeGraphEventData ¶ added in v0.13.0
type PaymentEvent ¶ added in v0.14.0
type PaymentEvent struct { EventData AmountPaid int64 `json:"amountPaid"` FeeMsat uint64 `json:"feeMsat"` PaymentStatus lnrpc.Payment_PaymentStatus `json:"paymentStatus"` PaymentFailureReason lnrpc.PaymentFailureReason `json:"paymentFailureReason"` OutgoingChannelId *int `json:"outgoingChannelId"` RebalanceAmountMsat *uint64 `json:"rebalanceAmount"` IncomingChannelId *int `json:"incomingChannelId"` }
type PeerEvent ¶ added in v0.13.0
type PeerEvent struct { EventData Type lnrpc.PeerEvent_EventType `json:"type"` EventNodeId int `json:"eventNodeId"` }
type PingSystem ¶ added in v0.11.0
type PingSystem byte
const ( Amboss PingSystem = 1 << iota Vector )
type ServiceChannelMessage ¶ added in v0.11.0
type ServiceChannelMessage = struct { ServiceType ServiceType ServiceCommand ServiceCommand NodeId int // EnforcedServiceStatus is a one time status enforcement for a service EnforcedServiceStatus *Status // NoDelay is a one time no delay enforcement for a service NoDelay bool Out chan Status }
type ServiceCommand ¶ added in v0.11.0
type ServiceCommand int
type ServiceEvent ¶ added in v0.13.0
type ServiceEvent struct { EventData Type ServiceType SubscriptionStream *SubscriptionStream Status Status PreviousStatus Status }
type ServiceType ¶ added in v0.11.0
type ServiceType int
type Services ¶ added in v0.13.0
type Services struct { ServiceType ServiceType // contains filtered or unexported fields }
func (*Services) AddSubscription ¶ added in v0.13.0
func (*Services) GetActiveNodeIds ¶ added in v0.13.0
func (*Services) GetBootLock ¶ added in v0.13.0
func (*Services) GetBootTime ¶ added in v0.13.0
GetBootTime When the service is active it will return it's boot time
func (*Services) GetChannelBalanceCacheStreamStatus ¶ added in v0.13.0
func (*Services) GetEnforcedServiceStatusCheck ¶ added in v0.13.0
func (*Services) GetIncludeIncomplete ¶ added in v0.13.0
func (*Services) GetNodeIds ¶ added in v0.13.0
func (*Services) GetStatus ¶ added in v0.13.0
GetStatus return the status of the Service but in case of ServiceType = LndSubscription then streamStatuses are also verified. If one of the streamStatuses is not active then this function return Pending
func (*Services) GetStreamBootTime ¶ added in v0.13.0
func (rs *Services) GetStreamBootTime(nodeId int, stream SubscriptionStream) *time.Time
GetStreamBootTime when the status of the LND Service is active and streamStatus is active then bootTime will have a value
func (*Services) GetStreamInitializationPingTime ¶ added in v0.13.0
func (rs *Services) GetStreamInitializationPingTime(nodeId int, stream SubscriptionStream) *time.Time
func (*Services) GetStreamStatus ¶ added in v0.13.0
func (rs *Services) GetStreamStatus(nodeId int, stream SubscriptionStream) Status
GetStreamStatus when the status of the LND Service is active then streamStatus will be returned.
func (*Services) Initialising ¶ added in v0.14.0
func (*Services) RemoveSubscription ¶ added in v0.13.0
func (*Services) SetIncludeIncomplete ¶ added in v0.13.0
func (*Services) SetStreamStatus ¶ added in v0.13.0
func (rs *Services) SetStreamStatus(nodeId int, stream SubscriptionStream, status Status, eventChannel chan interface{})
type SubscriptionStream ¶ added in v0.13.0
type SubscriptionStream int
func (*SubscriptionStream) IsChannelBalanceCache ¶ added in v0.13.0
func (ss *SubscriptionStream) IsChannelBalanceCache() bool
type TransactionEvent ¶ added in v0.13.0
type TransactionEvent struct { EventData Timestamp time.Time `json:"timestamp"` TransactionHash *string `json:"transactionHash"` Amount *int64 `json:"amount"` NumberOfConfirmations *int32 `json:"numberOfConfirmations"` BlockHash *string `json:"blockHash"` BlockHeight *int32 `json:"blockHeight"` TotalFees *int64 `json:"totalFees"` DestinationAddresses *[]string `json:"destinationAddresses"` RawTransactionHex *string `json:"rawTransactionHex"` Label *string `json:"label"` }