Documentation
¶
Index ¶
- Variables
- func BlockRPCWorker(wg *sync.WaitGroup, blockEnqueueChan chan *EnqueueData, chainID uint, ...)
- func ChainSpecificMessageTypeHandlerBootstrap(chainID string)
- func FilterRPCBlockEvents(blockEvents []db.BlockEventDBWrapper, ...) ([]db.BlockEventDBWrapper, error)
- func GenerateBlockFileEnqueueFunction(db *gorm.DB, cfg config.IndexConfig, client *client.ChainClient, chainID uint, ...) (func(chan *EnqueueData) error, error)
- func GenerateDefaultEnqueueFunction(db *gorm.DB, cfg config.IndexConfig, client *client.ChainClient, chainID uint) (func(chan *EnqueueData) error, error)
- func GenerateMsgTypeEnqueueFunction(db *gorm.DB, cfg config.IndexConfig, chainID uint, msgType string) (func(chan *EnqueueData) error, error)
- func HandleFailedBlock(height int64, code BlockProcessingFailure, err error)
- func InAppTxDecoder(cdc probeClient.Codec) sdk.TxDecoder
- func ProcessBlock(blockData *ctypes.ResultBlock, blockResultsData *ctypes.ResultBlockResults, ...) (models.Block, error)
- func ProcessFees(db *gorm.DB, authInfo cosmosTx.AuthInfo, signers []models.Address) ([]models.Fee, error)
- func ProcessMessage(messageIndex int, message types.Msg, txMessageEventLogs []txtypes.LogMessage, ...) (string, dbTypes.MessageDBWrapper)
- func ProcessRPCBlockByHeightTXs(db *gorm.DB, cl *client.ChainClient, ...) ([]dbTypes.TxDBWrapper, *time.Time, error)
- func ProcessRPCBlockEvents(block *models.Block, blockEvents []abci.Event, ...) ([]db.BlockEventDBWrapper, error)
- func ProcessRPCBlockResults(conf config.IndexConfig, block models.Block, ...) (*db.BlockDBWrapper, error)
- func ProcessRPCTXs(db *gorm.DB, cl *client.ChainClient, ...) ([]dbTypes.TxDBWrapper, *time.Time, error)
- func ProcessSigners(cl *client.ChainClient, authInfo *cosmosTx.AuthInfo, ...) ([]models.Address, []*models.SignerInfo, error)
- func ProcessTx(db *gorm.DB, tx txtypes.MergedTx, messagesRaw [][]byte) (txDBWapper dbTypes.TxDBWrapper, txTime time.Time, err error)
- type BlockProcessingFailure
- type EnqueueData
- type FailedBlockHandler
- type IndexerBlockEventData
Constants ¶
This section is empty.
Variables ¶
var EnqueueFunctions = map[string]func(chan int64) error{}
Functions ¶
func BlockRPCWorker ¶
func BlockRPCWorker(wg *sync.WaitGroup, blockEnqueueChan chan *EnqueueData, chainID uint, chainStringID string, cfg *config.IndexConfig, chainClient *client.ChainClient, db *gorm.DB, outputChannel chan IndexerBlockEventData)
This function is responsible for making all RPC requests to the chain needed for later processing. The indexer relies on a number of RPC endpoints for full block data, including block event and transaction searches.
func ChainSpecificMessageTypeHandlerBootstrap ¶
func ChainSpecificMessageTypeHandlerBootstrap(chainID string)
Merge the chain specific message type handlers into the core message type handler map. Chain specific handlers will be registered BEFORE any generic handlers. TODO: Remove this function and replace with a more generic solution
func FilterRPCBlockEvents ¶
func FilterRPCBlockEvents(blockEvents []db.BlockEventDBWrapper, filterRegistry filter.StaticBlockEventFilterRegistry) ([]db.BlockEventDBWrapper, error)
func GenerateBlockFileEnqueueFunction ¶
func GenerateBlockFileEnqueueFunction(db *gorm.DB, cfg config.IndexConfig, client *client.ChainClient, chainID uint, blockInputFile string) (func(chan *EnqueueData) error, error)
func GenerateDefaultEnqueueFunction ¶
func GenerateDefaultEnqueueFunction(db *gorm.DB, cfg config.IndexConfig, client *client.ChainClient, chainID uint) (func(chan *EnqueueData) error, error)
GenerateDefaultEnqueueFunction The default enqueue function will enqueue blocks according to the configuration passed in. It has a few default cases detailed here: Based on whether transaction indexing or block event indexing are enabled, it will choose a start block based on passed in config values. If reindexing is disabled, it will not reindex blocks that have already been indexed. This means it may skip around finding blocks that have not been indexed according to the current configuration. If failed block reattempts are enabled, it will enqueue those according to the passed in configuration as well.
func GenerateMsgTypeEnqueueFunction ¶
func GenerateMsgTypeEnqueueFunction(db *gorm.DB, cfg config.IndexConfig, chainID uint, msgType string) (func(chan *EnqueueData) error, error)
func HandleFailedBlock ¶
func HandleFailedBlock(height int64, code BlockProcessingFailure, err error)
Log error to stdout. Not much else we can do to handle right now.
func InAppTxDecoder ¶
func InAppTxDecoder(cdc probeClient.Codec) sdk.TxDecoder
InAppTxDecoder Provides an in-app tx decoder. The primary use-case for this function is to allow fallback decoding if a TX fails to decode after RPC requests. This can happen in a number of scenarios, but mainly due to missing proto definitions. We can attempt a personal decode of the TX, and see if we can continue indexing based on in-app conditions (such as message type filters). This function skips a large chunk of decoding validations, and is not recommended for general use. Its main point is to skip errors that in default Cosmos TX decoders would cause the entire decode to fail.
func ProcessBlock ¶
func ProcessBlock(blockData *ctypes.ResultBlock, blockResultsData *ctypes.ResultBlockResults, chainID uint) (models.Block, error)
Process RPC Block data into the model object used by the application.
func ProcessFees ¶
func ProcessFees(db *gorm.DB, authInfo cosmosTx.AuthInfo, signers []models.Address) ([]models.Fee, error)
ProcessFees Processes fees into model form, applying denoms and addresses to them
func ProcessMessage ¶
func ProcessMessage(messageIndex int, message types.Msg, txMessageEventLogs []txtypes.LogMessage, uniqueEventTypes map[string]models.MessageEventType, uniqueEventAttributeKeys map[string]models.MessageEventAttributeKey) (string, dbTypes.MessageDBWrapper)
func ProcessRPCBlockByHeightTXs ¶
func ProcessRPCBlockByHeightTXs(db *gorm.DB, cl *client.ChainClient, messageTypeFilters []filter.MessageTypeFilter, blockResults *coretypes.ResultBlock, resultBlockRes *coretypes.ResultBlockResults) ([]dbTypes.TxDBWrapper, *time.Time, error)
func ProcessRPCBlockEvents ¶
func ProcessRPCBlockEvents(block *models.Block, blockEvents []abci.Event, blockLifecyclePosition models.BlockLifecyclePosition, uniqueEventTypes map[string]models.BlockEventType, uniqueAttributeKeys map[string]models.BlockEventAttributeKey, customParsers map[string][]parsers.BlockEventParser, conf config.IndexConfig) ([]db.BlockEventDBWrapper, error)
func ProcessRPCBlockResults ¶
func ProcessRPCBlockResults(conf config.IndexConfig, block models.Block, blockResults *ctypes.ResultBlockResults, customBeginBlockParsers map[string][]parsers.BlockEventParser, customEndBlockParsers map[string][]parsers.BlockEventParser) (*db.BlockDBWrapper, error)
func ProcessRPCTXs ¶
func ProcessRPCTXs(db *gorm.DB, cl *client.ChainClient, messageTypeFilters []filter.MessageTypeFilter, txEventResp *cosmosTx.GetTxsEventResponse) ([]dbTypes.TxDBWrapper, *time.Time, error)
ProcessRPCTXs - Given an RPC response, build out the more specific data used by the parser.
func ProcessSigners ¶
func ProcessSigners(cl *client.ChainClient, authInfo *cosmosTx.AuthInfo, messageSigners []types.AccAddress) ([]models.Address, []*models.SignerInfo, error)
ProcessSigners in a deterministic order. 1. Processes signers from the auth info 2. Processes signers from the signers array 3. Processes the fee payer
Types ¶
type BlockProcessingFailure ¶
type BlockProcessingFailure int
const ( NodeMissingBlockTxs BlockProcessingFailure = iota BlockQueryError UnprocessableTxError OsmosisNodeRewardLookupError OsmosisNodeRewardIndexError NodeMissingHistoryForBlock FailedBlockEventHandling )
type EnqueueData ¶
type FailedBlockHandler ¶
type FailedBlockHandler func(height int64, code BlockProcessingFailure, err error)
type IndexerBlockEventData ¶
type IndexerBlockEventData struct { BlockData *ctypes.ResultBlock BlockResultsData *ctypes.ResultBlockResults BlockEventRequestsFailed bool GetTxsResponse *txTypes.GetTxsEventResponse TxRequestsFailed bool IndexBlockEvents bool IndexTransactions bool }
Wrapper types for gathering full dataset.