Documentation
¶
Overview ¶
Copyright 2021 Ethermint Foundation This file is part of Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Index ¶
- Constants
- Variables
- func GetMaccPerms() map[string][]string
- func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)
- type EthermintApp
- func EthSetup(isCheckTx bool, patchGenesis func(*EthermintApp, GenesisState) GenesisState) *EthermintApp
- func NewEthermintApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *EthermintApp
- func Setup(isCheckTx bool, feemarketGenesis *feemarkettypes.GenesisState) *EthermintApp
- func SetupWithDB(isCheckTx bool, patchGenesis func(*EthermintApp, GenesisState) GenesisState, ...) *EthermintApp
- func (app *EthermintApp) AppCodec() codec.Codec
- func (app *EthermintApp) AutoCliOpts() autocli.AppOptions
- func (app *EthermintApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *EthermintApp) BlockedAddrs() map[string]bool
- func (app *EthermintApp) Configurator() module.Configurator
- func (app *EthermintApp) DefaultGenesis() GenesisState
- func (app *EthermintApp) EncodingConfig() ethermint.EncodingConfig
- func (app *EthermintApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *EthermintApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *EthermintApp) GetBaseApp() *baseapp.BaseApp
- func (app *EthermintApp) GetIBCKeeper() *ibckeeper.Keeper
- func (app *EthermintApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *EthermintApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *EthermintApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
- func (app *EthermintApp) GetStakingKeeper() ibctestingtypes.StakingKeeper
- func (app *EthermintApp) GetStakingKeeperSDK() stakingkeeper.Keeper
- func (app *EthermintApp) GetStoreKeys() []storetypes.StoreKey
- func (app *EthermintApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *EthermintApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *EthermintApp) GetTxConfig() client.TxConfig
- func (app *EthermintApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *EthermintApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *EthermintApp) LegacyAmino() *codec.LegacyAmino
- func (app *EthermintApp) LoadHeight(height int64) error
- func (app *EthermintApp) ModuleAccountAddrs() map[string]bool
- func (app *EthermintApp) Name() string
- func (app *EthermintApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *EthermintApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *EthermintApp) RegisterTendermintService(clientCtx client.Context)
- func (app *EthermintApp) RegisterTxService(clientCtx client.Context)
- func (app *EthermintApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper ibctmmigrations.ClientKeeper)
- func (*EthermintApp) SimulationManager() *module.SimulationManager
- func (app *EthermintApp) TxConfig() client.TxConfig
- type GenesisState
Constants ¶
const ChainID = "ethermint_9000-1"
Variables ¶
var DefaultConsensusParams = &tmproto.ConsensusParams{ Block: &tmproto.BlockParams{ MaxBytes: 1048576, MaxGas: 81500000, }, Evidence: &tmproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, MaxBytes: 10000, }, Validator: &tmproto.ValidatorParams{ PubKeyTypes: []string{ tmtypes.ABCIPubKeyTypeEd25519, }, }, }
DefaultConsensusParams defines the default Tendermint consensus params used in EthermintApp testing.
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string )
var DefaultTestingAppInit func() (ibctesting.TestingApp, GenesisState) = SetupTestingApp
DefaultTestingAppInit defines the IBC application used for testing
Functions ¶
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
Types ¶
type EthermintApp ¶
type EthermintApp struct {
*baseapp.BaseApp
// keepers
AccountKeeper ethermintauthkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper crisiskeeper.Keeper
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
ICAHostKeeper icahostkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper transferkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
// ethermint keepers
EvmKeeper *evmkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
Erc20Keeper erc20keeper.Keeper
// the module manager
ModuleManager *module.Manager
BasicModuleManager module.BasicManager
// contains filtered or unexported fields
}
EthermintApp implements an extended ABCI application. It is an application that may process transactions through Ethereum's EVM running atop of Tendermint consensus.
func EthSetup ¶
func EthSetup(isCheckTx bool, patchGenesis func(*EthermintApp, GenesisState) GenesisState) *EthermintApp
Setup initializes a new EthermintApp. A Nop logger is set in EthermintApp.
func NewEthermintApp ¶
func NewEthermintApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *EthermintApp
NewEthermintApp returns a reference to a new initialized Ethermint application.
func Setup ¶
func Setup( isCheckTx bool, feemarketGenesis *feemarkettypes.GenesisState, ) *EthermintApp
Setup initializes a new Ethermint. A Nop logger is set in Ethermint.
func SetupWithDB ¶
func SetupWithDB(isCheckTx bool, patchGenesis func(*EthermintApp, GenesisState) GenesisState, db dbm.DB) *EthermintApp
SetupWithDB initializes a new EthermintApp. A Nop logger is set in EthermintApp.
func (*EthermintApp) AppCodec ¶
func (app *EthermintApp) AppCodec() codec.Codec
AppCodec returns EthermintApp's app codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*EthermintApp) AutoCliOpts ¶
func (app *EthermintApp) AutoCliOpts() autocli.AppOptions
AutoCliOpts returns the autocli options for the app.
func (*EthermintApp) BeginBlocker ¶
func (app *EthermintApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
BeginBlocker updates every begin block
func (*EthermintApp) BlockedAddrs ¶
func (app *EthermintApp) BlockedAddrs() map[string]bool
BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.
func (*EthermintApp) Configurator ¶
func (app *EthermintApp) Configurator() module.Configurator
func (*EthermintApp) DefaultGenesis ¶
func (app *EthermintApp) DefaultGenesis() GenesisState
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*EthermintApp) EncodingConfig ¶
func (app *EthermintApp) EncodingConfig() ethermint.EncodingConfig
func (*EthermintApp) EndBlocker ¶
EndBlocker updates every end block
func (*EthermintApp) ExportAppStateAndValidators ¶
func (app *EthermintApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*EthermintApp) GetBaseApp ¶
func (app *EthermintApp) GetBaseApp() *baseapp.BaseApp
GetBaseApp implements the TestingApp interface.
func (*EthermintApp) GetIBCKeeper ¶
func (app *EthermintApp) GetIBCKeeper() *ibckeeper.Keeper
GetIBCKeeper implements the TestingApp interface.
func (*EthermintApp) GetKey ¶
func (app *EthermintApp) GetKey(storeKey string) *storetypes.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*EthermintApp) GetMemKey ¶
func (app *EthermintApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*EthermintApp) GetScopedIBCKeeper ¶
func (app *EthermintApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
GetScopedIBCKeeper implements the TestingApp interface.
func (*EthermintApp) GetStakingKeeper ¶
func (app *EthermintApp) GetStakingKeeper() ibctestingtypes.StakingKeeper
GetStakingKeeper implements the TestingApp interface.
func (*EthermintApp) GetStakingKeeperSDK ¶
func (app *EthermintApp) GetStakingKeeperSDK() stakingkeeper.Keeper
GetStakingKeeperSDK implements the TestingApp interface.
func (*EthermintApp) GetStoreKeys ¶
func (app *EthermintApp) GetStoreKeys() []storetypes.StoreKey
GetStoreKeys returns all the stored store keys.
func (*EthermintApp) GetSubspace ¶
func (app *EthermintApp) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name.
NOTE: This is solely to be used for testing purposes.
func (*EthermintApp) GetTKey ¶
func (app *EthermintApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*EthermintApp) GetTxConfig ¶
func (app *EthermintApp) GetTxConfig() client.TxConfig
GetTxConfig implements the TestingApp interface.
func (*EthermintApp) InitChainer ¶
func (app *EthermintApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer updates at chain initialization
func (*EthermintApp) InterfaceRegistry ¶
func (app *EthermintApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns EthermintApp's InterfaceRegistry
func (*EthermintApp) LegacyAmino ¶
func (app *EthermintApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns EthermintApp's amino codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*EthermintApp) LoadHeight ¶
func (app *EthermintApp) LoadHeight(height int64) error
LoadHeight loads state at a particular height
func (*EthermintApp) ModuleAccountAddrs ¶
func (app *EthermintApp) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*EthermintApp) PreBlocker ¶
func (app *EthermintApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
PreBlocker updates every pre begin block
func (*EthermintApp) RegisterAPIRoutes ¶
func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*EthermintApp) RegisterNodeService ¶
func (app *EthermintApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
RegisterNodeService registers the node gRPC service on the provided application gRPC query router.
func (*EthermintApp) RegisterTendermintService ¶
func (app *EthermintApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*EthermintApp) RegisterTxService ¶
func (app *EthermintApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*EthermintApp) RegisterUpgradeHandlers ¶
func (app *EthermintApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper ibctmmigrations.ClientKeeper)
func (*EthermintApp) SimulationManager ¶
func (*EthermintApp) SimulationManager() *module.SimulationManager
SimulationManager implements runtime.AppI
func (*EthermintApp) TxConfig ¶
func (app *EthermintApp) TxConfig() client.TxConfig
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.
func GenesisStateWithValSet ¶
func GenesisStateWithValSet(codec codec.Codec, genesisState GenesisState, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) (GenesisState, error)
func NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for the application.
func NewTestGenesisState ¶
func NewTestGenesisState(codec codec.Codec) GenesisState
NewTestGenesisState generate genesis state with single validator
func SetupTestingApp ¶
func SetupTestingApp() (ibctesting.TestingApp, GenesisState)
SetupTestingApp initializes the IBC-go testing application