adapters

package
v0.0.0-...-fb9541f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryArchiveAdapter

type HistoryArchiveAdapter struct {
	// contains filtered or unexported fields
}

HistoryArchiveAdapter is an adapter for the historyarchive package to read from history archives

func MakeHistoryArchiveAdapter

func MakeHistoryArchiveAdapter(archive historyarchive.ArchiveInterface) *HistoryArchiveAdapter

MakeHistoryArchiveAdapter is a factory method to make a HistoryArchiveAdapter

func (*HistoryArchiveAdapter) BucketListHash

func (haa *HistoryArchiveAdapter) BucketListHash(sequence uint32) (xdr.Hash, error)

BucketListHash returns the bucket list hash to compare with hash in the ledger header fetched from Paydex-Core.

func (*HistoryArchiveAdapter) GetLatestLedgerSequence

func (haa *HistoryArchiveAdapter) GetLatestLedgerSequence() (uint32, error)

GetLatestLedgerSequence returns the latest ledger sequence or an error

func (*HistoryArchiveAdapter) GetLedger

func (haa *HistoryArchiveAdapter) GetLedger(sequence uint32) (io.ArchiveLedgerReader, error)

GetLedger gets a ledger transaction result at the provided sequence number

func (*HistoryArchiveAdapter) GetState

func (haa *HistoryArchiveAdapter) GetState(
	sequence uint32, tempSet io.TempSet, maxStreamRetries int,
) (io.StateReader, error)

GetState returns a reader with the state of the ledger at the provided sequence number `maxStreamRetries` determines how many times the reader will retry when encountering errors while streaming xdr bucket entries from the history archive. Set `maxStreamRetries` to 0 if there should be no retry attempts

type LedgerBackendAdapter

type LedgerBackendAdapter struct {
	Backend ledgerbackend.LedgerBackend
}

LedgerBackendAdapter provides a convenient I/O layer above the low-level LedgerBackend implementation.

func (*LedgerBackendAdapter) Close

func (lba *LedgerBackendAdapter) Close() error

Close shuts down the provided backend.

func (*LedgerBackendAdapter) GetLatestLedgerSequence

func (lba *LedgerBackendAdapter) GetLatestLedgerSequence() (uint32, error)

GetLatestLedgerSequence returns the most recent ledger sequence number present in the backend.

func (*LedgerBackendAdapter) GetLedger

func (lba *LedgerBackendAdapter) GetLedger(sequence uint32) (io.LedgerReader, error)

GetLedger returns information about a given ledger as an object that can be streamed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL