cmd

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 121 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagHeight           = "height"
	FlagForZeroHeight    = "for-zero-height"
	FlagJailAllowedAddrs = "jail-allowed-addrs"
)
View Source
const (
	KeyAcc = "accounts"
	KeyEVM = "vm"
)
View Source
const (
	FlagListenAddr         = "laddr"
	FlagMaxOpenConnections = "max-open"
	FlagRPCReadTimeout     = "read-timeout"
	FlagRPCWriteTimeout    = "write-timeout"
	FlagWebsocket          = "wsport"
	GenesisFile            = "genesis.json"
	PrivValidatorKey       = "priv_validator_key.json"
)
View Source
const CorePrefix = "/core"
View Source
const DefaultCacheSize int = 100000
View Source
const (
	FlagStartHeight string = "start_height"
)
View Source
const (
	StartBlockHeight = 0
)

Variables

View Source
var (
	FlagName       = "name"
	FlagClientHome = "home-client"
	FlagOWK        = "owk"
)
View Source
var (
	FlagOverwrite  = "overwrite"
	FlagWithTxs    = "with-txs"
	FlagIP         = "ip"
	FlagChainID    = "chain_id"
	FlagEthChainID = "eth_chain_id"
	//FlagDBName = "dbname"
	FlagCoinName = "denom"
)
View Source
var LineBreak = &cobra.Command{Run: func(cmd *cobra.Command, args []string) {}}

Functions

func AddGenesisAccountCmd

func AddGenesisAccountCmd(ctx *app.Context, cdc *codec.Codec) *cobra.Command

func AddGenesisShardCmd

func AddGenesisShardCmd(ctx *app.Context, cdc *codec.Codec) *cobra.Command

func AddGenesisValidatorCmd

func AddGenesisValidatorCmd(ctx *app.Context, cdc *codec.Codec) *cobra.Command

func AddServerCommands

func AddServerCommands(
	ctx *app.Context,
	cdc *amino.Codec,
	rootCmd *cobra.Command,
	appInit app.AppInit,
	appCreator app.AppCreator,
	appExport app.AppExporter,
)

func CopyFile

func CopyFile(src, dst string) error

func CustomGRPCHeaderMatcher added in v1.6.8

func CustomGRPCHeaderMatcher(key string) (string, bool)

CustomGRPCHeaderMatcher for mapping request headers to GRPC metadata. HTTP headers that start with 'Grpc-Metadata-' are automatically mapped to gRPC metadata after removing prefix 'Grpc-Metadata-'. We can use this CustomGRPCHeaderMatcher if headers don't start with `Grpc-Metadata-`

func ExportCmd added in v1.5.23

func ExportCmd(appExporter app.AppExporter, defaultNodeHome string) *cobra.Command

func ExportConfigHandler added in v1.6.8

func ExportConfigHandler(ctx context.Context) http.HandlerFunc

func ExportEnv added in v1.6.8

func ExportEnv(ctx context.Context) http.HandlerFunc

func ExportLogHandler added in v1.6.8

func ExportLogHandler(ctx context.Context) http.HandlerFunc

func GetVersion

func GetVersion() version.Info

return version of CLI/node and commit hash

func Handle404 added in v1.6.8

func Handle404() http.Handler

func HealthCheckHandler added in v1.6.8

func HealthCheckHandler(ctx context.Context) http.HandlerFunc

func IaviewerPrintDiff added in v1.6.8

func IaviewerPrintDiff(cdc *codec.Codec, dataDir string, compareDir string, modules []string, height int)

IaviewerPrintDiff reads different key-value from leveldb according two paths

func InitWithConfig

func InitWithConfig(cdc *amino.Codec, appInit app.AppInit, c *cfg.Config, initConfig InitConfig) (
	chainID string, ethChainID uint64, nodeID string, appMessage json.RawMessage, pubKey crypto.PubKey, err error)

func MustSortJSON added in v1.5.23

func MustSortJSON(toSortJSON []byte) []byte

MustSortJSON is like SortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid.

func OpenDB added in v1.6.8

func OpenDB(dir string) (dbm.DB, error)

func ParseAccAddress

func ParseAccAddress(addr string) types.AccAddress

func ParseCoin

func ParseCoin(denom, amount string) (types.Coin, error)

func ReadTree added in v1.6.8

func ReadTree(dir string, version int, prefix []byte, cacheSize int) (*iavl.MutableTree, error)

ReadTree loads an iavl tree from the directory If version is 0, load latest, otherwise, load named version The prefix represents which iavl tree you want to read. The iaviwer will always set a prefix.

func SortJSON added in v1.5.23

func SortJSON(toSortJSON []byte) ([]byte, error)

func StartInProcess

func StartInProcess(ctx *app.Context, appCreator app.AppCreator, cdc *codec.Codec) (*node.Node, error)

func StartRestServer added in v1.6.8

func StartRestServer(cdc *codec.Codec, tmNode *node.Node, addr string) error

Types

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"`
}

type HeightParams added in v1.6.8

type HeightParams struct {
	Height string `json:"height"`
}

type InitConfig

type InitConfig struct {
	ChainID      string
	EthChainID   uint64
	GenTxs       bool
	GenTxsDir    string
	Overwrite    bool
	GenesisTime  time.Time
	Export       bool
	ValidatorKey string
}

type QueryParams added in v1.6.8

type QueryParams struct {
	Data HeightParams `json:"data"`
}

type Res added in v1.6.8

type Res struct {
	Ret     uint32             `json:"ret"`
	Data    ctypes.ResultBlock `json:"data"`
	Message string             `json:"message"`
}

type ResBlock added in v1.6.8

type ResBlock ctypes.ResultBlock

type Response added in v1.6.8

type Response struct {
	Ret     uint32      `json:"ret"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

type RestServer added in v1.6.8

type RestServer struct {
	Mux               *mux.Router
	GRPCGatewayRouter *runtime.ServeMux
	CliCtx            context.Context
	// contains filtered or unexported fields
}

RestServer represents the Light Client Rest server

func NewRestServer added in v1.6.8

func NewRestServer(cdc *codec.Codec, tmNode *node.Node) *RestServer

func (*RestServer) Start added in v1.6.8

func (rs *RestServer) Start(listenAddr string, maxOpen int, readTimeout, writeTimeout uint) (err error)

type ValidatorAccount

type ValidatorAccount struct {
	Address    string `json:"address"`
	PublicKey  string `json:"public_key"`
	PrivateKey string `json:"private_key"`
}

Jump to

Keyboard shortcuts

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