Documentation ¶
Index ¶
- func GetOperationParticipants(tx LedgerTransaction, op xdr.Operation, opIndex int) (set.Set[string], error)
- func GetTransactionParticipants(tx LedgerTransaction) (set.Set[string], error)
- func NewParallelIngester(archive metaarchive.MetaArchive, networkPassphrase string, workerCount uint) *parallelIngester
- type Ingester
- type IngesterConfig
- type LedgerTransaction
- type LedgerTransactionReader
- type MockIngester
- func (m *MockIngester) GetLatestLedgerSequence(ctx context.Context) (uint32, error)
- func (m *MockIngester) GetLedger(ctx context.Context, sequence uint32) (xdr.SerializedLedgerCloseMeta, error)
- func (m *MockIngester) NewLedgerTransactionReader(ledgerCloseMeta xdr.SerializedLedgerCloseMeta) (LedgerTransactionReader, error)
- func (m *MockIngester) PrepareRange(ctx context.Context, r historyarchive.Range) error
- type MockLedgerTransactionReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOperationParticipants ¶
func GetOperationParticipants(tx LedgerTransaction, op xdr.Operation, opIndex int) (set.Set[string], error)
GetOperationParticipants takes a LedgerTransaction, the Operation within the transaction, and the 0-based index of the operation within the transaction. It will return a set of all participants (accounts) in the operation. If there is any error, it will return nil and the error.
func GetTransactionParticipants ¶
func GetTransactionParticipants(tx LedgerTransaction) (set.Set[string], error)
GetTransactionParticipants takes a LedgerTransaction and returns a set of all participants (accounts) in the transaction. If there is any error, it will return nil and the error.
func NewParallelIngester ¶
func NewParallelIngester( archive metaarchive.MetaArchive, networkPassphrase string, workerCount uint, ) *parallelIngester
NewParallelIngester creates an ingester on the given `ledgerSource` using the given `networkPassphrase` that can download ledgers in parallel via `workerCount` workers via `PrepareRange()`.
Types ¶
type Ingester ¶
type Ingester interface { metaarchive.MetaArchive PrepareRange(ctx context.Context, r historyarchive.Range) error NewLedgerTransactionReader( ledgerCloseMeta xdr.SerializedLedgerCloseMeta, ) (LedgerTransactionReader, error) }
Ingester combines a source of unpacked ledger metadata and a way to create a ingestion reader interface on top of it.
func NewIngester ¶
func NewIngester(config IngesterConfig) (Ingester, error)
type IngesterConfig ¶
type LedgerTransaction ¶
type LedgerTransaction struct {
*ingest.LedgerTransaction
}
For now, this mirrors the `ingest` library exactly, but it's replicated so that we can diverge in the future if necessary.
type LedgerTransactionReader ¶
type LedgerTransactionReader interface {
Read() (LedgerTransaction, error)
}
type MockIngester ¶
func (*MockIngester) GetLatestLedgerSequence ¶
func (m *MockIngester) GetLatestLedgerSequence(ctx context.Context) (uint32, error)
func (*MockIngester) GetLedger ¶
func (m *MockIngester) GetLedger(ctx context.Context, sequence uint32) (xdr.SerializedLedgerCloseMeta, error)
func (*MockIngester) NewLedgerTransactionReader ¶
func (m *MockIngester) NewLedgerTransactionReader( ledgerCloseMeta xdr.SerializedLedgerCloseMeta, ) (LedgerTransactionReader, error)
func (*MockIngester) PrepareRange ¶
func (m *MockIngester) PrepareRange(ctx context.Context, r historyarchive.Range) error
type MockLedgerTransactionReader ¶
func (*MockLedgerTransactionReader) Read ¶
func (m *MockLedgerTransactionReader) Read() (LedgerTransaction, error)