handlers

package
v0.0.0-...-cf42d2a Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckStatus = func() *sevCmd {
	cmd := new(sevCmd)
	cmd.helpMsg = "serveridentity check 'ROOT_ID_CHAIN"
	cmd.description = "Trys to build the identity associated with the root id chain"
	cmd.execFunc = func(args []string) {
		if len(args) == 0 {
			fmt.Println("Not enough arguments")
			return
		}
		os.Args = args[1:]
		host := flag.String("host", "localhost:8088", "Change factomd location")
		details := flag.Bool("v", false, "Printout the full identity and keys")
		flag.Parse()

		factom.SetFactomdServer(*host)
		cid, err := primitives.HexToHash(args[1])
		if err != nil {
			fmt.Println(err)
			return
		}
		err = checkStatus(cid, *details)
		if err != nil {
			if *details {
				fmt.Println(err.Error())
			}
			fmt.Println(false)
			return
		}
	}
	Help.Add("Trys to build the identity associated with the root id chain", cmd)
	return cmd
}()
View Source
var Full = func() *sevCmd {
	identity.ShowBruteForce = PRINT_OUT
	cmd := new(sevCmd)
	cmd.helpMsg = "serveridentity full 'fresh'|ESAddress|elements"
	cmd.description = "Create new identity and subchain as well as entries in the subchain."
	cmd.execFunc = func(args []string) {
		os.Args = args
		flag.Parse()
		args = flag.Args()
		c := cli.New()
		c.HandleFunc("elements", elementsFull)
		c.HandleFunc("fresh", freshFull)
		c.HandleDefaultFunc(existingECFull)
		c.HandleFunc("help", func(args []string) {
			fmt.Println(cmd.helpMsg)
		})
		c.Execute(args)
	}
	Help.Add("Create a full Identity", cmd)
	return cmd
}()
View Source
var Get = func() *sevCmd {
	cmd := new(sevCmd)
	cmd.helpMsg = "serveridentity get pubkey|idkey|btc|privkey KEY"
	cmd.description = "Get a public key or identity key from a private key"
	cmd.execFunc = func(args []string) {
		os.Args = args
		flag.Parse()
		args = flag.Args()
		c := cli.New()
		c.Handle("pubkey", gpubKey)
		c.Handle("idkey", gidKey)
		c.Handle("btckey", gbtcKey)
		c.Handle("privkey", gprivKey)
		c.HandleDefaultFunc(func(args []string) {
			fmt.Println(cmd.helpMsg)
		})
		c.Execute(args)
	}
	Help.Add("Get a public key or identity key from a private key", cmd)
	return cmd
}()

*******************************

  • Cli Control * *******************************
View Source
var Help = NewHelper()
View Source
var NewKey = func() *sevCmd {
	cmd := new(sevCmd)
	cmd.helpMsg = "serveridentity newkey 'block'|'btc'"
	cmd.description = "Create a new key to add/replace"
	cmd.execFunc = func(args []string) {
		os.Args = args

		flag.Parse()
		args = flag.Args()
		c := cli.New()
		c.Handle("block", blockKey)
		c.Handle("btc", btcKey)
		c.HandleDefaultFunc(func(args []string) {
			fmt.Println(cmd.helpMsg)
		})
		c.Execute(args)
	}
	Help.Add("Create a new signing key", cmd)
	return cmd
}()

*******************************

  • Cli Control * *******************************
View Source
var NewMHash = func() *sevCmd {
	cmd := new(sevCmd)
	cmd.helpMsg = "serveridentity mhash"
	cmd.description = "Create a new Matryoshka Hash"
	cmd.execFunc = func(args []string) {
		os.Args = args
		sh := flag.Bool("s", false, "generate sh script")
		flag.Parse()
		newMHash(*sh)
	}
	Help.Add("Create a new Matryoshka Hash", cmd)
	return cmd
}()

*******************************

  • Cli Control * *******************************
View Source
var PRINT_CLI bool = true
View Source
var PRINT_OUT bool = true
View Source
var SCRIPTNAME string = "fullidentity"
View Source
var Start = func() *sevCmd {
	cmd := new(sevCmd)
	cmd.helpMsg = "serveridentity start 'fresh'|ESAddress"
	cmd.description = "Create new identity and subchain."
	cmd.execFunc = func(args []string) {
		os.Args = args
		flag.Parse()
		args = flag.Args()
		c := cli.New()
		c.HandleFunc("fresh", fresh)
		c.HandleDefaultFunc(existingEC)
		c.HandleFunc("help", func(args []string) {
			fmt.Println(cmd.helpMsg)
		})
		c.Execute(args)
	}
	Help.Add("Create new Identity", cmd)
	return cmd
}()

Functions

func GetInput

func GetInput(inputType string, message string) interface{}

func NewHelper

func NewHelper() *helper

func Print

func Print(str string)

func PrintBanner

func PrintBanner()

func PrintHeader

func PrintHeader(str string)

func PrintIdentity

func PrintIdentity(i *state.Identity)

Types

type BetterIEBEntry

type BetterIEBEntry struct {
	IEB    interfaces.IEBEntry
	Height uint32
}

type Input

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

func (*Input) ReadIn

func (i *Input) ReadIn() interface{}

type ReadInput

type ReadInput interface {
	// contains filtered or unexported methods
}

*******************************

  • Controls Sanitation * *******************************

Jump to

Keyboard shortcuts

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