Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBalanceMonitor ¶
func NewBalanceMonitor(opts BalanceMonitorOpts) (services.Service, error)
NewBalanceMonitor returns a balance monitoring services.Service which reports the XLM balance of all keystore accounts as the Beholder gauge `account_balance`.
Types ¶
type BalanceMonitorOpts ¶
type BalanceMonitorOpts struct {
ChainInfo balance.ChainInfo
Config balance.GenericBalanceConfig
Logger logger.Logger
Keystore core.Keystore
// GetClient returns a healthy RPC client from the multinode pool. It is
// called on every balance fetch so no node is pinned across poll cycles.
GetClient func(ctx context.Context) (BalanceMonitorRPCClient, error)
// Timeout bounds each balance fetch; GenericBalanceClient carries no context.
Timeout time.Duration
}
BalanceMonitorOpts contains the options for creating a new Stellar account balance monitor.
type BalanceMonitorRPCClient ¶
type BalanceMonitorRPCClient interface {
GetLedgerEntries(ctx context.Context, req protocolrpc.GetLedgerEntriesRequest) (protocolrpc.GetLedgerEntriesResponse, error)
}
BalanceMonitorRPCClient is the subset of the Stellar Soroban JSON-RPC client used by the balance monitor.
Click to show internal directories.
Click to hide internal directories.