Documentation
¶
Index ¶
- Variables
- func MergeLedgers(dst *xdr.LedgerCloseMeta, src xdr.LedgerCloseMeta, ...) error
- func UpdateLedgerSeqInLedgerEntries(dest XDR, getUpdatedLedger func(uint32) uint32) error
- type LedgerBackend
- func (r *LedgerBackend) Close() error
- func (r *LedgerBackend) GetLatestLedgerSequence(ctx context.Context) (uint32, error)
- func (r *LedgerBackend) GetLedger(ctx context.Context, sequence uint32) (xdr.LedgerCloseMeta, error)
- func (r *LedgerBackend) IsPrepared(ctx context.Context, ledgerRange ledgerbackend.Range) (bool, error)
- func (r *LedgerBackend) PrepareRange(ctx context.Context, ledgerRange ledgerbackend.Range) error
- type LedgerBackendConfig
- type XDR
Constants ¶
This section is empty.
Variables ¶
var ErrLoadTestDone = fmt.Errorf("the load test is done")
ErrLoadTestDone indicates that the load test has run to completion.
Functions ¶
func MergeLedgers ¶
func MergeLedgers(dst *xdr.LedgerCloseMeta, src xdr.LedgerCloseMeta, getLedgerSeq func(cur uint32) uint32) error
MergeLedgers merges two xdr.LedgerCloseMeta instances. getLedgerSeq is used to determine the ledger sequence value for all ledger entries contained in src during the merge.
func UpdateLedgerSeqInLedgerEntries ¶
UpdateLedgerSeqInLedgerEntries will traverse the ledger entries contained within dest and update any ledger sequence values that are found in the ledger entries. The new ledger sequence values will be determined by calling getUpdatedLedger().
Types ¶
type LedgerBackend ¶
type LedgerBackend struct {
// contains filtered or unexported fields
}
LedgerBackend is used to load test ingestion. LedgerBackend will take a file of synthetically generated ledgers (see services/horizon/internal/integration/generate_ledgers_test.go) and replay them to the downstream ingesting system at a configurable rate. It is also possible to merge the synthetically generated ledgers with real ledgers from the network. To enable the merging behavior, configure the LedgerBackend field in LedgerBackendConfig.
func NewLedgerBackend ¶
func NewLedgerBackend(config LedgerBackendConfig) *LedgerBackend
NewLedgerBackend constructs an LedgerBackend instance
func (*LedgerBackend) Close ¶
func (r *LedgerBackend) Close() error
func (*LedgerBackend) GetLatestLedgerSequence ¶
func (r *LedgerBackend) GetLatestLedgerSequence(ctx context.Context) (uint32, error)
func (*LedgerBackend) GetLedger ¶
func (r *LedgerBackend) GetLedger(ctx context.Context, sequence uint32) (xdr.LedgerCloseMeta, error)
func (*LedgerBackend) IsPrepared ¶
func (r *LedgerBackend) IsPrepared(ctx context.Context, ledgerRange ledgerbackend.Range) (bool, error)
func (*LedgerBackend) PrepareRange ¶
func (r *LedgerBackend) PrepareRange(ctx context.Context, ledgerRange ledgerbackend.Range) error
type LedgerBackendConfig ¶
type LedgerBackendConfig struct {
// NetworkPassphrase is the passphrase of the Stellar network from where the real ledgers
// will be obtained
NetworkPassphrase string
// LedgerBackend is an optional parameter. When LedgerBackend is configured, ledgers from
// LedgerBackend will be merged with the synthetic ledgers from LedgersFilePath.
LedgerBackend ledgerbackend.LedgerBackend
// LedgersFilePath is a file containing the synthetic ledgers that will be replayed to
// the downstream ingesting system.
LedgersFilePath string
// LedgerCloseDuration is the rate at which ledgers will be replayed from LedgerBackend
LedgerCloseDuration time.Duration
}
LedgerBackendConfig configures LedgerBackend
type XDR ¶
type XDR interface {
encoding.BinaryUnmarshaler
encoding.BinaryMarshaler
}