bootstrap

package
v1.7.45 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 30 Imported by: 4

Documentation

Index

Constants

View Source
const (
	MIGRATION_TABLE_NAME    = "schema_migrations"
	MIGRATION_GITHUB_TARGET = "github://%s:%s@crypto-com/chain-indexing/migrations%s"
)
View Source
const DEFAULT_MAX_RETRY_INTERVAL = 15 * time.Minute
View Source
const DEFAULT_MAX_RETRY_TIME = MAX_RETRY_TIME_ALWAYS_RETRY
View Source
const DEFAULT_POLLING_INTERVAL = 5 * time.Second
View Source
const INFO_DEFAULT_POLLING_INTERVAL = 5 * time.Second

TODO: Move InfoManager to CronJob

View Source
const MAX_RETRY_TIME_ALWAYS_RETRY = 0

Variables

This section is empty.

Functions

func NewApp

func NewApp(logger applogger.Logger, config *config.Config) *app

func SetupRDbConn

func SetupRDbConn(config *config.Config, logger applogger.Logger) (rdb.Conn, error)

Types

type HTTPAPIServer

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

func NewHTTPAPIServer

func NewHTTPAPIServer(logger applogger.Logger, config *config.Config) *HTTPAPIServer

func (*HTTPAPIServer) RegisterRoutes

func (server *HTTPAPIServer) RegisterRoutes(registry RouteRegistry)

func (*HTTPAPIServer) Run

func (server *HTTPAPIServer) Run() error

type IndexService

type IndexService struct {
	BlockResultEventAttributeDecodeMethod string

	GithubAPIUser  string
	GithubAPIToken string
	// contains filtered or unexported fields
}

func NewIndexService

func NewIndexService(
	logger applogger.Logger,
	rdbConn rdb.Conn,
	config *config.Config,
	projections []projection_entity.Projection,
	cronJobs []projection_entity.CronJob,
	txDecoder txdecoder.TxDecoder,
) *IndexService

NewIndexService creates a new server instance for polling and indexing

func (*IndexService) Run

func (service *IndexService) Run() error

func (*IndexService) RunEventStoreMode

func (service *IndexService) RunEventStoreMode() error

func (*IndexService) RunTendermintDirectMode

func (service *IndexService) RunTendermintDirectMode() error

type InfoManager

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

func NewInfoManager

func NewInfoManager(
	logger applogger.Logger,
	rdbConn rdb.Conn,
	tendermintRPCUrl string,
	insecureTendermintClient bool,
	strictGenesisParsing bool,
) *InfoManager

func (*InfoManager) Run

func (manager *InfoManager) Run()

type RouteRegistry

type RouteRegistry interface {
	Register(*httpapi.Server, string)
}

type SyncManager

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

func NewSyncManager

func NewSyncManager(
	params SyncManagerParams,
	pm *utils.CosmosParserManager,
	eventHandler eventhandler_interface.Handler,
) *SyncManager

NewSyncManager creates a new feed with polling for latest block starts at a specific height

func (*SyncManager) Run

func (manager *SyncManager) Run() error

Run starts the polling service for blocks

func (*SyncManager) SyncBlocks

func (manager *SyncManager) SyncBlocks(latestHeight int64, isRetry bool) error

SyncBlocks makes request to tendermint, create and dispatch notifications

type SyncManagerConfig

type SyncManagerConfig struct {
	WindowSize                            int
	TendermintRPCUrl                      string
	CosmosAppHTTPRPCURL                   string
	InsecureTendermintClient              bool
	InsecureCosmosAppClient               bool
	StrictGenesisParsing                  bool
	AccountAddressPrefix                  string
	StakingDenom                          string
	StartingBlockHeight                   int64
	BlockResultEventAttributeDecodeMethod string
}

type SyncManagerParams

type SyncManagerParams struct {
	Logger    applogger.Logger
	RDbConn   rdb.Conn
	TxDecoder txdecoder.TxDecoder

	Config SyncManagerConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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