Documentation
¶
Index ¶
- Constants
- type BaseApp
- func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)
- func (app *BaseApp) CheckPtx(txBytes []byte) abci.ResponseCheckTx
- func (app *BaseApp) CheckTx(txBytes []byte, local bool) abci.ResponseCheckTx
- func (app *BaseApp) Commit() (res abci.ResponseCommit)
- func (app *BaseApp) DeliverPtx(txBytes []byte) abci.ResponseDeliverTx
- func (app *BaseApp) DeliverTx(txBytes []byte) abci.ResponseDeliverTx
- func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock)
- func (app *BaseApp) GetTx(req abci.RequestGetTx) (res abci.ResponseGetTx)
- func (app *BaseApp) InitState(module, key, value string) error
- type EthermintApplication
- func (app *EthermintApplication) BeginBlock(beginBlock abciTypes.RequestBeginBlock) abciTypes.ResponseBeginBlock
- func (app *EthermintApplication) CheckPtx(tx *ethereum.ParalleledTransaction) abciTypes.ResponseCheckTx
- func (app *EthermintApplication) CheckTx(tx *ethTypes.Transaction) abciTypes.ResponseCheckTx
- func (app *EthermintApplication) CollectTx(tx *types.Transaction)
- func (app *EthermintApplication) Commit() abciTypes.ResponseCommit
- func (app *EthermintApplication) DeliverPtx(tx *ethereum.ParalleledTransaction) abciTypes.ResponseDeliverTx
- func (app *EthermintApplication) DeliverTx(tx *ethTypes.Transaction) abciTypes.ResponseDeliverTx
- func (app *EthermintApplication) EndBlock(endBlock abciTypes.RequestEndBlock) abciTypes.ResponseEndBlock
- func (app *EthermintApplication) GetTotalUsedGasFee() *big.Int
- func (app *EthermintApplication) GetUpdatedValidators() abciTypes.ResponseEndBlock
- func (app *EthermintApplication) Info(req abciTypes.RequestInfo) abciTypes.ResponseInfo
- func (app *EthermintApplication) InitChain(req abciTypes.RequestInitChain) abciTypes.ResponseInitChain
- func (app *EthermintApplication) IsPtxEnabled() bool
- func (app *EthermintApplication) Query(query abciTypes.RequestQuery) abciTypes.ResponseQuery
- func (app *EthermintApplication) Receiver() common.Address
- func (app *EthermintApplication) SetLogger(log tmLog.Logger)
- func (app *EthermintApplication) SetOption(req abciTypes.RequestSetOption) abciTypes.ResponseSetOption
- func (app *EthermintApplication) SetValidators(validators []*abciTypes.Validator)
- type FromTo
- type StoreApp
- func (app *StoreApp) AddValChange(diffs []*abci.Validator)
- func (app *StoreApp) Append() sm.SimpleDB
- func (app *StoreApp) Check() sm.SimpleDB
- func (app *StoreApp) Commit() (res abci.ResponseCommit)
- func (app *StoreApp) Committed() *sm.Bonsai
- func (app *StoreApp) CommittedHeight() int64
- func (app *StoreApp) EndBlock(_ abci.RequestEndBlock) (res abci.ResponseEndBlock)
- func (app *StoreApp) GetChainID() string
- func (app *StoreApp) Hash() []byte
- func (app *StoreApp) Info(req abci.RequestInfo) abci.ResponseInfo
- func (app *StoreApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain)
- func (app *StoreApp) Logger() log.Logger
- func (app *StoreApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)
- func (app *StoreApp) SetOption(res abci.RequestSetOption) abci.ResponseSetOption
- func (app *StoreApp) WorkingHeight() int64
- type TxDispatcher
- func (td *TxDispatcher) CheckTx(app *BaseApp, tx *ethTypes.Transaction) abci.ResponseCheckTx
- func (td *TxDispatcher) DeliverTx(app *BaseApp, tx *ethTypes.Transaction) abci.ResponseDeliverTx
- func (td *TxDispatcher) InitState(module string, key, value string, store state.SimpleDB) error
- func (td *TxDispatcher) RegisterTxHandler(txType string, handler types.TxHandler)
- func (td *TxDispatcher) UnregisterTxHandler(txType string)
Constants ¶
const DefaultHistorySize = 10
DefaultHistorySize is how many blocks of history to store for ABCI queries
const (
MinGasPrice = 2e9 // 2 Gwei
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseApp ¶
type BaseApp struct {
*StoreApp
EthApp *EthermintApplication
LastCommitInfo abci.LastCommitInfo
ByzantineValidators []abci.Evidence
Random *abci.VrfRandom
// contains filtered or unexported fields
}
BaseApp - The ABCI application
func NewBaseApp ¶
func NewBaseApp(store *StoreApp, ethApp *EthermintApplication, ethereum *eth.Ethereum) (*BaseApp, error)
BaseApp extends StoreApp, and dispatch tx to different modules via TxDispatcher
func (*BaseApp) BeginBlock ¶
func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)
BeginBlock - ABCI
func (*BaseApp) CheckPtx ¶
func (app *BaseApp) CheckPtx(txBytes []byte) abci.ResponseCheckTx
CheckTx - ABCI
func (*BaseApp) CheckTx ¶
func (app *BaseApp) CheckTx(txBytes []byte, local bool) abci.ResponseCheckTx
CheckTx - ABCI
func (*BaseApp) Commit ¶
func (app *BaseApp) Commit() (res abci.ResponseCommit)
func (*BaseApp) DeliverPtx ¶
func (app *BaseApp) DeliverPtx(txBytes []byte) abci.ResponseDeliverTx
DeliverTx - ABCI
func (*BaseApp) DeliverTx ¶
func (app *BaseApp) DeliverTx(txBytes []byte) abci.ResponseDeliverTx
DeliverTx - ABCI
func (*BaseApp) EndBlock ¶
func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock)
EndBlock - ABCI
func (*BaseApp) GetTx ¶
func (app *BaseApp) GetTx(req abci.RequestGetTx) (res abci.ResponseGetTx)
GetTx hash(request hash), from(from type), to(to type) Response is the result, hash or tx: the result can be multi-hash or multi-tx
type EthermintApplication ¶
type EthermintApplication struct {
// contains filtered or unexported fields
}
EthermintApplication implements an ABCI application #stable - 0.4.0
func NewEthermintApplication ¶
func NewEthermintApplication(backend *backend.Backend, client *rpc.Client, strategy *emtTypes.Strategy) (*EthermintApplication, error)
NewEthermintApplication creates a fully initialised instance of EthermintApplication #stable - 0.4.0
func (*EthermintApplication) BeginBlock ¶
func (app *EthermintApplication) BeginBlock(beginBlock abciTypes.RequestBeginBlock) abciTypes.ResponseBeginBlock
BeginBlock starts a new Ethereum block #stable - 0.4.0
func (*EthermintApplication) CheckPtx ¶
func (app *EthermintApplication) CheckPtx(tx *ethereum.ParalleledTransaction) abciTypes.ResponseCheckTx
CheckTx checks a transaction is valid but does not mutate the state #stable - 0.4.0
func (*EthermintApplication) CheckTx ¶
func (app *EthermintApplication) CheckTx(tx *ethTypes.Transaction) abciTypes.ResponseCheckTx
CheckTx checks a transaction is valid but does not mutate the state #stable - 0.4.0
func (*EthermintApplication) CollectTx ¶
func (app *EthermintApplication) CollectTx(tx *types.Transaction)
CollectTx invokes CollectTx on the strategy #unstable
func (*EthermintApplication) Commit ¶
func (app *EthermintApplication) Commit() abciTypes.ResponseCommit
Commit commits the block and returns a hash of the current state #stable - 0.4.0
func (*EthermintApplication) DeliverPtx ¶
func (app *EthermintApplication) DeliverPtx(tx *ethereum.ParalleledTransaction) abciTypes.ResponseDeliverTx
DeliverTx executes a transaction against the latest state #stable - 0.4.0
func (*EthermintApplication) DeliverTx ¶
func (app *EthermintApplication) DeliverTx(tx *ethTypes.Transaction) abciTypes.ResponseDeliverTx
DeliverTx executes a transaction against the latest state #stable - 0.4.0
func (*EthermintApplication) EndBlock ¶
func (app *EthermintApplication) EndBlock(endBlock abciTypes.RequestEndBlock) abciTypes.ResponseEndBlock
EndBlock accumulates rewards for the validators and updates them #stable - 0.4.0
func (*EthermintApplication) GetTotalUsedGasFee ¶
func (app *EthermintApplication) GetTotalUsedGasFee() *big.Int
func (*EthermintApplication) GetUpdatedValidators ¶
func (app *EthermintApplication) GetUpdatedValidators() abciTypes.ResponseEndBlock
GetUpdatedValidators returns an updated validator set from the strategy #unstable
func (*EthermintApplication) Info ¶
func (app *EthermintApplication) Info(req abciTypes.RequestInfo) abciTypes.ResponseInfo
func (*EthermintApplication) InitChain ¶
func (app *EthermintApplication) InitChain(req abciTypes.RequestInitChain) abciTypes.ResponseInitChain
InitChain initializes the validator set #stable - 0.4.0
func (*EthermintApplication) IsPtxEnabled ¶
func (app *EthermintApplication) IsPtxEnabled() bool
func (*EthermintApplication) Query ¶
func (app *EthermintApplication) Query(query abciTypes.RequestQuery) abciTypes.ResponseQuery
Query queries the state of the EthermintApplication #stable - 0.4.0
func (*EthermintApplication) Receiver ¶
func (app *EthermintApplication) Receiver() common.Address
Receiver returns the receiving address based on the selected strategy #unstable
func (*EthermintApplication) SetLogger ¶
func (app *EthermintApplication) SetLogger(log tmLog.Logger)
SetLogger sets the logger for the ethermint application #unstable
func (*EthermintApplication) SetOption ¶
func (app *EthermintApplication) SetOption(req abciTypes.RequestSetOption) abciTypes.ResponseSetOption
SetOption sets a configuration option #stable - 0.4.0
func (*EthermintApplication) SetValidators ¶
func (app *EthermintApplication) SetValidators(validators []*abciTypes.Validator)
SetValidators sets new validators on the strategy #unstable
type StoreApp ¶
type StoreApp struct {
// Name is what is returned from info
Name string
// contains filtered or unexported fields
}
StoreApp contains a data store and all info needed to perform queries and handshakes.
It should be embeded in another struct for CheckTx, DeliverTx and initializing state from the genesis.
func NewStoreApp ¶
NewStoreApp creates a data store to handle queries
func (*StoreApp) AddValChange ¶
AddValChange is meant to be called by apps on DeliverTx results, this is added to the cache for the endblock changeset
func (*StoreApp) Commit ¶
func (app *StoreApp) Commit() (res abci.ResponseCommit)
Commit implements abci.Application
func (*StoreApp) Committed ¶
Committed returns the committed state, also exposing historical queries
func (*StoreApp) CommittedHeight ¶
CommittedHeight gets the last block height committed to the db
func (*StoreApp) EndBlock ¶
func (app *StoreApp) EndBlock(_ abci.RequestEndBlock) (res abci.ResponseEndBlock)
EndBlock - ABCI Returns a list of all validator changes made in this block
func (*StoreApp) GetChainID ¶
GetChainID returns the currently stored chain
func (*StoreApp) Info ¶
func (app *StoreApp) Info(req abci.RequestInfo) abci.ResponseInfo
Info implements abci.Application. It returns the height and hash, as well as the abci name and version.
The height is the block that holds the transactions, not the apphash itself.
func (*StoreApp) InitChain ¶
func (app *StoreApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain)
InitChain - ABCI
func (*StoreApp) Query ¶
func (app *StoreApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)
Query - ABCI
func (*StoreApp) SetOption ¶
func (app *StoreApp) SetOption(res abci.RequestSetOption) abci.ResponseSetOption
SetOption - ABCI
func (*StoreApp) WorkingHeight ¶
WorkingHeight gets the current block we are writing
type TxDispatcher ¶
type TxDispatcher struct {
// contains filtered or unexported fields
}
func NewTxDispatcher ¶
func NewTxDispatcher() *TxDispatcher
func (*TxDispatcher) CheckTx ¶
func (td *TxDispatcher) CheckTx(app *BaseApp, tx *ethTypes.Transaction) abci.ResponseCheckTx
func (*TxDispatcher) DeliverTx ¶
func (td *TxDispatcher) DeliverTx(app *BaseApp, tx *ethTypes.Transaction) abci.ResponseDeliverTx
func (*TxDispatcher) RegisterTxHandler ¶
func (td *TxDispatcher) RegisterTxHandler(txType string, handler types.TxHandler)
func (*TxDispatcher) UnregisterTxHandler ¶
func (td *TxDispatcher) UnregisterTxHandler(txType string)