Documentation
¶
Index ¶
- Constants
- Variables
- func BlockedAddresses() map[string]bool
- func EvmAppOptions(chainID string) error
- func GenValSet(nums int) *tmtypes.ValidatorSet
- func GenesisStateWithValSet(app *RealioNetwork, genesisState simapp.GenesisState, ...) simapp.GenesisState
- func GetMaccPerms() map[string][]string
- func MakeEncodingConfig() params.EncodingConfig
- func NewAvailableStaticPrecompiles(cdc codec.Codec, stakingKeeper stakingkeeper.Keeper, ...) map[common.Address]vm.PrecompiledContract
- func NewDefaultGenesisState(cdc codec.JSONCodec) simapp.GenesisState
- func NewEVMGenesisState() *evmtypes.GenesisState
- func NewErc20GenesisState() *erc20types.GenesisState
- func NoOpEVMOptions(_ string) error
- func RealioSigVerificationGasConsumer(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
- func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)
- func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)
- type BaseAppParamManager
- type EVMOptionsFn
- type GenesisState
- type MockErc20Keeper
- type RealioNetwork
- func (app *RealioNetwork) AppCodec() codec.Codec
- func (app *RealioNetwork) AutoCliOpts() autocli.AppOptions
- func (app *RealioNetwork) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *RealioNetwork) DefaultGenesis() map[string]json.RawMessage
- func (app *RealioNetwork) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *RealioNetwork) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *RealioNetwork) GetBaseApp() *baseapp.BaseApp
- func (app *RealioNetwork) GetIBCKeeper() *ibckeeper.Keeper
- func (app *RealioNetwork) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *RealioNetwork) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *RealioNetwork) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
- func (app *RealioNetwork) GetStakingKeeper() StakingKeeper
- func (app *RealioNetwork) GetStakingKeeperSDK() stakingkeeper.Keeper
- func (app *RealioNetwork) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *RealioNetwork) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *RealioNetwork) GetTxConfig() client.TxConfig
- func (app *RealioNetwork) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *RealioNetwork) InterfaceRegistry() types.InterfaceRegistry
- func (app *RealioNetwork) LegacyAmino() *codec.LegacyAmino
- func (app *RealioNetwork) LoadHeight(height int64) error
- func (app *RealioNetwork) ModuleAccountAddrs() map[string]bool
- func (app *RealioNetwork) Name() string
- func (app *RealioNetwork) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *RealioNetwork) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *RealioNetwork) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *RealioNetwork) RegisterTendermintService(clientCtx client.Context)
- func (app *RealioNetwork) RegisterTxService(clientCtx client.Context)
- func (app *RealioNetwork) ScheduleForkUpgrade(ctx sdk.Context)
- func (app *RealioNetwork) SimulationManager() *module.SimulationManager
- type StakingKeeper
- type Upgrade
Constants ¶
const (
Name = "realio-network"
)
Variables ¶
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{ GenTxValidator: genutiltypes.DefaultMessageValidator, }, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, multistaking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, multistaking.AddMultiStakingProposalHandler, multistaking.UpdateBondWeightProposalHandler, }, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, ibc.AppModuleBasic{}, ibctm.AppModuleBasic{}, authzmodule.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, vesting.AppModuleBasic{}, vm.AppModuleBasic{}, feemarket.AppModuleBasic{}, assetmodule.AppModuleBasic{}, bridgemodule.AppModuleBasic{}, consensus.AppModuleBasic{}, transfer.AppModuleBasic{AppModuleBasic: &ibctransfer.AppModuleBasic{}}, ) )
var ( DefaultConsensusParams = &tmproto.ConsensusParams{ Block: &tmproto.BlockParams{ MaxBytes: 200000, MaxGas: -1, }, Evidence: &tmproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, MaxBytes: 10000, }, Validator: &tmproto.ValidatorParams{ PubKeyTypes: []string{ tmtypes.ABCIPubKeyTypeEd25519, }, }, } MultiStakingCoinA = multistakingtypes.MultiStakingCoin{ Denom: "ario", Amount: math.NewIntFromUint64(1000000000000000000), BondWeight: math.LegacyMustNewDecFromStr("1.23"), } MultiStakingCoinB = multistakingtypes.MultiStakingCoin{ Denom: "arst", Amount: math.NewIntFromUint64(1000000000000000000), BondWeight: math.LegacyMustNewDecFromStr("0.12"), } )
DefaultConsensusParams defines the default Tendermint consensus params used in Evmos testing.
var ChainsCoinInfo = map[string]evmtypes.EvmCoinInfo{ "realionetwork_3301": { Denom: realionetworktypes.BaseDenom, ExtendedDenom: realionetworktypes.BaseDenom, DisplayDenom: realionetworktypes.BaseDenom, Decimals: 18, }, "realionetwork_3300": { Denom: realionetworktypes.BaseDenom, ExtendedDenom: realionetworktypes.BaseDenom, DisplayDenom: realionetworktypes.BaseDenom, Decimals: 18, }, "realionetworklocal_7777": { Denom: realionetworktypes.BaseDenom, ExtendedDenom: realionetworktypes.BaseDenom, DisplayDenom: realionetworktypes.BaseDenom, Decimals: 18, }, }
ChainsCoinInfo is a map of the chain id and its corresponding EvmCoinInfo that allows initializing the app with different coin info based on the chain id
var DefaultTestingAppInit func() (ibctesting.TestingApp, map[string]json.RawMessage) = SetupTestingApp
DefaultTestingAppInit defines the IBC application used for testing
var (
ForkHeight = int64(5989487)
)
Functions ¶
func BlockedAddresses ¶ added in v1.4.0
func EvmAppOptions ¶ added in v1.3.0
EvmAppOptions allows to setup the global configuration for the Cosmos EVM chain.
func GenValSet ¶ added in v0.9.3
func GenValSet(nums int) *tmtypes.ValidatorSet
func GenesisStateWithValSet ¶ added in v0.6.0
func GenesisStateWithValSet(app *RealioNetwork, genesisState simapp.GenesisState, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) simapp.GenesisState
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func MakeEncodingConfig ¶ added in v0.0.4
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates the EncodingConfig for realio network
func NewAvailableStaticPrecompiles ¶ added in v1.4.0
func NewAvailableStaticPrecompiles( cdc codec.Codec, stakingKeeper stakingkeeper.Keeper, distributionKeeper distributionkeeper.Keeper, bankKeeper cmn.BankKeeper, erc20Keeper erc20Keeper.Keeper, transferKeeper transferkeeper.Keeper, channelKeeper *channelkeeper.Keeper, evmKeeper *evmkeeper.Keeper, govKeeper govkeeper.Keeper, slashingKeeper slashingkeeper.Keeper, evidenceKeeper evidencekeeper.Keeper, multiStakingKeeper multistakingkeeper.Keeper, addrCodec address.Codec, valAddrCodec address.Codec, ) map[common.Address]vm.PrecompiledContract
NewAvailableStaticPrecompiles returns the list of all available static precompiled contracts from Cosmos EVM.
NOTE: this should only be used during initialization of the Keeper.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState(cdc codec.JSONCodec) simapp.GenesisState
NewDefaultGenesisState generates the default state for the application.
func NewEVMGenesisState ¶ added in v1.4.0
func NewEVMGenesisState() *evmtypes.GenesisState
NewEVMGenesisState returns the default genesis state for the EVM module.
NOTE: for the example chain implementation we need to set the default EVM denomination and enable ALL precompiles.
func NewErc20GenesisState ¶ added in v1.4.0
func NewErc20GenesisState() *erc20types.GenesisState
NewErc20GenesisState returns the default genesis state for the ERC20 module.
NOTE: for the example chain implementation we are also adding a default token pair, which is the base denomination of the chain (i.e. the WEVMOS contract).
func NoOpEVMOptions ¶ added in v1.3.0
NoOpEVMOptions is a no-op function that can be used when the app does not need any specific configuration.
func RealioSigVerificationGasConsumer ¶ added in v1.0.1
func RealioSigVerificationGasConsumer( meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params, ) error
func RegisterSwaggerAPI ¶ added in v0.6.0
RegisterSwaggerAPI registers swagger route with API Server
func SetupTestingApp ¶ added in v0.6.0
func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)
SetupTestingApp initializes the IBC-go testing application
Types ¶
type BaseAppParamManager ¶ added in v1.0.1
type BaseAppParamManager interface {
GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams
StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusParams)
}
BaseAppParamManager defines an interrace that BaseApp is expected to fullfil that allows upgrade handlers to modify BaseApp parameters.
type EVMOptionsFn ¶ added in v1.3.0
EVMOptionsFn defines a function type for setting app options specifically for the Cosmos EVM app. The function should receive the chainID and return an error if any.
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 an 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.
type MockErc20Keeper ¶ added in v1.0.1
type MockErc20Keeper struct{}
func (MockErc20Keeper) GetERC20PrecompileInstance ¶ added in v1.0.1
func (k MockErc20Keeper) GetERC20PrecompileInstance(_ sdk.Context, _ common.Address) (contract vm.PrecompiledContract, found bool, err error)
type RealioNetwork ¶ added in v0.6.0
type RealioNetwork struct {
*baseapp.BaseApp
// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
MultiStakingKeeper multistakingkeeper.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
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper transferkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
// Ethermint keepers
EvmKeeper *evmkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
Erc20Keeper erc20keeper.Keeper
// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
// Realio Network keepers
AssetKeeper assetmodulekeeper.Keeper
BridgeKeeper bridgemodulekeeper.Keeper
// contains filtered or unexported fields
}
RealioNetwork extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.
func New ¶
func New( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig simappparams.EncodingConfig, appOpts servertypes.AppOptions, evmAppOptions EVMOptionsFn, baseAppOptions ...func(*baseapp.BaseApp), ) *RealioNetwork
New returns a reference to an initialized blockchain app
func Setup ¶ added in v0.6.0
func Setup( isCheckTx bool, feemarketGenesis *feemarkettypes.GenesisState, numberVals int, ) *RealioNetwork
Setup initializes a new App. A Nop logger is set in App.
func (*RealioNetwork) AppCodec ¶ added in v0.6.0
func (app *RealioNetwork) AppCodec() codec.Codec
AppCodec returns an 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 (*RealioNetwork) AutoCliOpts ¶ added in v1.0.1
func (app *RealioNetwork) AutoCliOpts() autocli.AppOptions
AutoCliOpts returns the autocli options for the app.
func (*RealioNetwork) BeginBlocker ¶ added in v0.6.0
func (app *RealioNetwork) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
BeginBlocker runs the Tendermint ABCI BeginBlock logic. It executes state changes at the beginning of the new block for every registered module. If there is a registered fork at the current height, BeginBlocker will schedule the upgrade plan and perform the state migration (if any).
func (*RealioNetwork) DefaultGenesis ¶ added in v1.3.0
func (app *RealioNetwork) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*RealioNetwork) EndBlocker ¶ added in v0.6.0
EndBlocker updates every end block
func (*RealioNetwork) ExportAppStateAndValidators ¶ added in v0.6.0
func (app *RealioNetwork) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*RealioNetwork) GetBaseApp ¶ added in v0.6.0
func (app *RealioNetwork) GetBaseApp() *baseapp.BaseApp
GetBaseApp implements the TestingApp interface.
func (*RealioNetwork) GetIBCKeeper ¶ added in v0.6.0
func (app *RealioNetwork) GetIBCKeeper() *ibckeeper.Keeper
GetIBCKeeper implements the TestingApp interface.
func (*RealioNetwork) GetKey ¶ added in v0.6.0
func (app *RealioNetwork) 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 (*RealioNetwork) GetMemKey ¶ added in v0.6.0
func (app *RealioNetwork) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*RealioNetwork) GetScopedIBCKeeper ¶ added in v0.6.0
func (app *RealioNetwork) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
GetScopedIBCKeeper implements the TestingApp interface.
func (*RealioNetwork) GetStakingKeeper ¶ added in v0.6.0
func (app *RealioNetwork) GetStakingKeeper() StakingKeeper
GetStakingKeeper implements the TestingApp interface.
func (*RealioNetwork) GetStakingKeeperSDK ¶ added in v0.6.0
func (app *RealioNetwork) GetStakingKeeperSDK() stakingkeeper.Keeper
GetStakingKeeper implements the TestingApp interface.
func (*RealioNetwork) GetSubspace ¶ added in v0.6.0
func (app *RealioNetwork) 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 (*RealioNetwork) GetTKey ¶ added in v0.6.0
func (app *RealioNetwork) 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 (*RealioNetwork) GetTxConfig ¶ added in v0.6.0
func (app *RealioNetwork) GetTxConfig() client.TxConfig
GetTxConfig implementxs the TestingApp interface.
func (*RealioNetwork) InitChainer ¶ added in v0.6.0
func (app *RealioNetwork) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*RealioNetwork) InterfaceRegistry ¶ added in v0.6.0
func (app *RealioNetwork) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns an InterfaceRegistry
func (*RealioNetwork) LegacyAmino ¶ added in v0.6.0
func (app *RealioNetwork) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns SimApp'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 (*RealioNetwork) LoadHeight ¶ added in v0.6.0
func (app *RealioNetwork) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*RealioNetwork) ModuleAccountAddrs ¶ added in v0.6.0
func (app *RealioNetwork) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*RealioNetwork) Name ¶ added in v0.6.0
func (app *RealioNetwork) Name() string
Name returns the name of the App
func (*RealioNetwork) PreBlocker ¶ added in v1.0.1
func (app *RealioNetwork) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
PreBlocker application updates every pre block
func (*RealioNetwork) RegisterAPIRoutes ¶ added in v0.6.0
func (app *RealioNetwork) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*RealioNetwork) RegisterNodeService ¶ added in v1.0.1
func (app *RealioNetwork) RegisterNodeService(clientCtx client.Context, cfg config.Config)
func (*RealioNetwork) RegisterTendermintService ¶ added in v0.6.0
func (app *RealioNetwork) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*RealioNetwork) RegisterTxService ¶ added in v0.6.0
func (app *RealioNetwork) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*RealioNetwork) ScheduleForkUpgrade ¶ added in v0.6.0
func (app *RealioNetwork) ScheduleForkUpgrade(ctx sdk.Context)
ScheduleForkUpgrade executes any necessary fork logic for based upon the current block height and chain ID (mainnet or testnet). It sets an upgrade plan once the chain reaches the pre-defined upgrade height.
CONTRACT: for this logic to work properly it is required to:
- Release a non-breaking patch version so that the chain can set the scheduled upgrade plan at upgrade-height.
- Release the software defined in the upgrade-info
func (*RealioNetwork) SimulationManager ¶ added in v0.6.0
func (app *RealioNetwork) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type StakingKeeper ¶ added in v1.3.0
type StakingKeeper interface {
GetHistoricalInfo(ctx context.Context, height int64) (stakingtypes.HistoricalInfo, error)
}
type Upgrade ¶ added in v1.0.1
type Upgrade struct {
// Upgrade version name, for the upgrade handler, e.g. `v3`
UpgradeName string
// CreateUpgradeHandler defines the function that creates an upgrade handler
CreateUpgradeHandler func(*module.Manager, module.Configurator, BaseAppParamManager) upgradetypes.UpgradeHandler
// Store upgrades, should be used for any new modules introduced, new modules deleted, or store names renamed.
StoreUpgrades storetypes.StoreUpgrades
}
Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal must have written, in order for the state migration to go smoothly. An upgrade must implement this struct, and then set it in the app.go. The app.go will then define the handler.