infura

package
v0.0.0-...-69704c5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName   = types.ModuleName
	QuerierRoute = types.QuerierRoute
	RouterKey    = types.RouterKey
)
View Source
const (
	FlagEnable         = "infura.enable"
	FlagRedisUrl       = "infura.redis-url"
	FlagRedisAuth      = "infura.redis-auth"
	FlagRedisDB        = "infura.redis-db"
	FlagMysqlUrl       = "infura.mysql-url"
	FlagMysqlUser      = "infura.mysql-user"
	FlagMysqlPass      = "infura.mysql-pass"
	FlagMysqlDB        = "infura.mysql-db"
	FlagCacheQueueSize = "infura.cache-queue-size"
)

Variables

View Source
var TaskConstDesc = map[TaskConst]string{
	TaskStatusInvalid:                 "STREAM_TASK_STATUS_INVALID",
	TaskStatusSuccess:                 "STREAM_TASK_STATUS_SUCCESS",
	TaskStatusStatusFail:              "STREAM_TASK_STATUS_FAIL",
	TaskPhase1NextActionRestart:       "STREAM_TASK_PHRASE1_NEXT_ACTION_RESTART",
	TaskPhase1NextActionJumpNextBlock: "STREAM_TASK_PHRASE1_NEXT_ACTION_JUMP_NEXT_BLK",
	TaskPhase1NextActionNewTask:       "STREAM_TASK_PHRASE1_NEXT_ACTION_NEW_TASK",
	TaskPhase1NextActionReturnTask:    "STREAM_TASK_PHRASE1_NEXT_ACTION_RERUN_TASK",
	TaskPhase1NextActionUnknown:       "STREAM_TASK_PHRASE1_NEXT_ACTION_UNKNOWN",
	TaskPhase2NextActionRestart:       "STREAM_TASK_PHRASE2_NEXT_ACTION_RESTART",
	TaskPhase2NextActionJumpNextBlock: "STREAM_TASK_PHRASE2_NEXT_ACTION_JUMP_NEXT_BLK",
}

Functions

func BeginBlocker

func BeginBlocker(ctx sdk.Context, k Keeper)

BeginBlocker runs the logic of BeginBlocker with version 0. BeginBlocker resets keeper cache.

func EndBlocker

func EndBlocker(ctx sdk.Context, k Keeper)

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(k Keeper) AppModule

NewAppModule creates a new AppModule Object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)

func (AppModule) EndBlock

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

func (AppModule) Name

func (AppModule) Name() string

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

func (AppModule) Route

func (am AppModule) Route() string

type AppModuleBasic

type AppModuleBasic struct{}

app module Basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

Get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

Get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

Register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

Validation check of the Genesis

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) AddBlock

func (c *Cache) AddBlock(b evm.Block)

func (*Cache) AddContractCode

func (c *Cache) AddContractCode(address string, code []byte)

func (*Cache) AddTransaction

func (c *Cache) AddTransaction(t evm.Transaction)

func (*Cache) AddTransactionReceipt

func (c *Cache) AddTransactionReceipt(tr evm.TransactionReceipt)

func (*Cache) GetBlock

func (c *Cache) GetBlock() evm.Block

func (*Cache) GetContractCodes

func (c *Cache) GetContractCodes() map[string][]byte

func (*Cache) GetTransactionReceipts

func (c *Cache) GetTransactionReceipts() []evm.TransactionReceipt

func (*Cache) GetTransactions

func (c *Cache) GetTransactions() []evm.Transaction

func (*Cache) Reset

func (c *Cache) Reset()

type CacheQueue

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

func (*CacheQueue) Enqueue

func (cq *CacheQueue) Enqueue(sc StreamContext)

func (*CacheQueue) Start

func (cq *CacheQueue) Start()

type EvmKeeper

type EvmKeeper interface {
	SetObserverKeeper(keeper evm.InfuraKeeper)
}

type Keeper

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

nolint

func NewKeeper

func NewKeeper(evmKeeper EvmKeeper, logger log.Logger, metrics *monitor.StreamMetrics) Keeper

nolint

func (Keeper) OnSaveBlock

func (k Keeper) OnSaveBlock(b evm.Block)

func (Keeper) OnSaveContractCode

func (k Keeper) OnSaveContractCode(address string, code []byte)

func (Keeper) OnSaveTransaction

func (k Keeper) OnSaveTransaction(t evm.Transaction)

func (Keeper) OnSaveTransactionReceipt

func (k Keeper) OnSaveTransactionReceipt(tr evm.TransactionReceipt)

type MySQLEngine

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

func (*MySQLEngine) Write

func (e *MySQLEngine) Write(streamData types.IStreamData) bool

type Stream

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

Stream maintains the infura engine

func NewStream

func NewStream(logger log.Logger) *Stream

type StreamContext

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

type Task

type Task struct {
	Height    int64             `json:"height"`
	Done      bool              `json:"done"`
	UpdatedAt int64             `json:"updatedAt"`
	Data      types.IStreamData `json:"-"`
}

func (*Task) GetStatus

func (t *Task) GetStatus() TaskConst

type TaskConst

type TaskConst int
const (
	TaskStatusInvalid TaskConst = 0 + iota
	TaskStatusSuccess
	TaskStatusStatusFail
)
const (
	// Phase 1 task status
	TaskPhase1NextActionRestart TaskConst = 100 + iota
	TaskPhase1NextActionJumpNextBlock
	TaskPhase1NextActionNewTask
	TaskPhase1NextActionReturnTask
	TaskPhase1NextActionUnknown

	// Phase 2 task status
	TaskPhase2NextActionRestart TaskConst = 200 + iota
	TaskPhase2NextActionJumpNextBlock
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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