nodes

package
v0.0.0-...-4427c07 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: AGPL-3.0 Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ManagementProtocols

func ManagementProtocols() map[string][]string

Types

type LookupAttempt

type LookupAttempt struct {
	NodeID    int64  `json:"node_id"`
	Fallback  bool   `json:"fallback,omitempty"`
	Reused    bool   `json:"reused,omitempty"`
	Head      *int64 `json:"head,omitempty"`
	Result    string `json:"result"`
	LatencyMS int64  `json:"latency_ms"`
}

LookupAttempt contains only non-secret fields for an authenticated consumer requesting a diagnostic trace. IDs refer to the scanner's node registry.

type ManagementCapabilities

type ManagementCapabilities struct {
	Protocols    map[string][]string `json:"protocols"`
	NodeSettings bool                `json:"node_settings"`
	Migration    bool                `json:"migration"`
}

ManagementCapabilities is the operation set advertised by this scanner.

type MigrationManifest

type MigrationManifest struct {
	StoreID string            `json:"store_id"`
	Entries map[string]string `json:"entries"`
}

Compare canonical endpoints and settings locally. The preview exchanges fingerprints, including for URLs containing project IDs, rather than keys.

func (MigrationManifest) Key

func (MigrationManifest) Settings

func (m MigrationManifest) Settings(role, purpose string, enabled bool, weight int, key string) string

type Node

type Node struct {
	ID int64 `json:"id"`
	NodeEndpoint
	Enabled bool   `json:"enabled"`
	Weight  int    `json:"weight"`
	Purpose string `json:"purpose"`
	Role    string `json:"role"`

	Origin      string `json:"origin"`
	Status      string `json:"status"`
	ReadFailure string `json:"read_failure,omitempty"`
	ReadRetryAt int64  `json:"read_retry_at_ms,omitempty"`
	Height      *int64 `json:"height"`
	CheckedAt   *int64 `json:"checked_at_ms"`
	Latency     *int64 `json:"latency_ms"`
	HeightUnit  string `json:"height_unit"`

	Scannable bool `json:"scannable"`
	// contains filtered or unexported fields
}

type NodeEndpoint

type NodeEndpoint struct {
	Network  string `json:"network"`
	Protocol string `json:"protocol"`
	URL      string `json:"url"`
}

NodeEndpoint identifies one provider interface on one ledger.

func (NodeEndpoint) Identity

func (e NodeEndpoint) Identity() NodeEndpoint

Identity preserves credential-bearing paths and queries while matching equivalent transports.

type NodeOptions

type NodeOptions struct {
	NodeEndpoint
	Enabled       *bool  `json:"enabled,omitempty"`
	Weight        int    `json:"weight,omitempty"`
	Purpose       string `json:"purpose,omitempty"`
	APIKey        string `json:"api_key,omitempty"`
	HistoryURL    string `json:"history_url,omitempty"`
	HistoryAPIKey string `json:"history_api_key,omitempty"`
}

NodeOptions accepts the same credentials and companion endpoint as a network configuration.

func (NodeOptions) ValidatedEndpoint

func (options NodeOptions) ValidatedEndpoint() (NodeEndpoint, error)

ValidatedEndpoint checks the primary and history transports, including height-only interfaces.

type NodePatch

type NodePatch struct {
	URL           *string `json:"url"`
	APIKey        *string `json:"api_key"`
	HistoryURL    *string `json:"history_url"`
	HistoryAPIKey *string `json:"history_api_key"`
	Enabled       *bool   `json:"enabled"`
	Purpose       *string `json:"purpose"`
	Weight        *int    `json:"weight"`
	Role          *string `json:"role"`
}

type NodeRegistry

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

func NewNodeRegistry

func NewNodeRegistry(ctx context.Context, s *engine.Store, networks []chains.Network, blockedDomains ...string) (*NodeRegistry, error)

func (*NodeRegistry) Add

func (r *NodeRegistry) Add(ctx context.Context, options NodeOptions) (Node, error)

func (*NodeRegistry) Delete

func (r *NodeRegistry) Delete(ctx context.Context, id int64) error

func (*NodeRegistry) Handler

func (r *NodeRegistry) Handler(consumers map[string]string, token string) (http.Handler, error)

func (*NodeRegistry) List

func (r *NodeRegistry) List(ctx context.Context, network string) ([]Node, error)

func (*NodeRegistry) Run

func (r *NodeRegistry) Run(ctx context.Context, n chains.Network)

Run shares one cursor and one scheduler across subscribers to a network.

func (*NodeRegistry) RunChainList

func (r *NodeRegistry) RunChainList(ctx context.Context)

RunChainList refreshes the node inventory independently of the scan workers.

func (*NodeRegistry) Test

func (r *NodeRegistry) Test(ctx context.Context, id int64) (Node, error)

type Route

type Route struct {
	Node
	APIKey        string `json:"api_key,omitempty"`
	HistoryURL    string `json:"history_url,omitempty"`
	HistoryAPIKey string `json:"history_api_key,omitempty"`
}

Private inventory is available only to the service holding the administrator credential. EPUSDT deliberately excludes this path from its browser proxy.

type RouteInventory

type RouteInventory struct {
	StoreID string  `json:"store_id"`
	Nodes   []Route `json:"nodes"`
}

type SourcePool

type SourcePool struct {

	// Report receives completed provider attempts. Reports from a Read are serialized.
	Report func(chains.Network, bool)
	// contains filtered or unexported fields
}

SourcePool is owned by one scan loop. SetNodes, Head, Read and Close must be called serially. Independent nodes within a Read are used concurrently.

func NewSourcePool

func NewSourcePool(ctx context.Context, network string) *SourcePool

func (*SourcePool) AdvanceLive

func (p *SourcePool) AdvanceLive(ctx context.Context, spans []chains.Span, finish chains.FinishRange) (bool, error)

AdvanceLive returns after individual completions, leaving other leases running. A head probe occupies an idle history lane and competes with no active block read.

func (*SourcePool) Close

func (p *SourcePool) Close()

func (*SourcePool) Head

func (p *SourcePool) Head(ctx context.Context) (int64, error)

func (*SourcePool) LiveWindow

func (p *SourcePool) LiveWindow(ctx, period context.Context, interval time.Duration) (int64, []int64, int, error)

LiveWindow reports reservations still owned by this process. The store excludes them when selecting additional durable work, including on retries.

func (*SourcePool) Read

func (p *SourcePool) Read(ctx context.Context, next, head int64) (int64, []chains.Activity, error)

func (*SourcePool) Scan

func (p *SourcePool) Scan(ctx context.Context, next, head int64, emit func(int64, []chains.Activity) error) error

Scan dispatches more work after each completion. A slow gap can hold up delivery, but other endpoints keep fetching up to the reorder buffer limit. emit runs serially on complete, consecutive ranges while later RPCs run.

func (*SourcePool) ScanPending

func (p *SourcePool) ScanPending(ctx context.Context, spans []chains.Span, finish func(chains.Span, chains.BlockLink, []chains.Activity, error) error) error

ScanPending serves the store's sparse work list. The legacy Scan/Read API still returns contiguous data for callers that do not own a gap store.

func (*SourcePool) ScanWindow

func (p *SourcePool) ScanWindow() int

ScanWindow preserves the multi-node lookahead in units of durable work.

func (*SourcePool) SetNodes

func (p *SourcePool) SetNodes(configs []chains.Network) error

SetNodes retains connections and cooldowns across refreshes. Two transports using the same history URL share one read lane.

func (*SourcePool) Wakeups

func (p *SourcePool) Wakeups() <-chan struct{}

Jump to

Keyboard shortcuts

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