Documentation
¶
Index ¶
- func ManagementProtocols() map[string][]string
- type LookupAttempt
- type ManagementCapabilities
- type MigrationManifest
- type Node
- type NodeEndpoint
- type NodeOptions
- type NodePatch
- type NodeRegistry
- func (r *NodeRegistry) Add(ctx context.Context, options NodeOptions) (Node, error)
- func (r *NodeRegistry) Delete(ctx context.Context, id int64) error
- func (r *NodeRegistry) Handler(consumers map[string]string, token string) (http.Handler, error)
- func (r *NodeRegistry) List(ctx context.Context, network string) ([]Node, error)
- func (r *NodeRegistry) Run(ctx context.Context, n chains.Network)
- func (r *NodeRegistry) RunChainList(ctx context.Context)
- func (r *NodeRegistry) Test(ctx context.Context, id int64) (Node, error)
- type Route
- type RouteInventory
- type SourcePool
- func (p *SourcePool) AdvanceLive(ctx context.Context, spans []chains.Span, finish chains.FinishRange) (bool, error)
- func (p *SourcePool) Close()
- func (p *SourcePool) Head(ctx context.Context) (int64, error)
- func (p *SourcePool) LiveWindow(ctx, period context.Context, interval time.Duration) (int64, []int64, int, error)
- func (p *SourcePool) Read(ctx context.Context, next, head int64) (int64, []chains.Activity, error)
- func (p *SourcePool) Scan(ctx context.Context, next, head int64, ...) error
- func (p *SourcePool) ScanPending(ctx context.Context, spans []chains.Span, ...) error
- func (p *SourcePool) ScanWindow() int
- func (p *SourcePool) SetNodes(configs []chains.Network) error
- func (p *SourcePool) Wakeups() <-chan struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ManagementProtocols ¶
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 (m MigrationManifest) Key(e NodeEndpoint) 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 NodeRegistry ¶
type NodeRegistry struct {
// contains filtered or unexported fields
}
func NewNodeRegistry ¶
func (*NodeRegistry) Add ¶
func (r *NodeRegistry) Add(ctx context.Context, options NodeOptions) (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.
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 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) 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) 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{}