cmd

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultForwarderRetryCount = 5
	ForwarderRequestTimeout    = 5 * time.Second
)
View Source
const MaxConsentRequests = 100

Variables

View Source
var (
	ErrEnableAutomaticConsentFlagIsRequiredWithoutTTY = errors.New("--automatic-consent flag is required without TTY")
	ErrMsysUnsupported                                = errors.New("this command is not supported on msys, please use a standard windows terminal")
	ErrNoHostSpecified                                = errors.New("no host specified in the configuration")
)
View Source
var (
	ErrDoNotSetPubKeyInCommand = errors.New("do not set the public key through the command, use --pubkey flag instead")
)
View Source
var (
	ErrForceFlagIsRequiredWithoutTTY = errors.New("--force is required without TTY")
)
View Source
var ErrNoHealthyNodeAvailableForVersionCheck = errors.New("no healthy node available for version check")
View Source
var (
	ErrProgramIsNotInitialised = errors.New("first, you need initialise the program, using the `init` command")
)
View Source
var SupportedLogLevels = []string{
	zapcore.DebugLevel.String(),
	zapcore.InfoLevel.String(),
	zapcore.WarnLevel.String(),
	zapcore.ErrorLevel.String(),
}

Functions

func BuildCmdAnnotateKey

func BuildCmdAnnotateKey(w io.Writer, handler AnnotateKeyHandler, rf *RootFlags) *cobra.Command

func BuildCmdCommandSend

func BuildCmdCommandSend(w io.Writer, handler SendCommandHandler, rf *RootFlags) *cobra.Command

func BuildCmdCommandSign

func BuildCmdCommandSign(w io.Writer, handler SignCommandHandler, rf *RootFlags) *cobra.Command

func BuildCmdCreateWallet

func BuildCmdCreateWallet(w io.Writer, handler CreateWalletHandler, rf *RootFlags) *cobra.Command

func BuildCmdDeleteNetwork

func BuildCmdDeleteNetwork(w io.Writer, handler RemoveNetworkHandler, rf *RootFlags) *cobra.Command

func BuildCmdDeleteWallet

func BuildCmdDeleteWallet(w io.Writer, handler RemoveWalletHandler, rf *RootFlags) *cobra.Command

func BuildCmdDescribeKey

func BuildCmdDescribeKey(w io.Writer, handler DescribeKeyHandler, rf *RootFlags) *cobra.Command

func BuildCmdDescribeNetwork

func BuildCmdDescribeNetwork(w io.Writer, handler DescribeNetworkHandler, rf *RootFlags) *cobra.Command

func BuildCmdDescribePermissions

func BuildCmdDescribePermissions(w io.Writer, handler DescribePermissionsHandler, rf *RootFlags) *cobra.Command

func BuildCmdGenerateKey

func BuildCmdGenerateKey(w io.Writer, handler GenerateKeyHandler, rf *RootFlags) *cobra.Command

func BuildCmdGetInfoWallet

func BuildCmdGetInfoWallet(w io.Writer, handler GetInfoWalletHandler, rf *RootFlags) *cobra.Command

func BuildCmdGetVersion

func BuildCmdGetVersion(w io.Writer, handler GetVersionHandler, rf *RootFlags) *cobra.Command

func BuildCmdImportNetwork

func BuildCmdImportNetwork(w io.Writer, handler ImportNetworkFromSourceHandler, rf *RootFlags) *cobra.Command

func BuildCmdImportWallet

func BuildCmdImportWallet(w io.Writer, handler ImportWalletHandler, rf *RootFlags) *cobra.Command

func BuildCmdInit

func BuildCmdInit(w io.Writer, handler InitHandler, rf *RootFlags) *cobra.Command

func BuildCmdIsolateKey

func BuildCmdIsolateKey(w io.Writer, handler IsolateKeyHandler, rf *RootFlags) *cobra.Command

func BuildCmdListEndpoints

func BuildCmdListEndpoints(w io.Writer, handler ListEndpointsHandler, rf *RootFlags) *cobra.Command

func BuildCmdListKeys

func BuildCmdListKeys(w io.Writer, handler ListKeysHandler, rf *RootFlags) *cobra.Command

func BuildCmdListNetworks

func BuildCmdListNetworks(w io.Writer, handler ListNetworksHandler, rf *RootFlags) *cobra.Command

func BuildCmdListPermissions

func BuildCmdListPermissions(w io.Writer, handler ListPermissionsHandler, rf *RootFlags) *cobra.Command

func BuildCmdListWallets

func BuildCmdListWallets(w io.Writer, handler ListWalletsHandler, rf *RootFlags) *cobra.Command

func BuildCmdLocateNetworks

func BuildCmdLocateNetworks(w io.Writer, handler LocateNetworksHandler, rf *RootFlags) *cobra.Command

func BuildCmdPurgePermissions

func BuildCmdPurgePermissions(w io.Writer, handler PurgePermissionsHandler, rf *RootFlags) *cobra.Command

func BuildCmdRevokePermissions

func BuildCmdRevokePermissions(w io.Writer, handler RevokePermissionsHandler, rf *RootFlags) *cobra.Command

func BuildCmdRoot

func BuildCmdRoot(w io.Writer) *cobra.Command

func BuildCmdRotateKey

func BuildCmdRotateKey(w io.Writer, handler RotateKeyHandler, rf *RootFlags) *cobra.Command

func BuildCmdRunService

func BuildCmdRunService(w io.Writer, handler RunServiceHandler, rf *RootFlags) *cobra.Command

func BuildCmdSignMessage

func BuildCmdSignMessage(w io.Writer, handler SignMessageHandler, rf *RootFlags) *cobra.Command

func BuildCmdTaintKey

func BuildCmdTaintKey(w io.Writer, handler TaintKeyHandler, rf *RootFlags) *cobra.Command

func BuildCmdTxSend

func BuildCmdTxSend(w io.Writer, handler SendTxHandler, rf *RootFlags) *cobra.Command

func BuildCmdUntaintKey

func BuildCmdUntaintKey(w io.Writer, handler UntaintKeyHandler, rf *RootFlags) *cobra.Command

func BuildCmdVerifyMessage

func BuildCmdVerifyMessage(w io.Writer, handler VerifyMessageHandler, rf *RootFlags) *cobra.Command

func BuildJSONLogger

func BuildJSONLogger(level string, vegaPaths paths.Paths, logsDir paths.StatePath) (*zap.Logger, string, error)

func BuildLogger

func BuildLogger(output, level string) (*zap.Logger, error)

func DefaultConfig

func DefaultConfig() zap.Config

func Execute

func Execute(w *Writer)

func ListEndpoints

func ListEndpoints(w io.Writer, rf *RootFlags, f *ListEndpointsFlags) error

func NewCmdAnnotateKey

func NewCmdAnnotateKey(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdCommand

func NewCmdCommand(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdCommandSend

func NewCmdCommandSend(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdCommandSign

func NewCmdCommandSign(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdCompletion

func NewCmdCompletion(w io.Writer) *cobra.Command

func NewCmdCreateWallet

func NewCmdCreateWallet(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdDeleteNetwork

func NewCmdDeleteNetwork(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdDeleteWallet

func NewCmdDeleteWallet(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdDescribeKey

func NewCmdDescribeKey(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdDescribeNetwork

func NewCmdDescribeNetwork(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdDescribePermissions

func NewCmdDescribePermissions(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdGenerateKey

func NewCmdGenerateKey(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdGetInfoWallet

func NewCmdGetInfoWallet(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdImportNetwork

func NewCmdImportNetwork(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdImportWallet

func NewCmdImportWallet(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdInit

func NewCmdInit(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdIsolateKey

func NewCmdIsolateKey(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdKey

func NewCmdKey(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdListEndpoints

func NewCmdListEndpoints(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdListKeys

func NewCmdListKeys(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdListNetworks

func NewCmdListNetworks(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdListPermissions

func NewCmdListPermissions(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdListWallets

func NewCmdListWallets(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdLocateNetworks

func NewCmdLocateNetworks(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdMessage

func NewCmdMessage(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdNetwork

func NewCmdNetwork(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdPermissions

func NewCmdPermissions(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdPurgePermissions

func NewCmdPurgePermissions(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdRevokePermissions

func NewCmdRevokePermissions(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdRoot

func NewCmdRoot(w io.Writer) *cobra.Command

func NewCmdRotateKey

func NewCmdRotateKey(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdRunService

func NewCmdRunService(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdService

func NewCmdService(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdSignMessage

func NewCmdSignMessage(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdTaintKey

func NewCmdTaintKey(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdTx

func NewCmdTx(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdTxSend

func NewCmdTxSend(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdUntaintKey

func NewCmdUntaintKey(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdVerifyMessage

func NewCmdVerifyMessage(w io.Writer, rf *RootFlags) *cobra.Command

func NewCmdVersion

func NewCmdVersion(w io.Writer, rf *RootFlags) *cobra.Command

func NewUnsupportedFlagValueError

func NewUnsupportedFlagValueError(level string) error

func PrintAnnotateKeyResponse

func PrintAnnotateKeyResponse(w io.Writer, f AnnotateKeyFlags, res api.AdminAnnotateKeyResult)

func PrintCreateWalletResponse

func PrintCreateWalletResponse(w io.Writer, resp api.AdminCreateWalletResult)

func PrintDeleteNetworkResponse

func PrintDeleteNetworkResponse(w io.Writer, networkName string)

func PrintDeleteWalletResponse

func PrintDeleteWalletResponse(w io.Writer, walletName string)

func PrintDescribeKeyResponse

func PrintDescribeKeyResponse(w io.Writer, resp api.AdminDescribeKeyResult)

func PrintDescribeNetworkResponse

func PrintDescribeNetworkResponse(w io.Writer, resp api.AdminDescribeNetworkResult)

func PrintDescribePermissionsResult added in v0.55.0

func PrintDescribePermissionsResult(w io.Writer, resp api.AdminDescribePermissionsResult)

func PrintGenerateKeyResponse

func PrintGenerateKeyResponse(w io.Writer, req api.AdminGenerateKeyParams, resp api.AdminGenerateKeyResult)

func PrintGetVersionResponse

func PrintGetVersionResponse(w io.Writer, resp *version.GetVersionResponse)

func PrintGetWalletInfoResponse

func PrintGetWalletInfoResponse(w io.Writer, resp api.AdminDescribeWalletResult)

func PrintImportNetworkResponse

func PrintImportNetworkResponse(w io.Writer, resp api.AdminImportNetworkResult)

func PrintImportWalletResponse

func PrintImportWalletResponse(w io.Writer, resp api.AdminImportWalletResult)

func PrintInitResponse

func PrintInitResponse(w io.Writer, resp *InitResponse)

func PrintIsolateKeyResponse

func PrintIsolateKeyResponse(w io.Writer, resp api.AdminIsolateKeyResult)

func PrintListKeysResponse

func PrintListKeysResponse(w io.Writer, resp api.AdminListKeysResult)

func PrintListNetworksResult added in v0.55.0

func PrintListNetworksResult(w io.Writer, resp api.AdminListNetworksResult)

func PrintListPermissionsResponse

func PrintListPermissionsResponse(w io.Writer, resp api.AdminListPermissionsResult)

func PrintListWalletsResult added in v0.55.0

func PrintListWalletsResult(w io.Writer, resp api.AdminListWalletsResult)

func PrintLocateNetworksResponse

func PrintLocateNetworksResponse(w io.Writer, resp *LocateNetworksResponse)

func PrintPurgePermissionsResponse

func PrintPurgePermissionsResponse(w io.Writer, wallet string)

func PrintRevokePermissionsResponse

func PrintRevokePermissionsResponse(w io.Writer, req api.AdminRevokePermissionsParams)

func PrintRotateKeyResponse

func PrintRotateKeyResponse(w io.Writer, req api.AdminRotateKeyResult)

func PrintSignCommandResponse

func PrintSignCommandResponse(w io.Writer, req api.AdminSignTransactionResult, rf *RootFlags)

func PrintSignMessageResponse

func PrintSignMessageResponse(w io.Writer, req api.AdminSignMessageResult)

func PrintTXSendResponse added in v0.56.0

func PrintTXSendResponse(w io.Writer, resp api.AdminSendTransactionResult)

func PrintTaintKeyResponse

func PrintTaintKeyResponse(w io.Writer)

func PrintUntaintKeyResponse

func PrintUntaintKeyResponse(w io.Writer)

func PrintVerifyMessageResponse

func PrintVerifyMessageResponse(w io.Writer, isValid bool)

func RunService

func RunService(w io.Writer, rf *RootFlags, f *RunServiceFlags) error

func SendCommand

func SendCommand(w io.Writer, f *SendCommandFlags, rf *RootFlags, req *SendCommandRequest) error

func ValidateLogLevel

func ValidateLogLevel(level string) error

Types

type AnnotateKeyFlags

type AnnotateKeyFlags struct {
	Wallet         string
	PubKey         string
	PassphraseFile string
	Clear          bool
	RawMetadata    []string
}

func (*AnnotateKeyFlags) Validate

type CreateWalletFlags

type CreateWalletFlags struct {
	Wallet         string
	PassphraseFile string
}

func (*CreateWalletFlags) Validate

type DeleteNetworkFlags

type DeleteNetworkFlags struct {
	Network string
	Force   bool
}

func (*DeleteNetworkFlags) Validate

type DeleteWalletFlags

type DeleteWalletFlags struct {
	Wallet string
	Force  bool
}

func (*DeleteWalletFlags) Validate

type DescribeKeyFlags

type DescribeKeyFlags struct {
	Wallet         string
	PassphraseFile string
	PublicKey      string
}

func (*DescribeKeyFlags) Validate

type DescribeNetworkFlags

type DescribeNetworkFlags struct {
	Network string
}

func (*DescribeNetworkFlags) Validate

type DescribePermissionsFlags

type DescribePermissionsFlags struct {
	Wallet         string
	Hostname       string
	PassphraseFile string
}

func (*DescribePermissionsFlags) Validate

type Error

type Error struct {
	Err string `json:"error"`
}

type GenerateKeyFlags

type GenerateKeyFlags struct {
	Wallet         string
	PassphraseFile string
	RawMetadata    []string
}

func (*GenerateKeyFlags) Validate

type GenerateKeyHandler

type GenerateKeyHandler func(params api.AdminGenerateKeyParams) (api.AdminGenerateKeyResult, error)

type GetVersionHandler

type GetVersionHandler func() (*version.GetVersionResponse, error)

type GetWalletInfoFlags

type GetWalletInfoFlags struct {
	Wallet         string
	PassphraseFile string
}

func (*GetWalletInfoFlags) Validate

type ImportNetworkFlags

type ImportNetworkFlags struct {
	FilePath string
	URL      string
	Name     string
	Force    bool
}

func (*ImportNetworkFlags) Validate

type ImportWalletFlags

type ImportWalletFlags struct {
	Wallet             string
	PassphraseFile     string
	RecoveryPhraseFile string
	Version            uint32
}

func (*ImportWalletFlags) Validate

type InitFlags

type InitFlags struct {
	Force bool
}

type InitHandler

type InitHandler func(home string, f *InitFlags) (*InitResponse, error)

type InitResponse

type InitResponse struct {
	RSAKeys struct {
		PublicKeyFilePath  string `json:"publicKeyFilePath"`
		PrivateKeyFilePath string `json:"privateKeyFilePath"`
	} `json:"rsaKeys"`
}

func Init

func Init(home string, f *InitFlags) (*InitResponse, error)

type IsolateKeyFlags

type IsolateKeyFlags struct {
	Wallet         string
	PubKey         string
	PassphraseFile string
}

func (*IsolateKeyFlags) Validate

type ListEndpointsFlags

type ListEndpointsFlags struct {
	Network string
}

func (*ListEndpointsFlags) Validate

func (f *ListEndpointsFlags) Validate() error

type ListEndpointsHandler

type ListEndpointsHandler func(io.Writer, *RootFlags, *ListEndpointsFlags) error

type ListKeysFlags

type ListKeysFlags struct {
	Wallet         string
	PassphraseFile string
}

func (*ListKeysFlags) Validate

func (f *ListKeysFlags) Validate() (api.AdminListKeysParams, error)

type ListNetworksHandler

type ListNetworksHandler func() (api.AdminListNetworksResult, error)

type ListPermissionsFlags

type ListPermissionsFlags struct {
	Wallet         string
	PassphraseFile string
}

func (*ListPermissionsFlags) Validate

type ListWalletsHandler

type ListWalletsHandler func() (api.AdminListWalletsResult, error)

type LocateNetworksHandler

type LocateNetworksHandler func() (*LocateNetworksResponse, error)

type LocateNetworksResponse

type LocateNetworksResponse struct {
	Path string `json:"path"`
}

type LoggerError

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

func UnsupportedLoggerLevelError

func UnsupportedLoggerLevelError(l string) LoggerError

func (LoggerError) Error

func (e LoggerError) Error() string

type PurgePermissionsFlags

type PurgePermissionsFlags struct {
	Wallet         string
	PassphraseFile string
	Force          bool
}

func (*PurgePermissionsFlags) Validate

type PurgePermissionsHandler

type PurgePermissionsHandler func(api.AdminPurgePermissionsParams) error

type RemoveNetworkHandler added in v0.55.0

type RemoveNetworkHandler func(api.AdminRemoveNetworkParams) error

type RemoveWalletHandler added in v0.55.0

type RemoveWalletHandler func(api.AdminRemoveWalletParams) error

type RevokePermissionsFlags

type RevokePermissionsFlags struct {
	Wallet         string
	Hostname       string
	Force          bool
	PassphraseFile string
}

func (*RevokePermissionsFlags) Validate

type RevokePermissionsHandler

type RevokePermissionsHandler func(api.AdminRevokePermissionsParams) error

type RootFlags

type RootFlags struct {
	Output string
	Home   string
}

func (*RootFlags) Validate

func (f *RootFlags) Validate() error

type RotateKeyFlags

type RotateKeyFlags struct {
	Wallet                string
	PassphraseFile        string
	FromPublicKey         string
	ToPublicKey           string
	ChainID               string
	SubmissionBlockHeight uint64
	EnactmentBlockHeight  uint64
}

func (*RotateKeyFlags) Validate

func (f *RotateKeyFlags) Validate() (api.AdminRotateKeyParams, error)

type RunServiceFlags

type RunServiceFlags struct {
	Network                string
	EnableAutomaticConsent bool
	NoVersionCheck         bool
}

func (*RunServiceFlags) Validate

func (f *RunServiceFlags) Validate() error

type RunServiceHandler

type RunServiceHandler func(io.Writer, *RootFlags, *RunServiceFlags) error

type SendCommandFlags

type SendCommandFlags struct {
	Network        string
	NodeAddress    string
	Wallet         string
	PubKey         string
	PassphraseFile string
	Retries        uint64
	LogLevel       string
	RawCommand     string
	NoVersionCheck bool
}

func (*SendCommandFlags) Validate

func (f *SendCommandFlags) Validate() (*SendCommandRequest, error)

type SendCommandRequest

type SendCommandRequest struct {
	Network     string
	NodeAddress string
	Wallet      string
	Passphrase  string
	Retries     uint64
	LogLevel    string
	Request     *walletpb.SubmitTransactionRequest
}

type SendTxFlags

type SendTxFlags struct {
	Network        string
	NodeAddress    string
	Retries        uint64
	LogLevel       string
	RawTx          string
	NoVersionCheck bool
}

func (*SendTxFlags) Validate

type SignCommandFlags

type SignCommandFlags struct {
	Wallet          string
	PubKey          string
	PassphraseFile  string
	RawCommand      string
	TxBlockHeight   uint64
	ChainID         string
	TxBlockHash     string
	PowDifficulty   uint32
	PowHashFunction string
	Network         string
}

func (*SignCommandFlags) Validate

type SignMessageFlags

type SignMessageFlags struct {
	Wallet         string
	PubKey         string
	Message        string
	PassphraseFile string
}

func (*SignMessageFlags) Validate

type TaintKeyFlags

type TaintKeyFlags struct {
	Wallet         string
	PublicKey      string
	PassphraseFile string
}

func (*TaintKeyFlags) Validate

func (f *TaintKeyFlags) Validate() (api.AdminTaintKeyParams, error)

type TaintKeyHandler

type TaintKeyHandler func(api.AdminTaintKeyParams) error

type UntaintKeyFlags

type UntaintKeyFlags struct {
	Wallet         string
	PublicKey      string
	PassphraseFile string
}

func (*UntaintKeyFlags) Validate

type UntaintKeyHandler

type UntaintKeyHandler func(api.AdminUntaintKeyParams) error

type VerifyMessageFlags

type VerifyMessageFlags struct {
	Signature string
	Message   string
	PubKey    string
}

func (*VerifyMessageFlags) Validate

type Writer

type Writer struct {
	Out io.Writer
	Err io.Writer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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