Documentation
¶
Overview ¶
Package node is a specification for the in-memory metadata related to an indra network peer.
This structure aggregates the address, identitky keys, relay rate, services and payments channel for the peer.
Index ¶
Constants ¶
View Source
const (
// PaymentChanBuffers is the default number of buffers used in a payment channel.
PaymentChanBuffers = 8
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
ID nonce.ID
sync.Mutex
AddrPort *netip.AddrPort
Identity *crypto.Keys
RelayRate uint32 // Base relay price mSAT/Mb.
Services services.Services // Services offered by this peer.
Load byte
payments.PayChan
Transport tpt.Transport
}
Node is a representation of a messaging counterparty.
func NewNode ¶
func NewNode(addr *netip.AddrPort, keys *crypto.Keys, tpt tpt.Transport, relayRate uint32) (n *Node, id nonce.ID)
NewNode creates a new Node. The transport should be from either dialing out or a peer dialing in and the self model does not need to do this.
func (*Node) AddService ¶
AddService adds a service to a Node.
func (*Node) DeleteService ¶
DeleteService removes a service from a Node.
func (*Node) FindService ¶
FindService searches for a local service with a given port number.
func (*Node) ReceiveFrom ¶
ReceiveFrom returns the channel that receives messages for a given port.
Click to show internal directories.
Click to hide internal directories.