indexer

package
v0.0.0-...-67a64fa Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetAndDecode

func GetAndDecode(url string, encodingConfig EncodingConfig, target proto.Message) (int, error)

Types

type EncodingConfig

type EncodingConfig struct {
	InterfaceRegistry types.InterfaceRegistry
	Codec             codec.Codec
	TxConfig          client.TxConfig
}

func MakeEncodingConfig

func MakeEncodingConfig() EncodingConfig

type Indexer

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

func NewIndexer

func NewIndexer(chain *indexerpb.IndexingChain, encodingConfig EncodingConfig, kafkaBrokers []string, txHandler TxHandler) Indexer

func (*Indexer) StartIndexing

func (i *Indexer) StartIndexing(updateChannel chan SyncStatus, stopChannel chan struct{})

type RawEvent

type RawEvent struct {
	Type       string
	Attributes []string
}

type SyncStatus

type SyncStatus struct {
	ChainId               uint64
	Height                uint64
	LatestHeight          uint64
	HandledMessageTypes   map[string]struct{}
	UnhandledMessageTypes map[string]struct{}
	// contains filtered or unexported fields
}

type TxHandler

type TxHandler interface {
	HandleTxs(txs [][]byte) (*indexerpb.HandleTxsResponse, error)
}

func NewBaseMessageHandler

func NewBaseMessageHandler(chainInfo *indexerpb.IndexingChain, encodingConfig EncodingConfig) TxHandler

func NewCustomMessageHandler

func NewCustomMessageHandler(chainInfo *indexerpb.IndexingChain, encodingConfig EncodingConfig, grpcEndpoint string) TxHandler

type TxHelper

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

func NewTxHelper

func NewTxHelper(chainInfo *indexerpb.IndexingChain, encodingConfig EncodingConfig) TxHelper

func (*TxHelper) GetTxResponse

func (h *TxHelper) GetTxResponse(tx []byte) (*sdktypes.TxResponse, *timestamppb.Timestamp, error)

func (*TxHelper) GetTxResult

func (h *TxHelper) GetTxResult(tx []byte) (*txtypes.GetTxResponse, error)

func (*TxHelper) GetTxTimestamp

func (h *TxHelper) GetTxTimestamp(txResponse *sdktypes.TxResponse) (time.Time, error)

func (*TxHelper) WasTxSuccessful

func (h *TxHelper) WasTxSuccessful(tx []byte) (bool, *timestamppb.Timestamp, error)

Jump to

Keyboard shortcuts

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