Documentation ¶
Index ¶
- Constants
- func GetCheckpointNumber(ledger uint32) uint32
- func GetOperationParticipants(transaction ingest.LedgerTransaction, operation xdr.Operation, opIndex int) ([]string, error)
- func GetPaymentParticipants(transaction ingest.LedgerTransaction) ([]string, error)
- func GetTransactionParticipants(transaction ingest.LedgerTransaction) ([]string, error)
- func PrintProgress(prefix string, done, total uint64, startTime time.Time)
- func ProcessAccounts(indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, ...) error
- func ProcessAccountsByCheckpoint(indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction) error
- func ProcessAccountsByCheckpointWithoutBackend(indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction) error
- func ProcessAccountsByLedger(indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction) error
- func ProcessAccountsByLedgerWithoutBackend(indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction) error
- func ProcessAccountsWithoutBackend(indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, ...) error
- func ProcessTransaction(indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction) error
- type AccountIndexMode
- type IndexBuilder
- func (builder *IndexBuilder) Build(ctx context.Context, ledgerRange historyarchive.Range) error
- func (builder *IndexBuilder) RegisterModule(module Module)
- func (builder *IndexBuilder) RunModules(ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction) error
- func (builder *IndexBuilder) Watch(ctx context.Context) error
- type MockStore
- func (m *MockStore) AddParticipantToIndexesNoBackend(participant string, indexes types.NamedIndices)
- func (m *MockStore) AddParticipantsToIndexes(checkpoint uint32, index string, participants []string) error
- func (m *MockStore) AddParticipantsToIndexesNoBackend(checkpoint uint32, index string, participants []string) error
- func (m *MockStore) AddTransactionToIndexes(txnTOID int64, hash [32]byte) error
- func (m *MockStore) ClearMemory(arg bool)
- func (m *MockStore) Flush() error
- func (m *MockStore) FlushAccounts() error
- func (m *MockStore) MergeTransactions(prefix string, other *types.TrieIndex) error
- func (m *MockStore) NextActive(account, index string, afterCheckpoint uint32) (uint32, error)
- func (m *MockStore) Read(account string) (types.NamedIndices, error)
- func (m *MockStore) ReadAccounts() ([]string, error)
- func (m *MockStore) ReadTransactions(prefix string) (*types.TrieIndex, error)
- func (m *MockStore) RegisterMetrics(registry *prometheus.Registry)
- func (m *MockStore) TransactionTOID(hash [32]byte) (int64, error)
- type Module
- type Store
- func Connect(backendUrl string) (Store, error)
- func ConnectWithConfig(config StoreConfig) (Store, error)
- func NewFileStore(prefix string, config StoreConfig) (Store, error)
- func NewS3Store(awsConfig *aws.Config, bucket string, prefix string, indexConfig StoreConfig) (Store, error)
- func NewStore(backend backend.Backend, config StoreConfig) (Store, error)
- type StoreConfig
Constants ¶
const ( ByCheckpoint = iota ByLedger = iota )
Variables ¶
This section is empty.
Functions ¶
func GetCheckpointNumber ¶
GetCheckpointNumber returns the next checkpoint NUMBER (NOT the checkpoint ledger sequence) corresponding to a given ledger sequence.
func GetOperationParticipants ¶
func GetOperationParticipants(transaction ingest.LedgerTransaction, operation xdr.Operation, opIndex int) ([]string, error)
transaction - the ledger transaction operation - the operation within this transaction opIndex - the 0 based index of the operation within the transaction
func GetPaymentParticipants ¶
func GetPaymentParticipants(transaction ingest.LedgerTransaction) ([]string, error)
func GetTransactionParticipants ¶
func GetTransactionParticipants(transaction ingest.LedgerTransaction) ([]string, error)
func ProcessAccounts ¶
func ProcessAccounts( indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, mode AccountIndexMode, ) error
func ProcessAccountsByCheckpoint ¶
func ProcessAccountsByCheckpoint( indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, ) error
func ProcessAccountsByCheckpointWithoutBackend ¶
func ProcessAccountsByCheckpointWithoutBackend( indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, ) error
func ProcessAccountsByLedger ¶
func ProcessAccountsByLedger( indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, ) error
func ProcessAccountsByLedgerWithoutBackend ¶
func ProcessAccountsByLedgerWithoutBackend( indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, ) error
func ProcessAccountsWithoutBackend ¶
func ProcessAccountsWithoutBackend( indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, mode AccountIndexMode, ) error
func ProcessTransaction ¶
func ProcessTransaction( indexStore Store, ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, ) error
Types ¶
type AccountIndexMode ¶
type AccountIndexMode int
type IndexBuilder ¶
type IndexBuilder struct {
// contains filtered or unexported fields
}
IndexBuilder contains everything needed to build indices from ledger ranges.
func BuildIndices ¶
func NewIndexBuilder ¶
func NewIndexBuilder( indexStore Store, metaArchive metaarchive.MetaArchive, networkPassphrase string, ) *IndexBuilder
func (*IndexBuilder) Build ¶
func (builder *IndexBuilder) Build(ctx context.Context, ledgerRange historyarchive.Range) error
Build sequentially creates indices for each ledger in the given range based on the registered modules.
TODO: We can probably optimize this by doing GetLedger in parallel with the ingestion & index building, since the network will be idle during the latter portion.
func (*IndexBuilder) RegisterModule ¶
func (builder *IndexBuilder) RegisterModule(module Module)
RegisterModule adds a module to process every given ledger. It is not threadsafe and all calls should be made *before* any calls to `Build`.
func (*IndexBuilder) RunModules ¶
func (builder *IndexBuilder) RunModules( ledger xdr.LedgerCloseMeta, tx ingest.LedgerTransaction, ) error
RunModules executes all of the registered modules on the given ledger.
type MockStore ¶
func (*MockStore) AddParticipantToIndexesNoBackend ¶
func (m *MockStore) AddParticipantToIndexesNoBackend(participant string, indexes types.NamedIndices)
func (*MockStore) AddParticipantsToIndexes ¶
func (*MockStore) AddParticipantsToIndexesNoBackend ¶
func (*MockStore) AddTransactionToIndexes ¶
func (*MockStore) ClearMemory ¶
func (*MockStore) FlushAccounts ¶
func (*MockStore) MergeTransactions ¶
func (*MockStore) NextActive ¶
func (*MockStore) ReadAccounts ¶
func (*MockStore) ReadTransactions ¶
func (*MockStore) RegisterMetrics ¶
func (m *MockStore) RegisterMetrics(registry *prometheus.Registry)
type Module ¶
type Module func( indexStore Store, ledger xdr.LedgerCloseMeta, transaction ingest.LedgerTransaction, ) error
Module is a way to process ingested data and shove it into an index store.
type Store ¶
type Store interface { NextActive(account, index string, afterCheckpoint uint32) (uint32, error) TransactionTOID(hash [32]byte) (int64, error) AddTransactionToIndexes(txnTOID int64, hash [32]byte) error AddParticipantsToIndexes(checkpoint uint32, index string, participants []string) error AddParticipantsToIndexesNoBackend(checkpoint uint32, index string, participants []string) error AddParticipantToIndexesNoBackend(participant string, indexes types.NamedIndices) Flush() error FlushAccounts() error ClearMemory(bool) Read(account string) (types.NamedIndices, error) ReadAccounts() ([]string, error) ReadTransactions(prefix string) (*types.TrieIndex, error) MergeTransactions(prefix string, other *types.TrieIndex) error RegisterMetrics(registry *prometheus.Registry) }
func ConnectWithConfig ¶
func ConnectWithConfig(config StoreConfig) (Store, error)
func NewFileStore ¶
func NewFileStore(prefix string, config StoreConfig) (Store, error)
func NewS3Store ¶
type StoreConfig ¶
type StoreConfig struct { // init time config // the base url for the store resource URL string // optional url path to append to the base url to realize the complete url URLSubPath string Workers uint32 // runtime config ClearMemoryOnFlush bool // logging & metrics Log *log.Entry // TODO: unused for now Metrics *prometheus.Registry }
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
batch
Package batch provides two commands: map and reduce that can be run in AWS Batch to generate indexes for occurences of accounts in each checkpoint.
|
Package batch provides two commands: map and reduce that can be run in AWS Batch to generate indexes for occurences of accounts in each checkpoint. |