Documentation
¶
Index ¶
- type Chain
- type Head
- type MultiNodeClient
- func (c *MultiNodeClient) ChainID(ctx context.Context) (multinode.StringID, error)
- func (c *MultiNodeClient) ClientVersion(ctx context.Context) (string, error)
- func (c *MultiNodeClient) Close()
- func (c *MultiNodeClient) Dial(ctx context.Context) error
- func (c *MultiNodeClient) IsSyncing(_ context.Context) (bool, error)
- type Opts
- type RPCClient
- type SorobanClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain interface {
types.ChainService
ID() string
Config() *config.TOMLConfig
TxManager() *txm.StellarTxm
KeyStore() core.Keystore
GetClient(ctx context.Context) (RPCClient, error)
}
Chain is the Stellar chain service interface.
func NewChain ¶
func NewChain(cfg *config.TOMLConfig, opts Opts, chainInfo chainsel.StellarChain) (Chain, error)
type Head ¶ added in v0.0.3
type Head struct {
Sequence uint32
}
Head is the multinode head for Stellar. Stellar ledgers are final at close (SCP gives deterministic finality, no reorgs), so there is a single head notion: the latest closed ledger is also the finalized ledger. Difficulty/total-difficulty are PoW concepts and are always nil.
func (*Head) BlockDifficulty ¶ added in v0.0.3
func (*Head) BlockNumber ¶ added in v0.0.3
func (*Head) GetTotalDifficulty ¶ added in v0.0.3
type MultiNodeClient ¶ added in v0.0.3
type MultiNodeClient struct {
*multinode.RPCClientBase[*Head]
SorobanClient
// contains filtered or unexported fields
}
MultiNodeClient embeds *multinode.RPCClientBase, which supplies the head/finalized-head subscriptions (via polling), subscription bookkeeping.
func NewMultiNodeClient ¶ added in v0.0.3
func NewMultiNodeClient( url string, cfg multinode.RPCClientBaseConfig, requestTimeout time.Duration, lggr logger.Logger, rpcMetrics frameworkmetrics.RPCClientMetrics, ) *MultiNodeClient
NewMultiNodeClient builds an adapter around the Soroban RPC at url. cfg supplies the head/finalized poll intervals consumed by RPCClientBase.
func (*MultiNodeClient) ChainID ¶ added in v0.0.3
ChainID returns the hex-encoded Stellar network ID (SHA-256 of the network passphrase), which matches the chain-selectors ChainID form used in config, so node chain-ID verification can be enabled.
func (*MultiNodeClient) ClientVersion ¶ added in v0.0.3
func (c *MultiNodeClient) ClientVersion(ctx context.Context) (string, error)
ClientVersion doubles as the periodic liveness probe; it returns an error when the RPC is unreachable, which the node lifecycle treats as a health failure.
func (*MultiNodeClient) Close ¶ added in v0.0.3
func (c *MultiNodeClient) Close()
Close tears down the framework subscriptions and the underlying SDK client. It is defined explicitly to resolve the ambiguity between RPCClientBase.Close() and SorobanClient.Close().
func (*MultiNodeClient) Dial ¶ added in v0.0.3
func (c *MultiNodeClient) Dial(ctx context.Context) error
Dial validates reachability of the endpoint. The SDK client is HTTP and does not hold a persistent connection, so a successful health probe stands in for a dial handshake. A node that responds but reports a non-healthy status is rejected so it is not added to the pool.
type RPCClient ¶
type RPCClient interface {
SimulateTransaction(ctx context.Context, req protocolrpc.SimulateTransactionRequest) (protocolrpc.SimulateTransactionResponse, error)
SendTransaction(ctx context.Context, req protocolrpc.SendTransactionRequest) (protocolrpc.SendTransactionResponse, error)
GetTransaction(ctx context.Context, req protocolrpc.GetTransactionRequest) (protocolrpc.GetTransactionResponse, error)
GetEvents(ctx context.Context, req protocolrpc.GetEventsRequest) (protocolrpc.GetEventsResponse, error)
GetLedgerEntries(ctx context.Context, req protocolrpc.GetLedgerEntriesRequest) (protocolrpc.GetLedgerEntriesResponse, error)
GetLedgers(ctx context.Context, req protocolrpc.GetLedgersRequest) (protocolrpc.GetLedgersResponse, error)
GetLatestLedger(ctx context.Context) (protocolrpc.GetLatestLedgerResponse, error)
GetFeeStats(ctx context.Context) (protocolrpc.GetFeeStatsResponse, error)
}
RPCClient is the subset of the Stellar Soroban JSON-RPC client used across the Stellar relayer (chain + per-component callers). It mirrors the public surface of *rpcclient.Client so production wiring passes the SDK type unchanged and tests can inject mocks. Connection lifecycle is owned by the multinode pool, so this interface does not expose Close.
type SorobanClient ¶ added in v0.0.3
type SorobanClient interface {
RPCClient
GetHealth(ctx context.Context) (protocolrpc.GetHealthResponse, error)
GetNetwork(ctx context.Context) (protocolrpc.GetNetworkResponse, error)
GetVersionInfo(ctx context.Context) (protocolrpc.GetVersionInfoResponse, error)
Close() error
}
SorobanClient is the subset of the Stellar SDK rpcclient.Client used by MultiNodeClient: the domain RPCClient surface plus the health/network/version probes the multinode node lifecycle needs, plus Close. Holding it as an interface keeps the adapter unit-testable; *rpcclient.Client satisfies it.