Documentation ¶
Index ¶
Constants ¶
const Pubnet = "pubnet"
const Testnet = "testnet"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { AdminPort int `toml:"admin_port"` Network string `toml:"network"` DataStoreConfig datastore.DataStoreConfig `toml:"datastore_config"` LedgerBatchConfig datastore.LedgerBatchConfig `toml:"exporter_config"` HcnetCoreConfig HcnetCoreConfig `toml:"hcnet_core_config"` StartLedger uint32 EndLedger uint32 Resume bool }
func NewConfig ¶
This will generate the config based on commandline flags and toml
ctx - the caller context flags - command line flags
return - *Config or an error if any range validation failed.
func (*Config) GenerateCaptiveCoreConfig ¶
func (config *Config) GenerateCaptiveCoreConfig() (ledgerbackend.CaptiveCoreConfig, error)
func (*Config) ValidateAndSetLedgerRange ¶
func (config *Config) ValidateAndSetLedgerRange(ctx context.Context, archive historyarchive.ArchiveInterface) error
Validates requested ledger range, and will automatically adjust it to be ledgers-per-file boundary aligned
type DataAlreadyExportedError ¶
func NewDataAlreadyExportedError ¶
func NewDataAlreadyExportedError(Start uint32, End uint32) *DataAlreadyExportedError
func (DataAlreadyExportedError) Error ¶
func (m DataAlreadyExportedError) Error() string
type ExportManager ¶
type ExportManager struct {
// contains filtered or unexported fields
}
func NewExportManager ¶
func NewExportManager(config datastore.LedgerBatchConfig, backend ledgerbackend.LedgerBackend, queue UploadQueue, prometheusRegistry *prometheus.Registry) (*ExportManager, error)
NewExportManager creates a new ExportManager with the provided configuration.
func (*ExportManager) AddLedgerCloseMeta ¶
func (e *ExportManager) AddLedgerCloseMeta(ctx context.Context, ledgerCloseMeta xdr.LedgerCloseMeta) error
AddLedgerCloseMeta adds ledger metadata to the current export object
func (*ExportManager) Run ¶
func (e *ExportManager) Run(ctx context.Context, startLedger, endLedger uint32) error
Run iterates over the specified range of ledgers, retrieves ledger data from the backend, and processes the corresponding ledger close metadata. The process continues until the ending ledger number is reached or a cancellation signal is received.
type HcnetCoreConfig ¶
type InvalidDataStoreError ¶
func NewInvalidDataStoreError ¶
func NewInvalidDataStoreError(LedgerSequence uint32, LedgersPerFile uint32) *InvalidDataStoreError
func (InvalidDataStoreError) Error ¶
func (m InvalidDataStoreError) Error() string
type UploadQueue ¶
type UploadQueue struct {
// contains filtered or unexported fields
}
UploadQueue is a queue of LedgerMetaArchive objects which are scheduled for upload
func NewUploadQueue ¶
func NewUploadQueue(size int, prometheusRegistry *prometheus.Registry) UploadQueue
NewUploadQueue constructs a new UploadQueue
func (UploadQueue) Dequeue ¶
func (u UploadQueue) Dequeue(ctx context.Context) (*datastore.LedgerMetaArchive, bool, error)
Dequeue will pop a task off the queue. Dequeue may block if the queue is empty.
func (UploadQueue) Enqueue ¶
func (u UploadQueue) Enqueue(ctx context.Context, archive *datastore.LedgerMetaArchive) error
Enqueue will add an upload task to the queue. Enqueue may block if the queue is full.
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
Uploader is responsible for uploading data to a storage destination.
func NewUploader ¶
func NewUploader( destination datastore.DataStore, queue UploadQueue, prometheusRegistry *prometheus.Registry, ) Uploader
NewUploader constructs a new Uploader instance