Documentation ¶
Index ¶
- Variables
- func AppGenStateJSON(cdc *amino.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
- func CreateAppGenTx(cdc *amino.Codec, pk crypto.PubKey, gentTxConfig config.GenTx) (appGenTx, cliPrint json.RawMessage, validator types.GenesisValidator, ...)
- func CreateAppGenTxNF(cdc *amino.Codec, pk crypto.PubKey, addr string, gentTxConfig config.GenTx) (appGenTx, cliPrint json.RawMessage, validator types.GenesisValidator, ...)
- func GetCodec() *amino.Codec
- func GetInitChainer(am account.AccountMapper) func(types.Context, abci.RequestInitChain) abci.ResponseInitChain
- func MarshalJSONIndent(cdc *amino.Codec, obj interface{}) ([]byte, error)
- func SetupContext(ctx *Context) error
- type AppCreator
- type AppCreatorInit
- type AppExporter
- type AppExporterInit
- type AppGenTx
- type AppInit
- type Chain
- type Context
- type GenesisState
- type GenesisTx
Constants ¶
This section is empty.
Variables ¶
var ( // default home directories for expected binaries DefaultCLIHome = os.ExpandEnv("$HOME/.hmcli") DefaultNodeHome = os.ExpandEnv("$HOME/.hmd") MainStoreKey = sdk.NewKVStoreKey("main") ContractStoreKey = sdk.NewKVStoreKey("contract") TxIndexStoreKey = sdk.NewTransientStoreKey("tx_index") )
Functions ¶
func AppGenStateJSON ¶
func AppGenStateJSON(cdc *amino.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error)
AppGenState but with JSON
func CreateAppGenTx ¶
func CreateAppGenTx(cdc *amino.Codec, pk crypto.PubKey, gentTxConfig config.GenTx) ( appGenTx, cliPrint json.RawMessage, validator types.GenesisValidator, err error)
Generate a genesis transaction with flags pk: publickey of validator
func CreateAppGenTxNF ¶
func CreateAppGenTxNF(cdc *amino.Codec, pk crypto.PubKey, addr string, gentTxConfig config.GenTx) ( appGenTx, cliPrint json.RawMessage, validator types.GenesisValidator, err error)
Generate a genesis transaction without flags
func GetInitChainer ¶
func GetInitChainer(am account.AccountMapper) func(types.Context, abci.RequestInitChain) abci.ResponseInitChain
func MarshalJSONIndent ¶
attempt to make some pretty json
func SetupContext ¶
SetupContext initializes config object and bind its to context
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 AppExporter ¶
type AppExporter func(home string, logger log.Logger, traceStore string) (json.RawMessage, []tmtypes.GenesisValidator, error)
AppExporter reflects a function that dumps all app state to JSON-serializable structure and returns the current validator set.
func ConstructAppExporter ¶
func ConstructAppExporter(appFn AppExporterInit, name string) AppExporter
ConstructAppExporter returns an application export function.
type AppExporterInit ¶
type AppExporterInit func(log.Logger, dbm.DB, io.Writer) (json.RawMessage, []tmtypes.GenesisValidator, error)
AppExporterInit reflects a function that performs initialization of an AppExporter.
type AppGenTx ¶
type AppGenTx struct { // currently takes address as string because unmarshaling Ether address fails Address string `json:"address"` }
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 *amino.Codec, pk crypto.PubKey, genTxConfig config.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 *amino.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error) }
Core functionality passed from the application to the server init command
func NewAppInit ¶
func NewAppInit() AppInit
type Chain ¶
func (*Chain) ExportAppStateJSON ¶
func (c *Chain) ExportAppStateJSON() (json.RawMessage, []types.GenesisValidator, error)
type GenesisState ¶
State to Unmarshal
func AppGenState ¶
func AppGenState(cdc *amino.Codec, appGenTxs []json.RawMessage) (genesisState GenesisState, err error)
Create the core parameters for genesis initialization note that the pubkey input is this machines pubkey
type GenesisTx ¶
type GenesisTx struct { NodeID string `json:"node_id"` IP string `json:"ip"` Validator types.GenesisValidator `json:"validator"` AppGenTx json.RawMessage `json:"app_gen_tx"` }
simple genesis tx