Documentation
¶
Index ¶
- Variables
- func BitcoinRPCHeight(ctx context.Context, n Network) (int64, error)
- func Canonical(n, a string) (string, error)
- func ConnectTONPeer(ctx context.Context, pool *liteclient.ConnectionPool, raw string) error
- func EVMChainID(name string) int64
- func EVMNetworks() iter.Seq[string]
- func EndpointProtocol(n Network) (string, error)
- func IsEVM(name string) bool
- func LookupHead(ctx context.Context, n Network, public bool) (int64, error)
- func LookupTransaction(ctx context.Context, n Network, hash string, public bool) (json.RawMessage, error)
- func NativeAsset(name string) string
- func NeedsHistory(network, protocol string) bool
- func NodeHead(ctx context.Context, src Source, n Network) (int64, error)
- func ProbePublicRPC(ctx context.Context, n Network) (int64, error)
- func ProbePublicScan(ctx context.Context, n Network) (int64, error)
- func Protocols(network string) []string
- func ProviderKey(n Network) string
- func PublicRPCProtocol(raw string) string
- func ReadSpan(ctx context.Context, network string, s Source, r Span) (Span, BlockLink, []Activity, error)
- func RedactError(err error, n Network) string
- func SharesScanSource(n Network, scanned map[string]bool) bool
- func SourceIDs(n Network) []string
- func Supported(name string) bool
- func TONIndexHeight(ctx context.Context, n Network) (int64, error)
- func TONReadSlice(ctx context.Context, n Network, master *ton.BlockIDExt, ...) (*cell.Slice, error)
- func TONVoter(n Network) (host, identity string, ok bool)
- func TransactionEvidence(n Network, raw json.RawMessage) (json.RawMessage, error)
- func TransactionHash(network, raw string) (string, error)
- func UniSatHeight(ctx context.Context, n Network) (int64, error)
- func ValidateEndpoint(n Network) error
- func ValidateNetwork(n Network) error
- func VerifyTON(ctx context.Context, n Network, hash string, loc TONLocation) (json.RawMessage, error)
- func Wakeups(s Source) <-chan struct{}
- type Activity
- type AssetEventLayout
- type AssetEventRules
- type BlockLink
- type Evidence
- type FinishRange
- type Network
- type Source
- type Span
- type TONData
- type TONLocation
Constants ¶
This section is empty.
Variables ¶
var ErrFork = errors.New("block ancestry conflicts with a completed neighbor")
ErrFork marks a provider response incompatible with an already accepted neighbor.
var ErrRateLimited = errors.New("RPC HTTP 429")
var ErrTransactionData = errors.New("incomplete or mismatched transaction")
var ErrTransactionMissing = errors.New("transaction not found")
var ErrTransactionPending = errors.New("transaction is pending confirmation")
Functions ¶
func BitcoinRPCHeight ¶
Bitcoin Core nodes expose a mainnet height for the node inventory.
func ConnectTONPeer ¶
func ConnectTONPeer(ctx context.Context, pool *liteclient.ConnectionPool, raw string) error
ConnectTONPeer authenticates a direct LiteServer and verifies its mainnet genesis.
func EVMChainID ¶
func EVMNetworks ¶
func EndpointProtocol ¶
EndpointProtocol resolves the transport, including legacy configured URLs.
func LookupHead ¶
Check availability without sending the caller's transaction hash.
func LookupTransaction ¶
func NativeAsset ¶
NativeAsset identifies the top-level value-transfer assets supported by the new EVM adapters. All use 18 decimals for JSON-RPC transaction value.
func NeedsHistory ¶
func NodeHead ¶
A paired scanner can follow a history provider's cursor. A node test must report a height observed on the selected primary interface.
func ProbePublicRPC ¶
Probe a recent numbered block, catching stuck nodes and endpoints that answer a height request but cannot serve even the corresponding header.
func ProbePublicScan ¶
ProbePublicScan exercises the scanner's history read before admission.
func Protocols ¶
Protocols lists selectable node interfaces in preferred order. HTTP is retained for configurations created before explicit protocol selection.
func ProviderKey ¶
Different credentials, paths, or transports on one host and port do not identify different providers. A paired node uses its history provider's key.
func PublicRPCProtocol ¶
Public directory entries are third-party input. Apply the same dial policy during discovery, admin tests and actual scanning, including websocket reconnects.
func ReadSpan ¶
func ReadSpan(ctx context.Context, network string, s Source, r Span) (Span, BlockLink, []Activity, error)
ReadSpan returns one complete adapter response, including the exact boundary of a partial Aptos page. A linked EVM source must identify both neighbors.
func RedactError ¶
func SourceIDs ¶
SourceIDs identifies both sides of paired transports. Only opaque identities for matched transactions are retained after the scan has committed.
func TONReadSlice ¶
func TONReadSlice(ctx context.Context, n Network, master *ton.BlockIDExt, contract *address.Address, method string, arg *cell.Cell) (*cell.Slice, error)
TONReadSlice runs a historical getter with one slice argument and one slice result. Payment consumers use it to verify contracts against the same block that produced an activity. The caller interprets the return value.
func TONVoter ¶
Only pinned direct peers can vote. A global-config URL may select the same backing peer twice. Both socket host and Ed25519 identity are deduplicated.
func TransactionEvidence ¶
func TransactionEvidence(n Network, raw json.RawMessage) (json.RawMessage, error)
TransactionEvidence validates and projects a single successful, identity-checked read from one node.
func TransactionHash ¶
func ValidateEndpoint ¶
ValidateEndpoint checks a primary endpoint before a history node is selected.
func ValidateNetwork ¶
func VerifyTON ¶
func VerifyTON(ctx context.Context, n Network, hash string, loc TONLocation) (json.RawMessage, error)
Types ¶
type Activity ¶
type Activity struct {
ScanFallback bool `json:"-"` // Role of the endpoint that supplied this block.
ScanSources []string `json:"-"` // Internal provenance for the committed block read.
Confirmations int64 `json:"confirmations"`
Network string `json:"network"`
Height int64 `json:"height"`
TxID string `json:"tx_id"`
TimeMS int64 `json:"time_ms"`
Addresses []string `json:"addresses"`
Data json.RawMessage `json:"data"`
}
Activity carries chain evidence, including failed and outgoing transactions. A subscriber is responsible for interpreting it.
type AssetEventLayout ¶
type AssetEventLayout struct {
Topics int `json:"topics"` // includes topic0
DataWords int `json:"data_words"` // exact number of non-indexed, static 32-byte words
AddressWords []int `json:"address_words,omitempty"` // zero-based offsets of address arguments
RefreshAsset bool `json:"refresh_asset,omitempty"` // emitting token has a global balance update
}
type AssetEventRules ¶
type AssetEventRules map[common.Address]map[common.Hash]AssetEventLayout
AssetEventRules maps an emitting contract and topic0 to its fixed ABI layout. Treat a configured rule set as immutable after handing it to a scanner.
type BlockLink ¶
type BlockLink struct{ Hash, Parent string }
BlockLink identifies the exact EVM block whose transactions were decoded.
type Evidence ¶
type Evidence struct {
RefreshAssets []string `json:"refresh_assets,omitempty"`
Transaction json.RawMessage `json:"transaction"`
Logs []json.RawMessage `json:"logs,omitempty"`
Receipt json.RawMessage `json:"receipt,omitempty"`
Trace json.RawMessage `json:"trace,omitempty"`
}
type Network ¶
type Network struct {
AssetEvents *AssetEventRules `json:"asset_events,omitempty"`
Protocol string `json:"protocol,omitempty"`
HistoryURL string `json:"history_url,omitempty"`
HistoryAPIKey string `json:"history_api_key,omitempty"`
Name string `json:"name"`
URL string `json:"url"`
APIKey string `json:"api_key,omitempty"`
Confirmations int64 `json:"confirmations,omitempty"`
IntervalSeconds int `json:"interval_seconds,omitempty"`
Lookback int64 `json:"lookback,omitempty"`
TraceCalls bool `json:"trace_calls,omitempty"`
}
func LookupRoute ¶
LookupRoute resolves paired interfaces to the actual history endpoint. Stream aliases must neither receive duplicate work nor count as additional votes.
func (Network) UsesHistory ¶
Avalanche WebSockets may either serve execution RPC directly or supply only newHeads, with an HTTP companion performing all execution reads.
func (Network) ValidateAssetEvents ¶
type Source ¶
type Source interface {
Head(context.Context) (int64, error)
Read(ctx context.Context, next, head int64) (end int64, events []Activity, err error)
Close()
}
Source returns contiguous confirmed heights (ledger versions for Aptos).
type TONLocation ¶
type TONLocation struct {
// contains filtered or unexported fields
}
The index contributes a location, never a vote or any unchecked output fields.
Source Files
¶
- aptos_stream.go
- asset_events.go
- beacon.go
- bitcoin.go
- catchup.go
- evm.go
- evm_evidence.go
- graphql.go
- ledger.go
- lookup.go
- networks.go
- paired.go
- probe.go
- protocol.go
- provider.go
- public_rpc.go
- rpcnode.go
- signals.go
- solana.go
- source.go
- strict_evidence.go
- sui.go
- sui_graphql.go
- ton.go
- ton_http.go
- ton_lookup.go
- tron_grpc.go
- types.go
- work.go