indexer

package
v1.0.2-prerelease Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stringfy

func Stringfy(input any) string

Stringfy marshal the given input into json

Types

type Service

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

Service consume events from blockchain and persist it to a database

func NewIndexer

func NewIndexer(params ServiceParams) (*Service, error)

NewIndexer create a new instance of Indexer

func (*Service) Close

func (s *Service) Close() error

Close will be called when it is time to shut down the service this allows the service to shut down itself gracefully

func (*Service) Run

func (s *Service) Run() error

Run start the indexer service

type ServiceParams

type ServiceParams struct {
	ArkeoApi            string      `mapstructure:"arkeo_api" json:"arkeo_api"`
	TendermintApi       string      `mapstructure:"tendermint_api" json:"tendermint_api"`
	TendermintWs        string      `mapstructure:"tendermint_ws" json:"tendermint_ws"`
	ChainID             string      `mapstructure:"chain_id" json:"chain_id"`
	Bech32PrefixAccAddr string      `mapstructure:"bech32_pref_acc_addr" json:"bech32_pref_acc_addr"`
	Bech32PrefixAccPub  string      `mapstructure:"bech32_pref_acc_pub" json:"bech32_pref_acc_pub"`
	IndexerID           int64       `json:"-"`
	DB                  db.DBConfig `mapstructure:"db" json:"db"`
}

ServiceParams hold all necessary parameters for indexer app to run

Jump to

Keyboard shortcuts

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