app

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

func GetCodec() *amino.Codec

func MarshalJSONIndent

func MarshalJSONIndent(cdc *amino.Codec, obj interface{}) ([]byte, error)

attempt to make some pretty json

func SetupContext

func SetupContext(ctx *Context) error

SetupContext initializes config object and bind its to context

Types

type AppCreator

type AppCreator func(home string, logger log.Logger, traceStore string) (abci.Application, error)

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

type AppCreatorInit func(log.Logger, dbm.DB, io.Writer) abci.Application

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

type Chain struct {
	*baseapp.BaseApp
	// contains filtered or unexported fields
}

func NewChain

func NewChain(logger log.Logger, db db.DB, traceStore io.Writer) *Chain

func (*Chain) ExportAppStateJSON

func (c *Chain) ExportAppStateJSON() (json.RawMessage, []types.GenesisValidator, error)

type Context

type Context struct {
	Config *cfg.Config
	Logger log.Logger
}

server context

type GenesisState

type GenesisState struct {
	Accounts []account.Account `json:"accounts"`
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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