Documentation
¶
Index ¶
- Constants
- func NewBalanceMonitor(opts BalanceMonitorOpts) (services.Service, error)
- func NewGenericBalanceMonitor(opts GenericBalanceMonitorOpts) (services.Service, error)
- type BalanceMonitorOpts
- type BeholderClient
- type ChainInfo
- type GaugeAccBalance
- type GenericBalanceClient
- type GenericBalanceConfig
- type GenericBalanceMonitorOpts
- type ProtoEmitter
- type ProtoProcessor
Constants ¶
const ( AttrKeyBeholderDataSchema = "beholder_data_schema" AttrKeyBeholderEntity = "beholder_entity" AttrKeyBeholderDomain = "beholder_domain" )
const (
// Helper keys to avoid duplicating attributes
CtxKeySkipAppendAttrs = "skip_append_attrs"
)
Variables ¶
This section is empty.
Functions ¶
func NewBalanceMonitor ¶
func NewBalanceMonitor(opts BalanceMonitorOpts) (services.Service, error)
NewBalanceMonitor returns a balance monitoring services.Service which reports balance of all Keystore accounts.
func NewGenericBalanceMonitor ¶
func NewGenericBalanceMonitor(opts GenericBalanceMonitorOpts) (services.Service, error)
TODO: This implementation is chain-agnotic, so it should be moved to the common package and reused by all chains.
- Solana: /solana/pkg/solana/monitor
- TRON: /tron/relayer/monitor
NewGenericBalanceMonitor returns a balance monitoring services.Service which reports the balance of all Keystore accounts.
Types ¶
type BalanceMonitorOpts ¶
type BalanceMonitorOpts struct {
ChainInfo ChainInfo
Config GenericBalanceConfig
Logger logger.Logger
Keystore core.Keystore
NewClient func() (aptos.AptosRpcClient, error)
}
BalanceMonitorOpts contains the options for creating a new Aptos account balance monitor.
type BeholderClient ¶
type BeholderClient struct {
*beholder.Client
ProtoEmitter ProtoEmitter
}
BeholderClient is a Beholder client extension with a custom ProtoEmitter
type ChainInfo ¶
type ChainInfo struct {
ChainFamilyName string
ChainID string
NetworkName string
NetworkNameFull string
}
TODO: duplicate of "github.com/smartcontractkit/chainlink-aptos/relayer/write_target.ChainInfo" (reuse) ChainInfo contains the chain information (used as execution context)
type GaugeAccBalance ¶
type GaugeAccBalance struct {
// contains filtered or unexported fields
}
Define a new gauge metric for account balance
func NewGaugeAccBalance ¶
func NewGaugeAccBalance(unitStr string) (*GaugeAccBalance, error)
func (*GaugeAccBalance) GetAttributes ¶
func (g *GaugeAccBalance) GetAttributes(account string, chainInfo ChainInfo) attribute.Set
type GenericBalanceClient ¶
GenericBalanceClient defines the interface for getting account balances.
type GenericBalanceConfig ¶
Config defines the balance monitor configuration.
type GenericBalanceMonitorOpts ¶
type GenericBalanceMonitorOpts struct {
ChainInfo ChainInfo
ChainNativeCurrency string
Config GenericBalanceConfig
Logger logger.Logger
Keystore core.Keystore
NewGenericBalanceClient func() (GenericBalanceClient, error)
// Maps a public key to an account address (optional, can return key as is)
KeyToAccountMapper func(context.Context, string) (string, error)
}
GenericBalanceMonitorOpts contains the options for creating a new balance monitor.
type ProtoEmitter ¶
type ProtoEmitter interface {
// Sends message with bytes and attributes to OTel Collector
Emit(ctx context.Context, m proto.Message, attrKVs ...any) error
EmitWithLog(ctx context.Context, m proto.Message, attrKVs ...any) error
}
ProtoEmitter is an interface for emitting protobuf messages TODO: this should be moved to chainlink-common