starter

package
v0.0.0-...-79a0367 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 MakeCodec

func MakeCodec() *codec.Codec

MakeCodec registers the structs for encoding in amino

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

func NewCLICommand() *cobra.Command

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

func QueryCmd

func QueryCmd(cdc *amino.Codec) *cobra.Command

QueryCmd builds a basic collection of query commands for your SDK CLI tool.

func TxCmd

func TxCmd(cdc *amino.Codec) *cobra.Command

TxCmd builds a basic collection of transaction commands.

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) Codec

func (app *AppStarter) Codec() *codec.Codec

Codec returns simapp's codec

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL