Documentation
¶
Index ¶
- Constants
- Variables
- func AddWasmLimitsFlags(cmd *cobra.Command)
- func ModuleAccountAddrs() map[string]bool
- func ModuleAccountPerms() map[string][]string
- func ModuleBasics() module.BasicManager
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)
- func TrimQuotes(data string) string
- func WasmLimitsConfigTemplate() string
- type AkashApp
- func (app *AkashApp) AppCodec() codec.Codec
- func (app *AkashApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *AkashApp) BlockedAddrs() map[string]bool
- func (app *AkashApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *AkashApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *AkashApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *AkashApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *AkashApp) InterfaceRegistry() codectypes.InterfaceRegistry
- func (app *AkashApp) LegacyAmino() *codec.LegacyAmino
- func (app *AkashApp) LoadHeight(height int64) error
- func (app *AkashApp) ModuleAccountAddrs() map[string]bool
- func (app *AkashApp) Name() string
- func (app *AkashApp) NewProposalContext(header tmproto.Header) sdk.Context
- func (app *AkashApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *AkashApp) Precommitter(ctx sdk.Context)
- func (app *AkashApp) PrepareCheckStater(ctx sdk.Context)
- func (app *AkashApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *AkashApp) RegisterGRPCServerWithSkipCheckHeader(server gogogrpc.Server, skipCheckHeader bool)
- func (app *AkashApp) RegisterNodeService(cctx client.Context, cfg config.Config)
- func (app *AkashApp) RegisterTendermintService(cctx client.Context)
- func (app *AkashApp) RegisterTxService(clientCtx client.Context)
- func (app *AkashApp) SimulationManager() *module.SimulationManager
- func (app *AkashApp) TxConfig() client.TxConfig
- type GenesisState
- type HandlerOptions
- type SetupAppOption
- type SetupGenesisFn
- type TestnetAccount
- type TestnetConfig
- type TestnetDelegation
- type TestnetGovConfig
- type TestnetUpgrade
- type TestnetValidator
- type TestnetVotingPeriod
- type WasmLimitOverride
- type WasmLimits
Constants ¶
const (
AppName = "akash"
)
const WasmLimitsKeyPrefix = "wasm.limits"
WasmLimitsKeyPrefix is the app.toml table and flag prefix for Wasm static validation limits.
Variables ¶
var (
DefaultHome = os.ExpandEnv("$HOME/.akash")
)
Functions ¶
func AddWasmLimitsFlags ¶ added in v2.2.0
AddWasmLimitsFlags registers one start flag per limit. Environment variables (AKASH_WASM_LIMITS_<KEY>) are bound automatically by the CLI config handler.
func ModuleAccountAddrs ¶
func ModuleAccountPerms ¶
func ModuleBasics ¶
func ModuleBasics() module.BasicManager
ModuleBasics returns all app modules basics
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server
func TrimQuotes ¶
func WasmLimitsConfigTemplate ¶ added in v2.2.0
func WasmLimitsConfigTemplate() string
WasmLimitsConfigTemplate returns the [wasm.limits] app.toml section. Keys are commented out so nodes always follow the defaults built into the binary unless explicitly overridden.
Types ¶
type AkashApp ¶
AkashApp extends ABCI application
func InitAkashAppForTestnet ¶
func InitAkashAppForTestnet( app *AkashApp, db dbm.DB, tcfg *TestnetConfig, ) *AkashApp
InitAkashAppForTestnet is broken down into two sections: Required Changes: Changes that, if not made, will cause the testnet to halt or panic Optional Changes: Changes to customize the testnet to one's liking (lower vote times, fund accounts, etc)
func NewApp ¶
func NewApp( logger log.Logger, db dbm.DB, tio io.Writer, loadLatest bool, invCheckPeriod uint, skipUpgradeHeights map[int64]bool, encodingConfig sdkutil.EncodingConfig, appOpts servertypes.AppOptions, options ...func(*baseapp.BaseApp), ) *AkashApp
NewApp creates and returns a new Akash App.
func Setup ¶
func Setup(opts ...SetupAppOption) *AkashApp
Setup initializes a new AkashApp. A Nop logger is set in AkashApp.
func (*AkashApp) BeginBlocker ¶
BeginBlocker is a function in which application updates every begin block
func (*AkashApp) BlockedAddrs ¶
BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.
func (*AkashApp) EndBlocker ¶
EndBlocker is a function in which an application updates every end block
func (*AkashApp) ExportAppStateAndValidators ¶
func (app *AkashApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*AkashApp) GetSubspace ¶
func (app *AkashApp) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name.
func (*AkashApp) InitChainer ¶
func (app *AkashApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*AkashApp) InterfaceRegistry ¶
func (app *AkashApp) InterfaceRegistry() codectypes.InterfaceRegistry
InterfaceRegistry returns AkashApp's InterfaceRegistry
func (*AkashApp) LegacyAmino ¶
func (app *AkashApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns AkashApp's amino codec.
func (*AkashApp) LoadHeight ¶
LoadHeight method of AkashApp loads baseapp application version with given height
func (*AkashApp) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*AkashApp) NewProposalContext ¶
NewProposalContext returns a context with a branched version of the state that is safe to query during ProcessProposal.
func (*AkashApp) PreBlocker ¶
func (app *AkashApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
PreBlocker application updates before each begin block.
func (*AkashApp) Precommitter ¶
Precommitter application updates before the committal of a block after all transactions have been delivered.
func (*AkashApp) PrepareCheckStater ¶
func (*AkashApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*AkashApp) RegisterGRPCServerWithSkipCheckHeader ¶ added in v2.1.0
func (app *AkashApp) RegisterGRPCServerWithSkipCheckHeader(server gogogrpc.Server, skipCheckHeader bool)
RegisterGRPCServerWithSkipCheckHeader registers all gRPC services including the Akash Discovery service for version negotiation.
func (*AkashApp) RegisterNodeService ¶
RegisterNodeService registers the node gRPC Query service.
func (*AkashApp) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*AkashApp) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (*AkashApp) SimulationManager ¶
func (app *AkashApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState of the blockchain is represented here as a map of raw json messages key's 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.
func GenesisStateWithValSet ¶
func GenesisStateWithValSet(cdc codec.Codec) GenesisState
func NewDefaultGenesisState ¶
func NewDefaultGenesisState(cdc codec.Codec) GenesisState
NewDefaultGenesisState generates the default state for the application.
type HandlerOptions ¶
type HandlerOptions struct {
ante.HandlerOptions
CDC codec.BinaryCodec
GovKeeper *govkeeper.Keeper
}
HandlerOptions extends the SDK's AnteHandler options
type SetupAppOption ¶
type SetupAppOption func(*setupAppOptions)
func WithEncConfig ¶
func WithEncConfig(val sdkutil.EncodingConfig) SetupAppOption
func WithGenesis ¶
func WithGenesis(val SetupGenesisFn) SetupAppOption
type SetupGenesisFn ¶
type SetupGenesisFn func(cdc codec.Codec) GenesisState
type TestnetAccount ¶
type TestnetAccount struct {
Address sdk.AccAddress `json:"address"`
Balances []sdk.Coin `json:"balances"`
}
type TestnetConfig ¶
type TestnetConfig struct {
Accounts []TestnetAccount
Validators []TestnetValidator
Gov TestnetGovConfig
Upgrade TestnetUpgrade
}
type TestnetDelegation ¶
type TestnetDelegation struct {
Address sdk.AccAddress `json:"address"`
Amount sdk.Coin `json:"amount"`
}
type TestnetGovConfig ¶
type TestnetGovConfig struct {
VotingParams *struct {
VotingPeriod TestnetVotingPeriod `json:"voting_period,omitempty"`
ExpeditedVotePeriod TestnetVotingPeriod `json:"expedited_vote_period"`
} `json:"voting_params,omitempty"`
}
type TestnetUpgrade ¶
type TestnetUpgrade struct {
Name string
}
type TestnetValidator ¶
type TestnetValidator struct {
OperatorAddress sdk.Address
ConsensusAddress sdk.ConsAddress
ConsensusPubKey *types.Any
Status stakingtypes.BondStatus
Moniker string
Commission stakingtypes.Commission
MinSelfDelegation sdkmath.Int
Delegations []TestnetDelegation
}
type TestnetVotingPeriod ¶
func (*TestnetVotingPeriod) UnmarshalJSON ¶
func (t *TestnetVotingPeriod) UnmarshalJSON(data []byte) error
type WasmLimitOverride ¶ added in v2.2.0
WasmLimitOverride describes a limit whose effective value differs from the chain default.
type WasmLimits ¶ added in v2.2.0
type WasmLimits struct {
InitialMemoryLimitPages uint32 `mapstructure:"initial_memory_limit_pages"`
TableSizeLimitElements uint32 `mapstructure:"table_size_limit_elements"`
MaxImports uint32 `mapstructure:"max_imports"`
MaxFunctions uint32 `mapstructure:"max_functions"`
MaxFunctionParams uint32 `mapstructure:"max_function_params"`
MaxTotalFunctionParams uint32 `mapstructure:"max_total_function_params"`
MaxFunctionResults uint32 `mapstructure:"max_function_results"`
MaxFunctionLocals uint32 `mapstructure:"max_function_locals"`
MaxTotalFunctionLocals uint32 `mapstructure:"max_total_function_locals"`
}
WasmLimits mirrors wasmvmtypes.WasmLimits with concrete, chain-canonical values. The mapstructure tags are the single schema for app.toml keys, flag names and env vars.
CONSENSUS-CRITICAL: limits are applied when Wasm code is stored during block execution; all validators must run identical values.
func DefaultWasmLimits ¶ added in v2.2.0
func DefaultWasmLimits() WasmLimits
DefaultWasmLimits returns the consensus limits for validating uploaded contracts.
func ReadWasmLimits ¶ added in v2.2.0
func ReadWasmLimits(opts servertypes.AppOptions) (WasmLimits, error)
ReadWasmLimits reads limits from app options (flags > env > app.toml), falling back to DefaultWasmLimits for every key that is not set.
func (WasmLimits) Overrides ¶ added in v2.2.0
func (l WasmLimits) Overrides() []WasmLimitOverride
Overrides returns every limit whose value differs from DefaultWasmLimits.
func (WasmLimits) ToVM ¶ added in v2.2.0
func (l WasmLimits) ToVM() wasmvmtypes.WasmLimits
ToVM converts the limits into the wasmvm representation with every field explicitly set, so libwasmvm defaults never apply implicitly.
func (WasmLimits) Validate ¶ added in v2.2.0
func (l WasmLimits) Validate() error
Validate rejects zero limits; a zero limit rejects virtually every contract and almost always indicates a typo or an empty environment variable.