keys

package
v0.0.0-...-c187892 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2016 License: GPL-3.0, GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultKeyType  = "ed25519,ripemd160"
	DefaultDir      = common.KeysPath
	DefaultHashType = "sha256"

	DefaultHost = "localhost"
	DefaultPort = "4767"
	TestPort    = "7674"
	TestAddr    = "http://" + DefaultHost + ":" + TestPort

	// set in before()
	DaemonAddr string

	KeysDir string
	KeyName string
	KeyAddr string
	KeyHost string
	KeyPort string

	//keygenCmd only
	NoPassword bool
	KeyType    string

	//hashCmd only
	HashType string
	HexByte  bool

	// lockCmd only
	UnlockTime int // minutes
)
View Source
var EKeys = &cobra.Command{
	Use:   "eris-keys",
	Short: "Generate and manage keys for producing signatures",
	Long:  "A tool for doing a bunch of cool stuff with keys.",
	Run:   func(cmd *cobra.Command, args []string) { cmd.Help() },
}
View Source
var ErrLocked = fmt.Errorf("account is locked")

Functions

func BuildKeysCommand

func BuildKeysCommand()

func Call

func Call(method string, args map[string]string) (string, error)

Call the http server

func Execute

func Execute()

func ExitConnectErr

func ExitConnectErr(err error)

func GetKey

func GetKey(addr []byte) (*crypto.Key, error)

func StartServer

func StartServer(host, port string) error

func WriteError

func WriteError(w http.ResponseWriter, err error)

func WriteResult

func WriteResult(w http.ResponseWriter, result string)

Types

type ErrConnectionRefused

type ErrConnectionRefused string

func (ErrConnectionRefused) Error

func (e ErrConnectionRefused) Error() string

type HTTPRequest

type HTTPRequest map[string]string

A request is just a map of args to be json marshalled

type HTTPResponse

type HTTPResponse struct {
	Response string
	Error    string
}

dead simple response struct

type Manager

type Manager struct {
	// contains filtered or unexported fields
}
var AccountManager *Manager

func NewManager

func NewManager(keyStore crypto.KeyStore) *Manager

func (*Manager) GetKey

func (am *Manager) GetKey(addr []byte) *crypto.Key

GetKey only returns unlocked keys

func (*Manager) KeyStore

func (am *Manager) KeyStore() crypto.KeyStore

func (*Manager) TimedUnlock

func (am *Manager) TimedUnlock(addr []byte, keyAuth string, timeout time.Duration) error

TimedUnlock unlocks the account with the given address. The account stays unlocked for the duration of timeout. A timeout of 0 unlocks the account until the program exits.

If the accout is already unlocked, TimedUnlock extends or shortens the active unlock timeout.

func (*Manager) Unlock

func (am *Manager) Unlock(addr []byte, keyAuth string) error

Unlock unlocks the given account indefinitely.

func (*Manager) Update

func (am *Manager) Update(addr []byte, authFrom, authTo string) (err error)

type PrivValidator

type PrivValidator struct {
	Address    []byte                 `json:"address"`
	PubKey     account.PubKeyEd25519  `json:"pub_key"`
	PrivKey    account.PrivKeyEd25519 `json:"priv_key"`
	LastHeight int                    `json:"last_height"`
	LastRound  int                    `json:"last_round"`
	LastStep   int                    `json:"last_step"`
}

Jump to

Keyboard shortcuts

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