Documentation ¶
Index ¶
- Constants
- Variables
- func AddCommands(ctx *Context, cdc *Codec, rootCmd *cobra.Command, appInit AppInit, ...)
- func GenTxCmd(ctx *Context, cdc *Codec, appInit AppInit) *cobra.Command
- func InitCmd(ctx *Context, cdc *Codec, appInit AppInit) *cobra.Command
- func InsertKeyJSON(cdc *Codec, baseJSON []byte, key string, value json.RawMessage) ([]byte, error)
- func MarshalJSONIndent(cdc *Codec, obj interface{}) ([]byte, error)
- func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error
- func RegisterCrypto(cdc *Codec)
- func ShowAddressCmd(ctx *Context) *cobra.Command
- func ShowNodeIDCmd(ctx *Context) *cobra.Command
- func ShowValidatorCmd(ctx *Context) *cobra.Command
- func SimpleAppGenState(cdc *Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
- func SimpleAppGenTx(cdc *Codec, pk crypto.PubKey, genTxConfig serverconfig.GenTx) (appGenTx, cliPrint json.RawMessage, validator tmtypes.GenesisValidator, ...)
- func StartCmd(ctx *Context, appCreator AppCreator) *cobra.Command
- func UnsafeResetAllCmd(ctx *Context) *cobra.Command
- type AppCreator
- type AppCreatorInit
- type AppInit
- type Codec
- type Context
- type GenesisTx
- type InitConfig
Constants ¶
const (
FlagJson = "json"
)
Variables ¶
var ( FlagName = "name" FlagClientHome = "home-client" FlagOWK = "owk" )
Parameter names, for init gen-tx command
var ( FlagOverwrite = "overwrite" FlagWithTxs = "with-txs" FlagIP = "ip" FlagChainID = "chain-id" )
parameter names, init command
var DefaultAppInit = AppInit{ AppGenTx: SimpleAppGenTx, AppGenState: SimpleAppGenState, }
simple default application init
Functions ¶
func AddCommands ¶
func AddCommands( ctx *Context, cdc *Codec, rootCmd *cobra.Command, appInit AppInit, appCreator AppCreator)
add server commands
func InsertKeyJSON ¶
InsertKeyJSON inserts a new JSON field/key with a given value to an existing JSON message. An error is returned if any serialization operation fails.
NOTE: The ordering of the keys returned as the resulting JSON message is non-deterministic, so the client should not rely on key ordering.
func MarshalJSONIndent ¶
func PersistentPreRunEFn ¶
PersistentPreRunEFn returns a PersistentPreRunE function for cobra that initailizes the passed in context with a properly configured logger and config objecy
func RegisterCrypto ¶
func RegisterCrypto(cdc *Codec)
func ShowAddressCmd ¶
ShowAddressCmd - show this node's validator address
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 ¶
func SimpleAppGenState(cdc *Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
create the genesis app state
func SimpleAppGenTx ¶
func SimpleAppGenTx(cdc *Codec, pk crypto.PubKey, genTxConfig serverconfig.GenTx) ( 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 reflects a function that allows us to lazily initialize an application using various configurations.
func ConstructAppCreator ¶
func ConstructAppCreator(appFn AppCreatorInit, name string) AppCreator
ConstructAppCreator returns an application generation function.
type AppCreatorInit ¶
AppCreatorInit reflects a function that performs initialization of an AppCreator.
type AppInit ¶
type AppInit struct { // flags required for application init functions FlagsAppGenState *pflag.FlagSet FlagsAppGenTx *pflag.FlagSet // create the application genesis tx AppGenTx func(cdc *Codec, pk crypto.PubKey, genTxConfig serverconfig.GenTx) ( 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 *Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error) }
Core functionality passed from the application to the server init command
type GenesisTx ¶
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