cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: LGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REVERT_TO_HEIGHT   = "revert_to_height"
	REVERT_APP_NAME    = "revert_app_name"
	REVERT_BRANCH_NAME = "revert_pre_branch_name"
)

for the case of conflicting with names already exist

View Source
const (
	APP_TOOL   = 1
	BLOCK_TOOL = 1 << 1
	STATE_TOOL = 1 << 2
	PRIV_TOOL  = 1 << 3
)
View Source
const (
	CONFPATH = "confpath"
)

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "ann",
	Short: "Proof-of-stake blockchain from ZhongAn Technology",
	Long: `
This is the binary of the Annchain developed by ZhongAn Technology.
The project's code name is annchain, cause we wanna mimic the structure of Human Civilization. With our annchain, you can run multiple subchains in each node simultaneously to form a very sophisticated network which will represent your role in many different organizations.
`,
	Run: func(cmd *cobra.Command, args []string) {
		if err := cmd.Help(); err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func CivilPath

func CivilPath() string

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type AppToolItfc

type AppToolItfc interface {
	Init(datadir string) error
	LastHeightHash() (def.INT, []byte)
	BackupLastBlock(branchName string) error
	DelBackup(branchName string)
	RevertFromBackup(branchName string) error
	SaveNewLastBlock(fromHeight def.INT, fromAppHash []byte) error
}

type RevertTool

type RevertTool struct {
	// contains filtered or unexported fields
}

func (*RevertTool) Init

func (rt *RevertTool) Init(appname string, agconf, appconf *viper.Viper) error

Jump to

Keyboard shortcuts

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