Documentation ¶
Index ¶
- Variables
- func AddCommands(ctx *Context, cdc *wire.Codec, rootCmd *cobra.Command, appInit AppInit, ...)
- func AppendJSON(cdc *wire.Codec, baseJSON []byte, key string, value json.RawMessage) (appended []byte, err error)
- func ExportCmd(ctx *Context, cdc *wire.Codec, appExporter AppExporter) *cobra.Command
- func FreeTCPAddr() (addr, port string, err error)
- func GenTxCmd(ctx *Context, cdc *wire.Codec, appInit AppInit) *cobra.Command
- func GenerateCoinKey() (sdk.Address, string, error)
- func GenerateSaveCoinKey(clientRoot, keyName, keyPass string, overwrite bool) (sdk.Address, string, error)
- func InitCmd(ctx *Context, cdc *wire.Codec, appInit AppInit) *cobra.Command
- func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error
- func RunOrTimeout(cmd *cobra.Command, timeout time.Duration, t *testing.T) chan error
- func ShowNodeIDCmd(ctx *Context) *cobra.Command
- func ShowValidatorCmd(ctx *Context) *cobra.Command
- func SimpleAppGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
- func SimpleAppGenTx(cdc *wire.Codec, pk crypto.PubKey) (appGenTx, cliPrint json.RawMessage, validator tmtypes.GenesisValidator, ...)
- func StartCmd(ctx *Context, appCreator AppCreator) *cobra.Command
- func UnsafeResetAllCmd(ctx *Context) *cobra.Command
- type AppCreator
- type AppExporter
- type AppInit
- type Context
- type GenesisTx
- type SimpleGenTx
Constants ¶
This section is empty.
Variables ¶
var DefaultAppInit = AppInit{ AppGenTx: SimpleAppGenTx, AppGenState: SimpleAppGenState, }
simple default application init
Functions ¶
func AddCommands ¶
func AddCommands( ctx *Context, cdc *wire.Codec, rootCmd *cobra.Command, appInit AppInit, appCreator AppCreator, appExport AppExporter)
add server commands
func AppendJSON ¶ added in v0.16.0
func AppendJSON(cdc *wire.Codec, baseJSON []byte, key string, value json.RawMessage) (appended []byte, err error)
append a new json field to existing json message
func FreeTCPAddr ¶
Get a free address for a test tendermint server protocol is either tcp, http, etc
func GenerateCoinKey ¶
GenerateCoinKey returns the address of a public key, along with the secret phrase to recover the private key.
func GenerateSaveCoinKey ¶
func GenerateSaveCoinKey(clientRoot, keyName, keyPass string, overwrite bool) (sdk.Address, string, error)
GenerateSaveCoinKey returns the address of a public key, along with the secret phrase to recover the private key.
func PersistentPreRunEFn ¶
PersistentPreRunEFn returns a PersistentPreRunE function for cobra that initailizes the passed in context with a properly configured logger and config objecy
func RunOrTimeout ¶ added in v0.2.0
Run or Timout RunE of command passed in
func ShowNodeIDCmd ¶
ShowNodeIDCmd - ported from Tendermint, dump node ID to stdout
func ShowValidatorCmd ¶
ShowValidator - ported from Tendermint, show this node's validator info
func SimpleAppGenState ¶ added in v0.16.0
func SimpleAppGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
create the genesis app state
func SimpleAppGenTx ¶ added in v0.16.0
func SimpleAppGenTx(cdc *wire.Codec, pk crypto.PubKey) ( appGenTx, cliPrint json.RawMessage, validator tmtypes.GenesisValidator, err error)
Generate a genesis transaction
func StartCmd ¶
func StartCmd(ctx *Context, appCreator AppCreator) *cobra.Command
StartCmd runs the service passed in, either stand-alone, or in-process with tendermint
func UnsafeResetAllCmd ¶
UnsafeResetAllCmd - extension of the tendermint command, resets initialization
Types ¶
type AppCreator ¶
AppCreator lets us lazily initialize app, using home dir and other flags (?) to start
func ConstructAppCreator ¶ added in v0.16.0
func ConstructAppCreator(appFn func(log.Logger, dbm.DB) abci.Application, name string) AppCreator
ConstructAppCreator returns an application generation function
type AppExporter ¶
AppExporter dumps all app state to JSON-serializable structure
func ConstructAppExporter ¶ added in v0.16.0
func ConstructAppExporter(appFn func(log.Logger, dbm.DB) (json.RawMessage, error), name string) AppExporter
ConstructAppExporter returns an application export function
type AppInit ¶ added in v0.16.0
type AppInit struct { // flags required for application init functions FlagsAppGenState *pflag.FlagSet FlagsAppGenTx *pflag.FlagSet // create the application genesis tx AppGenTx func(cdc *wire.Codec, pk crypto.PubKey) ( appGenTx, cliPrint json.RawMessage, validator tmtypes.GenesisValidator, err error) // AppGenState creates the core parameters initialization. It takes in a // pubkey meant to represent the pubkey of the validator of this machine. AppGenState func(cdc *wire.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error) }
Core functionality passed from the application to the server init command
type GenesisTx ¶ added in v0.16.0
type GenesisTx struct { NodeID string `json:"node_id"` IP string `json:"ip"` Validator tmtypes.GenesisValidator `json:"validator"` AppGenTx json.RawMessage `json:"app_gen_tx"` }
genesis piece structure for creating combined genesis
type SimpleGenTx ¶ added in v0.16.0
simple genesis tx