cli

package module
v0.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 58 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ContextTypeClient      = "context-client"
	ContextTypeQueryClient = "context-query-client"
)

Variables

View Source
var (
	ErrInvalidClient = errors.New("invalid client")
)
View Source
var FlagSplit = "split"

Functions

func AddBidFilterFlags

func AddBidFilterFlags(flags *pflag.FlagSet)

AddBidFilterFlags add flags to filter for bid list

func AddBidIDFlags

func AddBidIDFlags(flags *pflag.FlagSet, opts ...DeploymentIDOption)

AddBidIDFlags add flags for bid

func AddDeploymentFilterFlags

func AddDeploymentFilterFlags(flags *pflag.FlagSet)

AddDeploymentFilterFlags add flags to filter for deployment list

func AddDeploymentIDFlags

func AddDeploymentIDFlags(flags *pflag.FlagSet, opts ...DeploymentIDOption)

AddDeploymentIDFlags add flags for deployment except for Owner when NoOwner is set

func AddDepositorFlag

func AddDepositorFlag(flags *pflag.FlagSet)

AddDepositorFlag adds the `--depositor-account` flag

func AddGroupIDFlags

func AddGroupIDFlags(flags *pflag.FlagSet, opts ...DeploymentIDOption)

AddGroupIDFlags add flags for Group

func AddLeaseFilterFlags

func AddLeaseFilterFlags(flags *pflag.FlagSet)

AddLeaseFilterFlags add flags to filter for lease list

func AddLeaseIDFlags

func AddLeaseIDFlags(flags *pflag.FlagSet, opts ...DeploymentIDOption)

func AddOrderFilterFlags

func AddOrderFilterFlags(flags *pflag.FlagSet)

AddOrderFilterFlags add flags to filter for order list

func AddOrderIDFlags

func AddOrderIDFlags(flags *pflag.FlagSet, opts ...DeploymentIDOption)

AddOrderIDFlags add flags for order

func AddProviderFlag

func AddProviderFlag(flags *pflag.FlagSet)

AddProviderFlag add provider flag to command flags set

func AddQueryBidIDFlags

func AddQueryBidIDFlags(flags *pflag.FlagSet)

AddQueryBidIDFlags add flags for bid in query commands

func BidFiltersFromFlags

func BidFiltersFromFlags(flags *pflag.FlagSet) (v1beta5.BidFilters, error)

BidFiltersFromFlags returns BidFilters with given flags and error if occurred

func BidIDFromFlags

func BidIDFromFlags(flags *pflag.FlagSet, opts ...MarketOption) (v1.BidID, error)

BidIDFromFlags returns BidID with given flags and error if occurred Here provider value is taken from flags

func CollectGenTxsCmd

func CollectGenTxsCmd(genBalIterator types.GenesisBalancesIterator, defaultNodeHome string, validator types.MessageValidator) *cobra.Command

CollectGenTxsCmd - return the cobra command to collect genesis transactions

func ConvertBech32Cmd

func ConvertBech32Cmd() *cobra.Command

ConvertBech32Cmd get cmd to convert any bech32 address to an akash prefix.

func DepFiltersFromFlags

func DepFiltersFromFlags(flags *pflag.FlagSet) (dv1beta4.DeploymentFilters, error)

DepFiltersFromFlags returns DeploymentFilters with given flags and error if occurred

func DeploymentIDFromFlags

func DeploymentIDFromFlags(flags *pflag.FlagSet, opts ...MarketOption) (dv1.DeploymentID, error)

DeploymentIDFromFlags returns DeploymentID with given flags, owner and error if occurred

func DeploymentIDFromFlagsForOwner

func DeploymentIDFromFlagsForOwner(flags *pflag.FlagSet, owner sdk.Address) (dv1.DeploymentID, error)

DeploymentIDFromFlagsForOwner returns DeploymentID with given flags, owner and error if occurred

func DepositorFromFlags

func DepositorFromFlags(flags *pflag.FlagSet, owner string) (string, error)

DepositorFromFlags returns the depositor account if one was specified in flags, otherwise it returns the owner's account.

func DiscoverClient

func DiscoverClient(ctx context.Context, cctx sdkclient.Context, opts ...cltypes.ClientOption) (v1beta3.Client, error)

func DiscoverQueryClient

func DiscoverQueryClient(ctx context.Context, cctx sdkclient.Context) (v1beta3.LightClient, error)

func GetAccountAddressByIDCmd

func GetAccountAddressByIDCmd() *cobra.Command

GetAccountAddressByIDCmd returns a query account that will display the account address of a given account id.

func GetAccountCmd

func GetAccountCmd() *cobra.Command

GetAccountCmd returns a query account that will display the state of the account at a given address.

func GetAccountsCmd

func GetAccountsCmd() *cobra.Command

GetAccountsCmd returns a query command that will display a list of accounts

func GetDeploymentTxCmd

func GetDeploymentTxCmd(key string) *cobra.Command

GetDeploymentTxCmd returns the transaction commands for this module

func GetEscrowQueryCmd

func GetEscrowQueryCmd() *cobra.Command

func GetMarketTxCmd

func GetMarketTxCmd(key string) *cobra.Command

GetMarketTxCmd returns the transaction commands for market module

func GetMultiSignBatchCmd

func GetMultiSignBatchCmd() *cobra.Command

func GetMultiSignCommand

func GetMultiSignCommand() *cobra.Command

GetMultiSignCommand returns the multi-sign command

func GetQueryCmd

func GetQueryCmd() *cobra.Command

GetQueryCmd returns the transaction commands for this module

func GetSignBatchCommand

func GetSignBatchCommand() *cobra.Command

GetSignBatchCommand returns the transaction sign-batch command.

func GetSignCommand

func GetSignCommand() *cobra.Command

GetSignCommand returns the transaction sign command.

func GetTxCmd

func GetTxCmd() *cobra.Command

func GetTxEncoder

func GetTxEncoder(cdc *codec.LegacyAmino) (encoder sdk.TxEncoder)

GetTxEncoder return tx encoder from global sdk configuration if ones is defined. Otherwise returns encoder with default logic.

func GetValidateSignaturesCommand

func GetValidateSignaturesCommand() *cobra.Command

func GetVestingTxCmd

func GetVestingTxCmd() *cobra.Command

GetVestingTxCmd returns vesting module's transaction commands.

func GroupIDFromFlags

func GroupIDFromFlags(flags *pflag.FlagSet, opts ...MarketOption) (dv1.GroupID, error)

GroupIDFromFlags returns GroupID with given flags and error if occurred

func LeaseCalcBalanceRemain

func LeaseCalcBalanceRemain(balance sdk.Dec, currBlock, settledAt int64, leasePrice sdk.Dec) float64

func LeaseCalcBlocksRemain

func LeaseCalcBlocksRemain(balance float64, leasePrice sdk.Dec) int64

func LeaseFiltersFromFlags

func LeaseFiltersFromFlags(flags *pflag.FlagSet) (v1.LeaseFilters, error)

LeaseFiltersFromFlags returns LeaseFilters with given flags and error if occurred

func LeaseIDFromFlags

func LeaseIDFromFlags(flags *pflag.FlagSet, opts ...MarketOption) (v1.LeaseID, error)

LeaseIDFromFlags returns LeaseID with given flags and error if occurred Here provider value is taken from flags

func MarkReqBidIDFlags

func MarkReqBidIDFlags(cmd *cobra.Command, opts ...DeploymentIDOption)

MarkReqBidIDFlags marks flags required for bid Used in get bid query command

func MarkReqDeploymentIDFlags

func MarkReqDeploymentIDFlags(cmd *cobra.Command, opts ...DeploymentIDOption)

MarkReqDeploymentIDFlags marks flags required except for Owner when NoOwner is set

func MarkReqGroupIDFlags

func MarkReqGroupIDFlags(cmd *cobra.Command, opts ...DeploymentIDOption)

MarkReqGroupIDFlags marks flags required for group

func MarkReqLeaseIDFlags

func MarkReqLeaseIDFlags(cmd *cobra.Command, opts ...DeploymentIDOption)

MarkReqLeaseIDFlags marks flags required for bid Used in get bid query command

func MarkReqOrderIDFlags

func MarkReqOrderIDFlags(cmd *cobra.Command, opts ...DeploymentIDOption)

MarkReqOrderIDFlags marks flags required for order

func MarkReqProviderFlag

func MarkReqProviderFlag(cmd *cobra.Command)

MarkReqProviderFlag marks provider flag as required

func MustClientFromContext

func MustClientFromContext(ctx context.Context) v1beta3.Client

func MustQueryClientFromContext

func MustQueryClientFromContext(ctx context.Context) v1beta3.LightClient

func NewBankMultiSendTxCmd

func NewBankMultiSendTxCmd() *cobra.Command

NewBankMultiSendTxCmd returns a CLI command handler for creating a MsgMultiSend transaction. For a better UX this command is limited to send funds from one account to two or more accounts.

func NewBankSendTxCmd

func NewBankSendTxCmd() *cobra.Command

NewBankSendTxCmd returns a CLI command handler for creating a MsgSend transaction.

func NewBankTxCmd

func NewBankTxCmd() *cobra.Command

NewBankTxCmd returns a root CLI command handler for all x/bank transaction commands.

func NewMsgCreatePeriodicVestingAccountCmd

func NewMsgCreatePeriodicVestingAccountCmd() *cobra.Command

NewMsgCreatePeriodicVestingAccountCmd returns a CLI command handler for creating a MsgCreatePeriodicVestingAccountCmd transaction.

func NewMsgCreatePermanentLockedAccountCmd

func NewMsgCreatePermanentLockedAccountCmd() *cobra.Command

NewMsgCreatePermanentLockedAccountCmd returns a CLI command handler for creating a MsgCreatePermanentLockedAccount transaction.

func NewMsgCreateVestingAccountCmd

func NewMsgCreateVestingAccountCmd() *cobra.Command

NewMsgCreateVestingAccountCmd returns a CLI command handler for creating a MsgCreateVestingAccount transaction.

func OrderFiltersFromFlags

func OrderFiltersFromFlags(flags *pflag.FlagSet) (v1beta5.OrderFilters, error)

OrderFiltersFromFlags returns OrderFilters with given flags and error if occurred

func OrderIDFromFlags

func OrderIDFromFlags(flags *pflag.FlagSet, opts ...MarketOption) (v1.OrderID, error)

OrderIDFromFlags returns OrderID with given flags and error if occurred

func ParseQueryResponse

func ParseQueryResponse(bz []byte) (sdk.SimulationResponse, error)

func ParseSigArgs

func ParseSigArgs(args []string) ([]string, error)

ParseSigArgs parses comma-separated signatures from the CLI arguments.

func QueryCmd

func QueryCmd() *cobra.Command

func QueryModuleAccountByNameCmd

func QueryModuleAccountByNameCmd() *cobra.Command

QueryModuleAccountByNameCmd returns a command to

func QueryModuleAccountsCmd

func QueryModuleAccountsCmd() *cobra.Command

QueryModuleAccountsCmd returns a list of all the existing module accounts with their account information and permissions

func QueryParamsCmd

func QueryParamsCmd() *cobra.Command

QueryParamsCmd returns the command handler for evidence parameter querying.

func QueryTxCmd

func QueryTxCmd() *cobra.Command

QueryTxCmd implements the default command for a tx query.

func QueryTxsByEventsCmd

func QueryTxsByEventsCmd() *cobra.Command

QueryTxsByEventsCmd returns a command to search through transactions by events.

func RPCAkash

func RPCAkash(_ *cmtrpctypes.Context) (*aclient.Akash, error)

func ReadTxFromFile

func ReadTxFromFile(ctx client.Context, filename string) (tx sdk.Tx, err error)

ReadTxFromFile and decode a StdTx from the given filename. Can pass "-" to read from stdin.

func SignTx

func SignTx(txFactory tx.Factory, clientCtx client.Context, name string, txBuilder client.TxBuilder, offline, overwriteSig bool) error

SignTx signs a transaction managed by the TxBuilder using a `name` key stored in Keybase. The new signature is appended to the TxBuilder when overwrite=false or overwritten otherwise. Don't perform online validation or lookups if offline is true.

func SignTxWithSignerAddress

func SignTxWithSignerAddress(txFactory tx.Factory, clientCtx client.Context, addr sdk.AccAddress,
	name string, txBuilder client.TxBuilder, offline, overwrite bool,
) (err error)

SignTxWithSignerAddress attaches a signature to a transaction. Don't perform online validation or lookups if offline is true, else populate account and sequence numbers from a foreign account. This function should only be used when signing with a multisig. For normal keys, please use SignTx directly.

func TxCmd

func TxCmd() *cobra.Command

Types

type BatchScanner

type BatchScanner struct {
	*bufio.Scanner
	// contains filtered or unexported fields
}

BatchScanner provides a convenient interface for reading batch data such as a file of newline-delimited JSON encoded StdTx.

func NewBatchScanner

func NewBatchScanner(cfg client.TxConfig, r io.Reader) *BatchScanner

NewBatchScanner returns a new BatchScanner to read newline-delimited StdTx transactions from r.

func ReadTxsFromInput

func ReadTxsFromInput(txCfg client.TxConfig, filenames ...string) (scanner *BatchScanner, err error)

ReadTxsFromInput reads multiples txs from the given filename(s). Can pass "-" to read from stdin. Unlike ReadTxFromFile, this function does not decode the txs.

func (*BatchScanner) Scan

func (bs *BatchScanner) Scan() bool

Scan advances the Scanner to the next line.

func (BatchScanner) Tx

func (bs BatchScanner) Tx() sdk.Tx

Tx returns the most recent Tx unmarshalled by a call to Scan.

func (BatchScanner) UnmarshalErr

func (bs BatchScanner) UnmarshalErr() error

UnmarshalErr returns the first unmarshalling error that was encountered by the scanner.

type BroadcastReq

type BroadcastReq struct {
	Tx   legacytx.StdTx `json:"tx" yaml:"tx"`
	Mode string         `json:"mode" yaml:"mode"`
}

BroadcastReq defines a tx broadcasting request.

type ContextType

type ContextType string

type DeploymentIDOption

type DeploymentIDOption func(*DeploymentIDOptions)

func DeploymentIDOptionNoOwner

func DeploymentIDOptionNoOwner(val bool) DeploymentIDOption

DeploymentIDOptionNoOwner do not add mark as required owner flag

type DeploymentIDOptions

type DeploymentIDOptions struct {
	NoOwner bool
}

type GasEstimateResponse

type GasEstimateResponse struct {
	GasEstimate uint64 `json:"gas_estimate" yaml:"gas_estimate"`
}

GasEstimateResponse defines a response definition for tx gas estimation.

func (GasEstimateResponse) String

func (gr GasEstimateResponse) String() string

type InputPeriod

type InputPeriod struct {
	Coins  string `json:"coins"`
	Length int64  `json:"length_seconds"`
}

type MarketOption

type MarketOption func(*MarketOptions)

func WithOwner

func WithOwner(val sdk.AccAddress) MarketOption

func WithProvider

func WithProvider(val sdk.AccAddress) MarketOption

type MarketOptions

type MarketOptions struct {
	Owner    sdk.AccAddress
	Provider sdk.AccAddress
}

type VestingData

type VestingData struct {
	StartTime int64         `json:"start_time"`
	Periods   []InputPeriod `json:"periods"`
}

Source Files

  • auth_flags.go
  • auth_multisign.go
  • auth_tx.go
  • bank_tx.go
  • bech32.go
  • cert.go
  • client.go
  • deployment_flags.go
  • deployment_tx.go
  • escrow_query.go
  • escrow_tx.go
  • gentxs.go
  • market_flags.go
  • market_tx.go
  • query.go
  • query_auth.go
  • tx.go
  • vesting_tx.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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