cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 39 Imported by: 1

Documentation

Index

Constants

View Source
const VersionMessage = `` /* 167-byte string literal not displayed */

Variables

View Source
var CLIDefault = CLI{

	Dataserver: DataserverCmd{},
	Report:     ReportCmd{},

	Transfer: TransferCmd{},
	Approve:  ApproveCmd{},
	Accounts: AccountsCmd{},
	Data:     DataCmd{},
	Balance:  BalanceCmd{},
	Stake: stakeCmd{
		Deposit:  DepositCmd{},
		Request:  RequestCmd{},
		Withdraw: WithdrawCmd{},
		Status:   StatusCmd{},
	},
	Dispute: disputeCmd{
		New:       NewDisputeCmd{},
		Vote:      VoteCmd{},
		List:      ListCmd{},
		Tally:     TallyCmd{},
		UnlockFee: UnlockFeeCmd{},
	},
	Encrypt: EncryptCmd{},
	Decrypt: DecryptCmd{},
	Version: VersionCmd{},
}

Functions

func CheckNewVersion

func CheckNewVersion(repo string, current string) (string, error)

func ValidateHex

func ValidateHex(account string) error

Types

type AccountArg

type AccountArg struct {
	Account string `arg:"" required:""`
}

func (*AccountArg) Validate

func (self *AccountArg) Validate() error

type AccountArgOptional

type AccountArgOptional struct {
	Account string `arg:"" optional:""`
}

func (*AccountArgOptional) Validate

func (self *AccountArgOptional) Validate() error

type AccountsCmd

type AccountsCmd struct {
}

func (*AccountsCmd) Run

func (self *AccountsCmd) Run() error

type ApproveCmd

type ApproveCmd tokenCmd

func (*ApproveCmd) Run

func (self *ApproveCmd) Run() error

type BalanceCmd

type BalanceCmd struct {
	AccountArg
}

func (*BalanceCmd) Run

func (self *BalanceCmd) Run() error

type CLI

type CLI struct {
	Cfg

	Dataserver DataserverCmd `cmd:"" help:"launch only a dataserver instance"`
	Report     ReportCmd     `cmd:"" help:"Submit data to the oracle contracts"`
	Submit     SubmitCmd     `cmd:"" help:"Make a single manual submit to the oracle contracts"`

	Transfer TransferCmd `cmd:"" help:"Transfer tokens"`
	Approve  ApproveCmd  `cmd:"" help:"Approve tokens"`
	Accounts AccountsCmd `cmd:"" help:"Show accounts"`
	Data     DataCmd     `cmd:"" help:"Retrieve data from the contract"`
	Balance  BalanceCmd  `cmd:"" help:"Check the balance of an address"`
	Stake    stakeCmd    `cmd:"" help:"Perform one of the stake operations"`
	Dispute  disputeCmd  `cmd:"" help:"Perform commands related to disputes"`
	Encrypt  EncryptCmd  `cmd:"" help:"Encrypts a file to be securely stored on disk and later used only with a password prompt"`
	Decrypt  DecryptCmd  `cmd:"" help:"Decrypts an ecrypted file and write the decrytped version to disk"`
	Events   eventsCmd   `cmd:"" help:"Subscribe to watch logs from the network."`
	Version  VersionCmd  `cmd:"" help:"Show the CLI version information"`
}

func (*CLI) AfterApply

func (self *CLI) AfterApply() error

type Cfg

type Cfg struct {
	Config string `type:"existingfile" help:"path to config file"`
}

type ContractFlag

type ContractFlag struct {
	Contract string `optional:"" help:"provide valid hex address"`
}

func (*ContractFlag) Validate

func (self *ContractFlag) Validate() error

type DataCmd

type DataCmd struct {
	From     uint64        `help:"the unix timestamp to use as a starting point for the data retrieval"`
	LookBack time.Duration `default:"2h" help:"how far to lookback"`
}

func (*DataCmd) Run

func (self *DataCmd) Run() error

type DataserverCmd

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

func (*DataserverCmd) Run

func (self *DataserverCmd) Run() error

func (*DataserverCmd) SetConfig

func (self *DataserverCmd) SetConfig(config *config.Config)

type DecryptCmd

type DecryptCmd struct {
	File string `arg:"" required:"" type:"existingfile" help:"the file to encrypt"`
}

func (*DecryptCmd) Run

func (self *DecryptCmd) Run() error

type DepositCmd

type DepositCmd struct {
	GasAccount
	ContractFlag
}

func (*DepositCmd) Run

func (self *DepositCmd) Run() error

type DispID

type DispID struct {
	DisputeID int64 `required:"" help:"the dispute id"`
}

type EncryptCmd

type EncryptCmd struct {
	File string `arg:"" required:"" type:"existingfile" help:"the file to encrypt"`
}

func (*EncryptCmd) Run

func (self *EncryptCmd) Run() error

type Gas

type Gas struct {
	GasBaseFee float64 `optional:"" help:"gas base fee to use when running the command"`
	GasTip     float64 `optional:"" help:"gas tip fee to use when running the command"`
}

func (*Gas) Validate

func (self *Gas) Validate() error

type GasAccount

type GasAccount struct {
	Gas
	AccountArg
}

type ListCmd

type ListCmd struct {
	ShowClosed bool `help:"also show executed disputes"`
	LookBck
	// contains filtered or unexported fields
}

func (*ListCmd) Run

func (self *ListCmd) Run() error

func (*ListCmd) SetConfig

func (self *ListCmd) SetConfig(config *config.Config)

type LookBck

type LookBck struct {
	LookBack time.Duration `default:"120h" help:"how far to lookback, the default only few days since disputes can be voted only for 2 days."`
}

type NewDisputeCmd

type NewDisputeCmd struct {
	GasAccount
	NoChks
	RequestID int64 `required:""  help:"the request id to dispute"`
	Timestamp int64 `required:""  help:"the submitted timestamp to dispute"`
	Slot      int64 `required:""  help:"the reporter index to dispute"`
}

func (*NewDisputeCmd) Run

func (self *NewDisputeCmd) Run() error

type NoChks

type NoChks struct {
	NoChecks bool `` /* 127-byte string literal not displayed */
}

type ReportCmd

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

func (*ReportCmd) Run

func (self *ReportCmd) Run() error

func (*ReportCmd) SetConfig

func (self *ReportCmd) SetConfig(config *config.Config)

type RequestCmd

type RequestCmd struct {
	GasAccount
}

func (*RequestCmd) Run

func (self *RequestCmd) Run() error

type StatusCmd

type StatusCmd struct {
	AccountArg
	ContractFlag
}

func (*StatusCmd) Run

func (self *StatusCmd) Run() error

type Submit

type Submit struct {
	Value      float64
	Suggested  float64
	MinerIndex int
	IsDisputed bool
}

type SubmitCmd

type SubmitCmd struct {
	Gas
	ContractFlag
	AccountArgOptional
	SkipConfirm bool `help:"submit without confirming, useful for testing"`
	// contains filtered or unexported fields
}

func (*SubmitCmd) Run

func (self *SubmitCmd) Run() error

func (*SubmitCmd) SetConfig

func (self *SubmitCmd) SetConfig(config *config.Config)

type TallyCmd

type TallyCmd struct {
	Gas
	DispID
}

func (*TallyCmd) Run

func (self *TallyCmd) Run() error

type TallyListCmd

type TallyListCmd struct {
	LookBck
}

func (*TallyListCmd) Run

func (self *TallyListCmd) Run() error

type TransferCmd

type TransferCmd tokenCmd

func (*TransferCmd) Run

func (self *TransferCmd) Run() error

type UnlockFeeCmd

type UnlockFeeCmd struct {
	NoChks
	Gas
	DispID
}

func (*UnlockFeeCmd) Run

func (self *UnlockFeeCmd) Run() error

type VersionCmd

type VersionCmd struct {
}

func (VersionCmd) Run

func (cmd VersionCmd) Run() error

type VoteCmd

type VoteCmd struct {
	GasAccount
	DispID
	NoChks
	Support bool `required:"" help:"true or false"`
}

func (*VoteCmd) Run

func (self *VoteCmd) Run() error

type WithdrawCmd

type WithdrawCmd struct {
	GasAccount
}

func (*WithdrawCmd) Run

func (self *WithdrawCmd) Run() error

Jump to

Keyboard shortcuts

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