Documentation ¶
Index ¶
- Constants
- Variables
- func GetMaccPerms() map[string][]string
- func MakeEncodingConfig() params.EncodingConfig
- func MigrateGenesisCmd() *cobra.Command
- func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router)
- func SigVerificationGasConsumer(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
- type AltheaApp
- func (app *AltheaApp) AppCodec() codec.Codec
- func (app *AltheaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *AltheaApp) BlockedAddrs() map[string]bool
- func (app *AltheaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *AltheaApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *AltheaApp) GetBaseApp() *baseapp.BaseApp
- func (app *AltheaApp) GetIBCKeeper() *ibckeeper.Keeper
- func (app *AltheaApp) GetKey(storeKey string) *sdk.KVStoreKey
- func (app *AltheaApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
- func (app *AltheaApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
- func (app *AltheaApp) GetStakingKeeper() stakingkeeper.Keeper
- func (app *AltheaApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *AltheaApp) GetTKey(storeKey string) *sdk.TransientStoreKey
- func (app *AltheaApp) GetTxConfig() client.TxConfig
- func (app *AltheaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *AltheaApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *AltheaApp) LegacyAmino() *codec.LegacyAmino
- func (app *AltheaApp) LoadHeight(height int64) error
- func (app *AltheaApp) ModuleAccountAddrs() map[string]bool
- func (app *AltheaApp) Name() string
- func (app *AltheaApp) NewAnteHandlerOptions(appOpts servertypes.AppOptions) ante.HandlerOptions
- func (app *AltheaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *AltheaApp) RegisterTendermintService(clientCtx client.Context)
- func (app *AltheaApp) RegisterTxService(clientCtx client.Context)
- func (app *AltheaApp) SimulationManager() *module.SimulationManager
- func (app AltheaApp) ValidateMembers()
- type GenesisState
- type SimGenesisAccount
Constants ¶
const Name = "althea"
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{}, authzmodule.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, erc20client.RegisterCoinProposalHandler, erc20client.RegisterERC20ProposalHandler, erc20client.ToggleTokenConversionProposalHandler, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, lockup.AppModuleBasic{}, microtx.AppModuleBasic{}, onboarding.AppModuleBasic{}, nativedex.AppModuleBasic{}, evm.AppModuleBasic{}, erc20.AppModuleBasic{}, feemarket.AppModuleBasic{}, ica.AppModuleBasic{}, ) )
var DefaultConsensusParams = &abci.ConsensusParams{ Block: &abci.BlockParams{ MaxBytes: 200000, MaxGas: -1, }, 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. nolint: exhaustruct
Functions ¶
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func MakeEncodingConfig ¶
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates a ready-to-use EncodingConfig, loaded with all the interfaces needed during chain operation Note that this function registers both the legacy Amino format (for Ledger use) and also the new and recommended Protobuf format
func MigrateGenesisCmd ¶
MigrateGenesisCmd returns a command to execute genesis state migration.
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server TODO: build the custom swagger files and add here?
func SigVerificationGasConsumer ¶
func SigVerificationGasConsumer( meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params, ) error
SigVerificationGasConsumer is the Althea-Chain implementation of SignatureVerificationGasConsumer, based on Canto's version at https://github.com/Canto-Network/Canto in the app/sigverify.go file. It consumes gas for signature verification based upon the public key type. The cost is fetched from the given params and is matched by the concrete type. The types of keys supported are:
- secp256k1 (Cosmos keys)
HANDLED BY CANTO'S IMPLEMENTATION:
- ethsecp256k1 (Ethereum keys) - ed25519 (Validators) - multisig (Cosmos SDK multisigs)
Types ¶
type AltheaApp ¶
type AltheaApp struct { *baseapp.BaseApp // keepers // NOTE: If you add anything to this struct, add a nil check to ValidateMembers below! AccountKeeper *authkeeper.AccountKeeper AuthzKeeper *authzkeeper.Keeper BankKeeper *bankkeeper.BaseKeeper 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 IbcKeeper *ibckeeper.Keeper EvidenceKeeper *evidencekeeper.Keeper IbcTransferKeeper *ibctransferkeeper.Keeper EvmKeeper *evmkeeper.Keeper Erc20Keeper *erc20keeper.Keeper FeemarketKeeper *feemarketkeeper.Keeper IcaHostKeeper *icahostkeeper.Keeper LockupKeeper *lockupkeeper.Keeper MicrotxKeeper *microtxkeeper.Keeper GasfreeKeeper *gasfreekeeper.Keeper OnboardingKeeper *onboardingkeeper.Keeper NativedexKeeper *nativedexkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper *capabilitykeeper.ScopedKeeper ScopedTransferKeeper *capabilitykeeper.ScopedKeeper ScopedICAHostKeeper *capabilitykeeper.ScopedKeeper // the module manager MM *module.Manager // Configurator Configurator *module.Configurator // amino and proto encoding EncodingConfig altheaappparams.EncodingConfig // contains filtered or unexported fields }
AltheaApp extends an ABCI application
func NewAltheaApp ¶
func NewAltheaApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig altheaappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *AltheaApp
NewAltheaApp returns a reference to an initialized Althea chain To avoid implicit duplication of critical values (thanks, Go) and buggy behavior, we declare nearly every used value locally and provide references to/duplicates of those local vars to every related constructor after initialization
func Setup ¶
func Setup(isCheckTx bool, patchGenesis func(*AltheaApp, GenesisState) GenesisState) *AltheaApp
Setup initializes a new Althea app. A Nop logger is set in AltheaApp.
func (*AltheaApp) AppCodec ¶
AppCodec returns Althea Chain's 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 (*AltheaApp) BeginBlocker ¶
func (app *AltheaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker delegates the ABCI BeginBlock execution to the ModuleManager
func (*AltheaApp) BlockedAddrs ¶
BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.
func (*AltheaApp) EndBlocker ¶
func (app *AltheaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker delegates the ABCI EndBlock execution to the ModuleManager
func (*AltheaApp) ExportAppStateAndValidators ¶
func (app *AltheaApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*AltheaApp) GetBaseApp ¶
GetBaseApp returns the baseapp, used for testing
func (*AltheaApp) GetIBCKeeper ¶
GetIBCKeeper returns the IBC Keeper, used for testing
func (*AltheaApp) GetKey ¶
func (app *AltheaApp) GetKey(storeKey string) *sdk.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*AltheaApp) GetMemKey ¶
func (app *AltheaApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*AltheaApp) GetScopedIBCKeeper ¶
func (app *AltheaApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
GetScopedIBCKeeper returns the Scoped IBC Keeper, used for testing
func (*AltheaApp) GetStakingKeeper ¶
func (app *AltheaApp) GetStakingKeeper() stakingkeeper.Keeper
GetStakingKeeper returns the staking Keeper, used for testing
func (*AltheaApp) GetSubspace ¶
func (app *AltheaApp) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name. Reading params is fine, but they should be updated by governace proposal
func (*AltheaApp) GetTKey ¶
func (app *AltheaApp) GetTKey(storeKey string) *sdk.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*AltheaApp) GetTxConfig ¶
GetTxConfig returns the Encoding config's tx config, used for testing
func (*AltheaApp) InitChainer ¶
func (app *AltheaApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer deserializes the given chain genesis state, registers in-place upgrade migrations, and delegates the ABCI InitGenesis execution to the ModuleManager
func (*AltheaApp) InterfaceRegistry ¶
func (app *AltheaApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns Althea Chain's InterfaceRegistry which knows all of the Protobuf-defined interfaces and implementing types the chain is aware of
func (*AltheaApp) LegacyAmino ¶
func (app *AltheaApp) 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 (*AltheaApp) LoadHeight ¶
LoadHeight loads the blockchain a particular height
func (*AltheaApp) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*AltheaApp) NewAnteHandlerOptions ¶
func (app *AltheaApp) NewAnteHandlerOptions(appOpts servertypes.AppOptions) ante.HandlerOptions
func (*AltheaApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*AltheaApp) RegisterTendermintService ¶
RegisterTendermintService registers the /cosmos.base.tendermint.v1beta1.Service query endpoints on the baseapp's gRPC query router
func (*AltheaApp) RegisterTxService ¶
RegisterTxService registers all Protobuf-based Tx receiving gRPC services based on what is registered in the interface registry. These are stapled on to the baseapp's gRPC Query router
func (*AltheaApp) SimulationManager ¶
func (app *AltheaApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
func (AltheaApp) ValidateMembers ¶
func (app AltheaApp) ValidateMembers()
ValidateMembers checks for unexpected values, typically nil values needed for the chain to operate nolint: gocyclo
type GenesisState ¶
type GenesisState map[string]json.RawMessage
The genesis state 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 NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for the application.
type SimGenesisAccount ¶
type SimGenesisAccount struct { *authtypes.BaseAccount // vesting account fields OriginalVesting sdk.Coins `json:"original_vesting" yaml:"original_vesting"` // total vesting coins upon initialization DelegatedFree sdk.Coins `json:"delegated_free" yaml:"delegated_free"` // delegated vested coins at time of delegation DelegatedVesting sdk.Coins `json:"delegated_vesting" yaml:"delegated_vesting"` // delegated vesting coins at time of delegation StartTime int64 `json:"start_time" yaml:"start_time"` // vesting start time (UNIX Epoch time) EndTime int64 `json:"end_time" yaml:"end_time"` // vesting end time (UNIX Epoch time) // module account fields ModuleName string `json:"module_name" yaml:"module_name"` // name of the module account ModulePermissions []string `json:"module_permissions" yaml:"module_permissions"` // permissions of module account }
SimGenesisAccount defines a type that implements the GenesisAccount interface to be used for simulation accounts in the genesis state.
func (SimGenesisAccount) Validate ¶
func (sga SimGenesisAccount) Validate() error
Validate checks for errors on the vesting and module account parameters
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx).
|
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx). |
Package params defines the simulation parameters in the gaia.
|
Package params defines the simulation parameters in the gaia. |