Documentation
¶
Index ¶
- Variables
- func AddGenesisAccountCmd(ctx *server.Context, cdc *codec.Codec, ...) *cobra.Command
- func BuildModuleBasics(moduleBasics ...module.AppModuleBasic)
- func MakeCodec() *codec.Codec
- func NewAppCreator(creator func(log.Logger, dbm.DB) abci.Application) server.AppCreator
- func NewAppExporter(creator func(log.Logger, dbm.DB) abci.Application) server.AppExporter
- func NewCLICommand() *cobra.Command
- func NewServerCommand(params ServerCommandParams) *cobra.Command
- func QueryCmd(cdc *amino.Codec) *cobra.Command
- func TxCmd(cdc *amino.Codec) *cobra.Command
- type AppStarter
- func (app *AppStarter) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *AppStarter) Codec() *codec.Codec
- func (app *AppStarter) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *AppStarter) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string) (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
- func (app *AppStarter) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *AppStarter) InitializeStarter()
- func (app *AppStarter) LoadHeight(height int64) error
- func (app *AppStarter) ModuleAccountAddrs() map[string]bool
- func (app *AppStarter) SimulationManager() *module.SimulationManager
- type BlankModule
- func (bm BlankModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (bm BlankModule) EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate
- func (bm BlankModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (bm BlankModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (bm BlankModule) NewHandler() sdk.Handler
- func (bm BlankModule) NewQuerierHandler() sdk.Querier
- func (bm BlankModule) QuerierRoute() string
- func (bm BlankModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (bm BlankModule) Route() string
- type BlankModuleBasic
- func (bm BlankModuleBasic) DefaultGenesis() json.RawMessage
- func (bm BlankModuleBasic) GetQueryCmd(*codec.Codec) *cobra.Command
- func (bm BlankModuleBasic) GetTxCmd(*codec.Codec) *cobra.Command
- func (bm BlankModuleBasic) Name() string
- func (BlankModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (BlankModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (bm BlankModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisState
- type ServerCommandParams
Constants ¶
This section is empty.
Variables ¶
var ( ModuleBasics module.BasicManager Cdc *codec.Codec DefaultCLIHome = os.ExpandEnv("$HOME/.hellocli") DefaultNodeHome = os.ExpandEnv("$HOME/.hellod") )
nolint
Functions ¶
func AddGenesisAccountCmd ¶
func AddGenesisAccountCmd( ctx *server.Context, cdc *codec.Codec, defaultNodeHome, defaultClientHome string, ) *cobra.Command
AddGenesisAccountCmd returns add-genesis-account cobra Command.
func BuildModuleBasics ¶
func BuildModuleBasics(moduleBasics ...module.AppModuleBasic)
BuildModuleBasics adds more moduleBasics to the app
func NewAppCreator ¶
func NewAppCreator(creator func(log.Logger, dbm.DB) abci.Application) server.AppCreator
NewAppCreator wraps and returns a function for instantiaing an app
func NewAppExporter ¶
func NewAppExporter(creator func(log.Logger, dbm.DB) abci.Application) server.AppExporter
NewAppExporter wraps and returns a function for exporting application state
func NewCLICommand ¶
NewCLICommand returns a basic root CLI cmd to interact with a running SDK chain.
func NewServerCommand ¶
func NewServerCommand(params ServerCommandParams) *cobra.Command
NewServerCommand creates a new ServerCommandParams object
Types ¶
type AppStarter ¶
type AppStarter struct { *bam.BaseApp // AppStarter extends BaseApp Cdc *codec.Codec // Module Manager Mm *module.Manager // contains filtered or unexported fields }
AppStarter is a basic app
func NewAppStarter ¶
func NewAppStarter(appName string, logger log.Logger, db dbm.DB, moduleBasics ...module.AppModuleBasic) *AppStarter
NewAppStarter created a basic app with bank, auth, supply and any other ModuleBasics passed to it
func (*AppStarter) BeginBlocker ¶
func (app *AppStarter) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker runs before each block is committed.
func (*AppStarter) EndBlocker ¶
func (app *AppStarter) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker runs after each block is committed.
func (*AppStarter) ExportAppStateAndValidators ¶
func (app *AppStarter) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string, ) (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
ExportAppStateAndValidators returns the Genesis and AppState for the apps modules
func (*AppStarter) InitChainer ¶
func (app *AppStarter) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer is called by Tendermint to start the chain.
func (*AppStarter) InitializeStarter ¶
func (app *AppStarter) InitializeStarter()
InitializeStarter configures the app. NOTE ModuleBasics must be complete before calling this
func (*AppStarter) LoadHeight ¶
func (app *AppStarter) LoadHeight(height int64) error
LoadHeight loads the state at a given block height
func (*AppStarter) ModuleAccountAddrs ¶
func (app *AppStarter) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*AppStarter) SimulationManager ¶
func (app *AppStarter) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type BlankModule ¶
type BlankModule struct { BlankModuleBasic // contains filtered or unexported fields }
BlankModule implements the AppModule interface
func NewBlankModule ¶
func NewBlankModule(name string, keeper interface{}) BlankModule
NewBlankModule returns a new BlankModule with a given name and keeper.
func (BlankModule) BeginBlock ¶
func (bm BlankModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
BeginBlock can be empty.
func (BlankModule) EndBlock ¶
func (bm BlankModule) EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock can return an empty ValidatorUpdate
func (BlankModule) ExportGenesis ¶
func (bm BlankModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis can return nil
func (BlankModule) InitGenesis ¶
func (bm BlankModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis can return an empty ValidatorUpdate
func (BlankModule) NewHandler ¶
func (bm BlankModule) NewHandler() sdk.Handler
NewHandler should be overridden by the full module implementation
func (BlankModule) NewQuerierHandler ¶
func (bm BlankModule) NewQuerierHandler() sdk.Querier
NewQuerierHandler should be overridden in the full module implementation.
func (BlankModule) QuerierRoute ¶
func (bm BlankModule) QuerierRoute() string
QuerierRoute returns the ModuleName as a string to use for routing
func (BlankModule) RegisterInvariants ¶
func (bm BlankModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants is required by the AppModule interface.
func (BlankModule) Route ¶
func (bm BlankModule) Route() string
Route returns the module name as a string to use for query routing
type BlankModuleBasic ¶
type BlankModuleBasic struct {
ModuleName string
}
BlankModuleBasic implements the AppModuleBasic interface using a given ModuleName
func (BlankModuleBasic) DefaultGenesis ¶
func (bm BlankModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns a blank and empty genesis state
func (BlankModuleBasic) GetQueryCmd ¶
func (bm BlankModuleBasic) GetQueryCmd(*codec.Codec) *cobra.Command
GetQueryCmd should be overridden in the full module implementation.
func (BlankModuleBasic) GetTxCmd ¶
func (bm BlankModuleBasic) GetTxCmd(*codec.Codec) *cobra.Command
GetTxCmd should be overridden in the full module implementation.
func (BlankModuleBasic) Name ¶
func (bm BlankModuleBasic) Name() string
Name returns the modules name
func (BlankModuleBasic) RegisterCodec ¶
func (BlankModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec should be overridden in the full module implementation.
func (BlankModuleBasic) RegisterRESTRoutes ¶
func (BlankModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes should be overridden in the full module implementation
func (BlankModuleBasic) ValidateGenesis ¶
func (bm BlankModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis should be overridden in the full module implementation.
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState holds the genesis state data for every module
func NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState populates a GenesisState with each module's default
type ServerCommandParams ¶
type ServerCommandParams struct { CmdName string // name of the CLI command CmdDesc string // short description of its function AppCreator server.AppCreator // method for constructing an ABCI application AppExporter server.AppExporter // method for exporting the chain state of an ABCI application }
ServerCommandParams described the params needed to build a basic server CLI command.
func NewServerCommandParams ¶
func NewServerCommandParams(name string, desc string, creator server.AppCreator, exporter server.AppExporter) ServerCommandParams
NewServerCommandParams collects the params for a server command