services

package
v0.35.5 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 24 Imported by: 3

Documentation

Index

Constants

View Source
const DefaultHealthcheckInterval = 120 * time.Second

DefaultHealthcheckInterval is how often a node re-announces its heartbeat to the ledger. It is the number the `--aliveness-healthcheck-interval` flag defaults to, and the one node.DefaultOwnershipTTL is derived from: ownership decides liveness purely from heartbeat age, so the two cannot be tuned independently. See node.OwnershipTTLFor.

Variables

This section is empty.

Functions

func Alive added in v0.7.2

func Alive(announcetime, scrubTime, maxtime time.Duration) []node.Option

Alive announce the node every announce time, with a periodic scrub time for healthchecks the maxtime is the time used to determine when a node is unreachable (after maxtime, its unreachable)

func AliveNetworkService added in v0.8.6

func AliveNetworkService(announcetime, scrubTime, maxtime time.Duration) node.NetworkService

func AnnounceDNSRecord added in v0.8.4

func AnnounceDNSRecord(ctx context.Context, b *blockchain.Ledger, announcetime time.Duration, regex string, record types.DNS)

AnnounceDNSRecord is syntatic sugar around the ledger Announces a DNS record binding to the blockchain, and keeps announcing for the ctx lifecycle

func AvailableNodes added in v0.7.2

func AvailableNodes(b *blockchain.Ledger, maxTime time.Duration) (active []string)

AvailableNodes returns the available nodes which sent a healthcheck in the last maxTime

func ConnectNetworkService added in v0.9.2

func ConnectNetworkService(announcetime time.Duration, serviceID string, srcaddr string) node.NetworkService

ConnectNetworkService returns a network service that binds to a service

func DNS added in v0.8.4

func DNS(ll log.StandardLogger, listenAddr string, forwarder bool, forward []string, cacheSize int) []node.Option

DNS returns a network service binding a dns blockchain resolver on listenAddr. Takes an associated name for the addresses in the blockchain

func DNSNetworkService added in v0.8.6

func DNSNetworkService(ll log.StandardLogger, listenAddr string, forwarder bool, forward []string, cacheSize int) node.NetworkService

func Egress added in v0.9.2

func Egress(announceTime time.Duration) []node.Option

func EgressService added in v0.9.2

func EgressService(announceTime time.Duration) node.NetworkService

func ExposeNetworkService added in v0.8.6

func ExposeNetworkService(announcetime time.Duration, serviceID string) node.NetworkService

func PersistDNSRecord added in v0.8.4

func PersistDNSRecord(ctx context.Context, b *blockchain.Ledger, announcetime, timeout time.Duration, regex string, record types.DNS)

PersistDNSRecord is syntatic sugar around the ledger It persists a DNS record to the blockchain until it sees it reconciled. It automatically stop announcing and it is not *guaranteed* to persist data.

func Proxy added in v0.9.2

func Proxy(announceTime, deadtime time.Duration, listenAddr string) []node.Option

func ProxyService added in v0.9.2

func ProxyService(announceTime time.Duration, listenAddr string, deadtime time.Duration) node.NetworkService

ProxyService starts a local http proxy server which redirects requests to egresses into the network It takes a deadtime to consider hosts which are alive within a time window

func QueryDNS added in v0.8.4

func QueryDNS(ctx context.Context, msg *dns.Msg, dnsServer string) (*dns.Msg, error)

QueryDNS queries a dns server with a dns message and return the answer it is blocking.

func ReceiveFile

func ReceiveFile(ctx context.Context, ledger *blockchain.Ledger, n *node.Node, l log.StandardLogger, announcetime time.Duration, fileID string, path string) error

func RegisterService added in v0.7.2

func RegisterService(ll log.StandardLogger, announcetime time.Duration, serviceID, dstaddress string) []node.Option

ExposeService exposes a service to the p2p network. meant to be called before a node is started with Start()

func ShareFile

func ShareFile(ll log.StandardLogger, announcetime time.Duration, fileID, filepath string) ([]node.Option, error)

ShareFile shares a file to the p2p network. meant to be called before a node is started with Start()

func SharefileNetworkService added in v0.8.6

func SharefileNetworkService(announcetime time.Duration, fileID string) node.NetworkService

Types

This section is empty.

Jump to

Keyboard shortcuts

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