entities

package
v0.0.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelBalance

type ChannelBalance struct {
	// Active - is channel active
	Active bool `json:"active"`
	// Private - is channel private
	Private bool `json:"private"`
	// Deprecated - ActivePrevious is whether channel was Active in previous run
	ActivePrevious bool `json:"active_previous"`

	// LocalPubkey is the local node pubkey
	LocalPubkey string `json:"local_pubkey"`
	// RemotePubkey is the remote node pubkey
	RemotePubkey string `json:"remote_pubkey"`
	// ChanID - short channel id
	ChanID uint64 `json:"chan_id"`
	// Capacity - capacity of channel in satoshis
	Capacity uint64 `json:"capacity"`

	// RemoteNominator - is the remote side nominator
	RemoteNominator uint64 `json:"remote_nominator"`
	// LocalNominator - is the local side nominator
	LocalNominator uint64 `json:"local_nominator"`
	// Denominator - is the denominator (with high entropy allowed this is more or less channnel capacity)
	Denominator uint64 `json:"denominator"`

	// Deprecated - RemoteNominatorDiff is the difference of RemoteNominator between now and previous run
	RemoteNominatorDiff int64 `json:"remote_nominator_diff"`
	// Deprecated - LocalNominatorDiff is the difference of LocalNominator between now and previous run
	LocalNominatorDiff int64 `json:"local_nominator_diff"`
	// Deprecated - DenominatorDiff is the difference of Denominator between now and previous run
	DenominatorDiff int64 `json:"denominator_diff"`

	// ActiveRemote - does other node specify channel as active
	ActiveRemote bool `json:"active_remote"`
	// Deprecated - ActiveRemotePrevious - ActiveRemote from previous run
	ActiveRemotePrevious bool `json:"active_remote_previous"`
	// ActiveLocal - does current node specify channel as active
	ActiveLocal bool `json:"active_local"`
	// Deprecated - ActiveLocalPrevious - ActiveLocal from previous run
	ActiveLocalPrevious bool `json:"active_local_previous"`
}

ChannelBalance struct

type ClosedChannel

type ClosedChannel struct {
	ChannelID uint64 `json:"channel_id"`
}

ClosedChannel struct

type InfoCallback added in v0.0.5

type InfoCallback func(ctx context.Context, report *InfoReport) bool

InfoCallback represents the info callback

type InfoReport added in v0.0.5

type InfoReport struct {
	UniqueID  string            `json:"uniqueId,omitempty"` // optional unique identifier
	Timestamp entities.JsonTime `json:"timestamp"`

	api.NodeInfoAPIExtended
}

InfoReport struct

type Interval

type Interval int

Interval represents the enum of possible intervals

const (
	// ManualRequest means just do it once
	ManualRequest Interval = iota
	// Second means once per second (useful just for testing)
	Second
	// TenSeconds means once every ten seconds
	TenSeconds
	// Minute means once every minute
	Minute
	// TenMinutes means once every ten minutes
	TenMinutes
	// Hour means once every hour
	Hour
)

func (Interval) Duration

func (i Interval) Duration() time.Duration

Duration converts the interval to a duration

func (*Interval) MarshalJSON

func (i *Interval) MarshalJSON() ([]byte, error)

MarshalJSON is used for JSON serialiazation of interval

func (*Interval) UnmarshalJSON

func (i *Interval) UnmarshalJSON(s []byte) (err error)

UnmarshalJSON is used for JSON deserialiazation of interval

type NewAPICall added in v0.0.41

type NewAPICall func() api.LightingAPICalls

NewAPICall is the signature of the function to get Lightning API

type NodeDataReport added in v0.0.41

type NodeDataReport struct {
	ReportingSettings
	// Chain - should be bitcoin (bitcoin, litecoin)
	Chain string `json:"chain"`
	// Network - should be mainnet (regtest, testnet, mainnet)
	Network string `json:"network"`
	// Pubkey - node pubkey
	PubKey string `json:"pubkey"`
	// UniqueID is the optional unique identifier
	UniqueID string `json:"uniqueId,omitempty"`
	// Timestamp - timestamp of report
	Timestamp entities.JsonTime `json:"timestamp"`
	// ChangedChannels - contains all channels were balance has changed
	ChangedChannels []ChannelBalance `json:"changed_channels"`
	// ClosedChannels - contains all channels that were determined to be closed
	ClosedChannels []ClosedChannel `json:"closed_channels"`
	// Node Details
	NodeDetails *NodeDetails `json:"node_details,omitempty"`
}

NodeDataReport struct

type NodeDataReportCallback added in v0.0.41

type NodeDataReportCallback func(ctx context.Context, report *NodeDataReport) bool

NodeDataReportCallback represents the nodedata callback

type NodeDetails added in v0.0.41

type NodeDetails struct {
	NodeVersion     string `json:"node_version"`
	IsSyncedToChain bool   `json:"is_synced_to_chain"`
	IsSyncedToGraph bool   `json:"is_synced_to_graph"`

	api.NodeInfoAPIExtended
}

NodeDetails struct

type NodeIdentifier

type NodeIdentifier struct {
	Identifier string `json:"identifier"`
	UniqueID   string `json:"unique_id"`
}

NodeIdentifier represents the pubkey and optional unique identifier

func (*NodeIdentifier) GetID added in v0.0.41

func (n *NodeIdentifier) GetID() string

GetID obtains the string representation of the node identifier

type ReentrancyBlock added in v0.0.17

type ReentrancyBlock struct {
	// contains filtered or unexported fields
}

ReentrancyBlock is used to block reentrancy based on string ID

func NewReentrancyBlock added in v0.0.17

func NewReentrancyBlock() *ReentrancyBlock

NewReentrancyBlock constructs a new ReentrancyBlock

func (*ReentrancyBlock) Enter added in v0.0.17

func (r *ReentrancyBlock) Enter(id string) bool

Enter is the acquire lock method (opposite of Release)

func (*ReentrancyBlock) Release added in v0.0.17

func (r *ReentrancyBlock) Release(id string)

Release is the drop lock method (opposite of Enter)

type ReportingSettings

type ReportingSettings struct {
	// GraphPollInterval - intervl for graph polling
	GraphPollInterval time.Duration `json:"-"`
	// NoopInterval - send keepalive also when no changes happened
	NoopInterval time.Duration `json:"-"`
	// Filter is used to filter specific channels
	Filter filter.FilteringInterface `json:"-"`
	// PollInterval - defines how often the polling happens
	PollInterval Interval `json:"poll_interval"`
	// AllowedEntropy - is user specified entropy that can be reported
	AllowedEntropy int `json:"allowed_entropy"` // 64 bits is the default
	// AllowPrivateChannels - whether private channels were allowed (fitering will set this to true too)
	AllowPrivateChannels bool `json:"allow_private_channels"` // default is false
}

ReportingSettings struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL