app

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CannotDecodeTx       uint32 = 101
	CannotRecoverSender  uint32 = 102
	SenderNotFound       uint32 = 103
	AccountNonceMismatch uint32 = 104
	CannotPayGasFee      uint32 = 105
	GasLimitInvalid      uint32 = 106
	InvalidMinGasPrice   uint32 = 107
	HasPendingTx         uint32 = 108
	MempoolBusy          uint32 = 109
	GasLimitTooSmall     uint32 = 110
)

Variables

View Source
var (
	ClientID  = "zeniqsmartd"
	GitCommit = ""
	GitDate   = ""
	GitTag    = "v0.6.9"
)

set via linker flags

Functions

func CreateHistoryStore

func CreateHistoryStore(dataPath string, useLiteDB bool, maxLogResults int, logger log.Logger) (historyStore dbtypes.DB)

func CreateRootStore

func CreateRootStore(dataPath string, isArchiveMode bool) (*store.RootStore, *ads.ADS)

Types

type App

type App struct {
	CCRPC *ccrpc.CCrpcImp
	// contains filtered or unexported fields
}

func NewApp

func NewApp(config *param.ChainConfig, chainId *uint256.Int,
	genesisWatcherHeight int64, logger log.Logger, rpccl ccrpctypes.RpcClient) (app *App)

func (*App) BeginBlock

func (*App) BlockNum

func (app *App) BlockNum() int64

func (*App) ChainID

func (app *App) ChainID() *uint256.Int

func (*App) CheckTx

func (*App) CloseTrunk

func (app *App) CloseTrunk()

func (*App) CloseTxEngineContext

func (app *App) CloseTxEngineContext()

func (*App) Commit

func (app *App) Commit() abcitypes.ResponseCommit

func (*App) CrosschainInfo added in v0.6.8

func (app *App) CrosschainInfo(start, end int64) []*ccrpctypes.CCrpcTransferInfo

func (*App) DeliverTx

func (*App) EndBlock

func (*App) GetBlockForSync

func (app *App) GetBlockForSync(height int64) (blk []byte, err error)

func (*App) GetCCRPCForkBlock

func (app *App) GetCCRPCForkBlock() int64

func (*App) GetCheckTxContext

func (app *App) GetCheckTxContext() *types.Context

func (*App) GetCurrEpoch

func (app *App) GetCurrEpoch() *stake.Epoch

func (*App) GetHistoryOnlyContext

func (app *App) GetHistoryOnlyContext() *types.Context

func (*App) GetLastGasUsed

func (app *App) GetLastGasUsed() uint64

func (*App) GetLatestBlockNum

func (app *App) GetLatestBlockNum() int64

func (*App) GetRpcContext

func (app *App) GetRpcContext() *types.Context

func (*App) GetRpcContextAtHeight

func (app *App) GetRpcContextAtHeight(height int64) *types.Context

func (*App) GetRunTxContext

func (app *App) GetRunTxContext() *types.Context

func (*App) GetValidatorsInfo

func (app *App) GetValidatorsInfo() ValidatorsInfo

func (*App) GetWordState

func (app *App) GetWordState() *evmtc.WorldState

func (*App) HistoryStore

func (app *App) HistoryStore() dbtypes.DB

func (*App) Info

func (*App) InitChain

func (*App) IsArchiveMode

func (app *App) IsArchiveMode() bool

func (*App) LastBlockTxs added in v0.6.9

func (app *App) LastBlockTxs() []*types.Transaction

func (*App) ListSnapshots

func (app *App) ListSnapshots(snapshots abcitypes.RequestListSnapshots) abcitypes.ResponseListSnapshots

func (*App) LoadBlockInfo

func (app *App) LoadBlockInfo() *types.BlockInfo

func (*App) Logger

func (app *App) Logger() log.Logger

func (*App) OfferSnapshot

func (app *App) OfferSnapshot(snapshot abcitypes.RequestOfferSnapshot) abcitypes.ResponseOfferSnapshot

func (*App) Query

func (*App) RunTxForRpc

func (app *App) RunTxForRpc(gethTx *gethtypes.Transaction, sender gethcmn.Address, estimateGas bool, height int64) (*ebp.TxRunner, int64)

func (*App) RunTxForSbchRpc

func (app *App) RunTxForSbchRpc(gethTx *gethtypes.Transaction, sender gethcmn.Address, height int64) (*ebp.TxRunner, int64)

RunTxForSbchRpc is like RunTxForRpc, with two differences: 1. estimateGas is always false 2. run under context of block#height-1

func (*App) SetOption

func (app *App) SetOption(option abcitypes.RequestSetOption) abcitypes.ResponseSetOption

func (*App) Stop

func (app *App) Stop()

func (*App) SubscribeChainEvent

func (app *App) SubscribeChainEvent(ch chan<- types.ChainEvent) event.Subscription

SubscribeChainEvent registers a subscription of ChainEvent.

func (*App) SubscribeLogsEvent

func (app *App) SubscribeLogsEvent(ch chan<- []*gethtypes.Log) event.Subscription

SubscribeLogsEvent registers a subscription of []*types.Log.

func (*App) SumAllBalance

func (app *App) SumAllBalance() *uint256.Int

func (*App) WaitLock

func (app *App) WaitLock()

nolint

type GenesisData

type GenesisData struct {
	Validators []*Validator          `json:"validators"`
	Alloc      gethcore.GenesisAlloc `json:"alloc"`
}

func (GenesisData) StakingValidators

func (g GenesisData) StakingValidators() []*stake.Validator

type IApp

type IApp interface {
	ChainID() *uint256.Int
	GetRunTxContext() *types.Context
	GetRpcContext() *types.Context
	GetRpcContextAtHeight(height int64) *types.Context
	GetHistoryOnlyContext() *types.Context
	RunTxForRpc(gethTx *gethtypes.Transaction, sender gethcmn.Address, estimateGas bool, height int64) (*ebp.TxRunner, int64)
	RunTxForSbchRpc(gethTx *gethtypes.Transaction, sender gethcmn.Address, height int64) (*ebp.TxRunner, int64)
	GetCurrEpoch() *stake.Epoch
	GetLatestBlockNum() int64
	SubscribeChainEvent(ch chan<- types.ChainEvent) event.Subscription
	SubscribeLogsEvent(ch chan<- []*gethtypes.Log) event.Subscription
	LoadBlockInfo() *types.BlockInfo
	GetValidatorsInfo() ValidatorsInfo
	IsArchiveMode() bool
	GetBlockForSync(height int64) (blk []byte, err error)
	GetCCRPCForkBlock() int64
	CrosschainInfo(start, end int64) []*ccrpctypes.CCrpcTransferInfo
	LastBlockTxs() []*types.Transaction
}

type PendingReward

type PendingReward struct {
	Address  gethcmn.Address `json:"address"`
	EpochNum int64           `json:"epochNum"`
	Amount   string          `json:"amount"`
}

type SenderAndHeight

type SenderAndHeight struct {
	Sender gethcmn.Address
	Height int64
}

The value entry of signature cache. The Height helps in evicting old entries.

type Validator

type Validator struct {
	Address      gethcmn.Address `json:"address"`
	Pubkey       gethcmn.Hash    `json:"pubkey"`
	RewardTo     gethcmn.Address `json:"reward_to"`
	VotingPower  int64           `json:"voting_power"`
	Introduction string          `json:"introduction"`
	StakedCoins  gethcmn.Hash    `json:"staked_coins"`
	IsRetiring   bool            `json:"is_retiring"`
	MinerAddress crypto.Address  `json:"miner_address"`
}

func FromStakingValidator

func FromStakingValidator(v *stake.Validator) *Validator

func FromStakingValidators

func FromStakingValidators(vs []*stake.Validator) []*Validator

type ValidatorsInfo

type ValidatorsInfo struct {
	// StakingInfo
	GenesisMainnetBlockHeight int64            `json:"genesisMainnetBlockHeight"`
	CurrEpochNum              int64            `json:"currEpochNum"`
	Validators                []*Validator     `json:"validators"`
	ValidatorsUpdate          []*Validator     `json:"validatorsUpdate"`
	PendingRewards            []*PendingReward `json:"pendingRewards"`

	// MinGasPrice
	MinGasPrice     uint64 `json:"minGasPrice"`
	LastMinGasPrice uint64 `json:"lastMinGasPrice"`

	// App
	CurrValidators []*Validator `json:"currValidators"`
}

func NewValidatorsInfo

func NewValidatorsInfo(currValidators []*stake.Validator,
	stakingInfo stake.StakingInfo,
	minGasPrice, lastMinGasPrice uint64) ValidatorsInfo

Jump to

Keyboard shortcuts

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