cli

package module
v0.0.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 72 Imported by: 4

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrDuplicatedAttribute = errors.New("provider: duplicated attribute")
)
View Source
var (
	ErrInvalidClient = errors.New("invalid client")
)
View Source
var FlagSplit = "split"

Functions

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 DetectBidDeposit

func DetectBidDeposit(ctx context.Context, flags *pflag.FlagSet, cl client.QueryClient) (sdk.Coin, error)

func DetectDeploymentDeposit

func DetectDeploymentDeposit(ctx context.Context, flags *pflag.FlagSet, cl client.QueryClient) (sdk.Coin, error)

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 ExecQueryTestCLICmd

func ExecQueryTestCLICmd(ctx context.Context, cctx client.Context, cmd *cobra.Command, extraArgs ...string) (sdktest.BufferWriter, error)

ExecQueryTestCLICmd builds the client context, mocks the output and executes the command.

func ExecTxTestCLICmd

func ExecTxTestCLICmd(ctx context.Context, cctx client.Context, cmd *cobra.Command, extraArgs ...string) (sdktest.BufferWriter, error)

ExecTxTestCLICmd builds the client context, mocks the output and executes the command.

func GetAccountAddressByIDCmd

func GetAccountAddressByIDCmd() *cobra.Command

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

func GetAccountQueryCmd

func GetAccountQueryCmd() *cobra.Command

GetAccountQueryCmd 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 GetAuditQueryCmd

func GetAuditQueryCmd() *cobra.Command

func GetAuditTxCmd

func GetAuditTxCmd() *cobra.Command

GetAuditTxCmd returns the transaction commands for audit module

func GetAuthQueryCmd

func GetAuthQueryCmd() *cobra.Command

GetAuthQueryCmd returns the transaction commands for this module

func GetBroadcastCommand

func GetBroadcastCommand() *cobra.Command

GetBroadcastCommand returns the tx broadcast command.

func GetCertQueryCmd

func GetCertQueryCmd() *cobra.Command

func GetCertTxCmd

func GetCertTxCmd() *cobra.Command

func GetDecodeCommand

func GetDecodeCommand() *cobra.Command

GetDecodeCommand returns the decode command to take serialized bytes and turn it into a JSON-encoded transaction.

func GetDeploymentQueryCmd

func GetDeploymentQueryCmd() *cobra.Command

GetDeploymentQueryCmd returns the query commands for the deployment module

func GetDeploymentTxCmd

func GetDeploymentTxCmd() *cobra.Command

GetDeploymentTxCmd returns the transaction commands for this module

func GetEncodeCommand

func GetEncodeCommand() *cobra.Command

GetEncodeCommand returns the encode command to take a JSONified transaction and turn it into Amino-serialized bytes

func GetEscrowQueryCmd

func GetEscrowQueryCmd() *cobra.Command

func GetMarketQueryCmd

func GetMarketQueryCmd() *cobra.Command

GetMarketQueryCmd returns the transaction commands for the market module

func GetMarketTxCmd

func GetMarketTxCmd() *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 GetProviderQueryCmd

func GetProviderQueryCmd() *cobra.Command

GetProviderQueryCmd returns the transaction commands for the provider module

func GetProviderTxCmd

func GetProviderTxCmd() *cobra.Command

GetProviderTxCmd returns the transaction commands for provider 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 GetTxQueryCmd

func GetTxQueryCmd() *cobra.Command

GetTxQueryCmd implements the default command for a tx query.

func GetValidateSignaturesCommand

func GetValidateSignaturesCommand() *cobra.Command

func GetVestingTxCmd

func GetVestingTxCmd() *cobra.Command

GetVestingTxCmd returns vesting module's transaction commands.

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 MsgSendExec

func MsgSendExec(ctx context.Context, cctx client.Context, from, to, amount fmt.Stringer, extraArgs ...string) (sdktest.BufferWriter, error)

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 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 QueryBalancesExec

func QueryBalancesExec(ctx context.Context, cctx client.Context, address fmt.Stringer, extraArgs ...string) (sdktest.BufferWriter, error)

func QueryBidExec

func QueryBidExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryBidExec is used for testing bid query

func QueryBidsExec

func QueryBidsExec(ctx context.Context, cctx client.Context, args ...string) (sdktest.BufferWriter, error)

QueryBidsExec is used for testing bids query

func QueryCertificateExec

func QueryCertificateExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryCertificateExec is used for testing certificate query

func QueryCertificatesExec

func QueryCertificatesExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryCertificatesExec is used for testing certificates query

func QueryCmd

func QueryCmd() *cobra.Command

func QueryDeploymentExec

func QueryDeploymentExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryDeploymentExec is used for testing deployment query

func QueryDeploymentsExec

func QueryDeploymentsExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryDeploymentsExec is used for testing deployments query

func QueryGroupExec

func QueryGroupExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryGroupExec is used for testing group query

func QueryLeaseExec

func QueryLeaseExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryLeaseExec is used for testing lease query

func QueryLeasesExec

func QueryLeasesExec(ctx context.Context, cctx client.Context, args ...string) (sdktest.BufferWriter, error)

QueryLeasesExec is used for testing leases query

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 QueryOrderExec

func QueryOrderExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryOrderExec is used for testing order query

func QueryOrdersExec

func QueryOrdersExec(ctx context.Context, cctx client.Context, args ...string) (sdktest.BufferWriter, error)

QueryOrdersExec is used for testing orders query

func QueryParamsCmd

func QueryParamsCmd() *cobra.Command

QueryParamsCmd returns the command handler for evidence parameter querying.

func QueryProviderExec

func QueryProviderExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

QueryProviderExec is used for testing provider query

func QueryProvidersExec

func QueryProvidersExec(ctx context.Context, cctx client.Context, args ...string) (sdktest.BufferWriter, error)

QueryProvidersExec is used for testing providers 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 TxCloseBidExec

func TxCloseBidExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxCloseBidExec is used for testing close bid tx

func TxCloseDeploymentExec

func TxCloseDeploymentExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxCloseDeploymentExec is used for testing close deployment tx requires --dseq, --fees

func TxCloseGroupExec

func TxCloseGroupExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxCloseGroupExec is used for testing close group tx

func TxCloseLeaseExec

func TxCloseLeaseExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxCloseLeaseExec is used for testing close order tx

func TxCmd

func TxCmd() *cobra.Command

func TxCreateBidExec

func TxCreateBidExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxCreateBidExec is used for testing create bid tx

func TxCreateDeploymentExec

func TxCreateDeploymentExec(ctx context.Context, cctx client.Context, filePath string, extraArgs ...string) (sdktest.BufferWriter, error)

TxCreateDeploymentExec is used for testing create deployment tx

func TxCreateLeaseExec

func TxCreateLeaseExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxCreateLeaseExec is used for creating a lease

func TxCreateProviderExec

func TxCreateProviderExec(ctx context.Context, cctx client.Context, filepath string, extraArgs ...string) (sdktest.BufferWriter, error)

TxCreateProviderExec is used for testing create provider tx

func TxDepositDeploymentExec

func TxDepositDeploymentExec(ctx context.Context, cctx client.Context, deposit sdk.Coin, extraArgs ...string) (sdktest.BufferWriter, error)

TxDepositDeploymentExec is used for testing deposit deployment tx

func TxGenerateClientExec

func TxGenerateClientExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxGenerateClientExec is used for testing create client certificate tx

func TxGenerateServerExec

func TxGenerateServerExec(ctx context.Context, cctx client.Context, host string, extraArgs ...string) (sdktest.BufferWriter, error)

TxGenerateServerExec is used for testing create server certificate tx

func TxGrantAuthorizationExec

func TxGrantAuthorizationExec(ctx context.Context, cctx client.Context, grantee sdk.AccAddress, extraArgs ...string) (sdktest.BufferWriter, error)

func TxPublishClientExec

func TxPublishClientExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxPublishClientExec is used for testing create client certificate tx

func TxPublishServerExec

func TxPublishServerExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxPublishServerExec is used for testing create server certificate tx

func TxRevokeAuthorizationExec

func TxRevokeAuthorizationExec(ctx context.Context, cctx client.Context, grantee sdk.AccAddress, extraArgs ...string) (sdktest.BufferWriter, error)

func TxRevokeClientExec

func TxRevokeClientExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxRevokeClientExec is used for testing create client certificate tx

func TxRevokeServerExec

func TxRevokeServerExec(ctx context.Context, cctx client.Context, extraArgs ...string) (sdktest.BufferWriter, error)

TxRevokeServerExec is used for testing create server certificate tx

func TxUpdateDeploymentExec

func TxUpdateDeploymentExec(ctx context.Context, cctx client.Context, filePath string, extraArgs ...string) (sdktest.BufferWriter, error)

TxUpdateDeploymentExec is used for testing update deployment tx

func TxUpdateProviderExec

func TxUpdateProviderExec(ctx context.Context, cctx client.Context, filepath string, extraArgs ...string) (sdktest.BufferWriter, error)

TxUpdateProviderExec is used for testing update provider tx

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 FlagsSet

type FlagsSet []string

func TestFlags

func TestFlags() FlagsSet

func (FlagsSet) With

func (df FlagsSet) With(flags ...string) FlagsSet

func (FlagsSet) WithBidID

func (df FlagsSet) WithBidID(val mtypes.BidID) FlagsSet

func (FlagsSet) WithBroadcastModeBlock

func (df FlagsSet) WithBroadcastModeBlock() FlagsSet

func (FlagsSet) WithDeploymentID

func (df FlagsSet) WithDeploymentID(val dv1.DeploymentID) FlagsSet

func (FlagsSet) WithDeposit

func (df FlagsSet) WithDeposit(coin sdk.Coin) FlagsSet

func (FlagsSet) WithDepositor

func (df FlagsSet) WithDepositor(acc sdk.Address) FlagsSet

func (FlagsSet) WithDseq

func (df FlagsSet) WithDseq(val uint64) FlagsSet

func (FlagsSet) WithFrom

func (df FlagsSet) WithFrom(acc sdk.Address) FlagsSet

func (FlagsSet) WithGasAutoFlags

func (df FlagsSet) WithGasAutoFlags() FlagsSet

func (FlagsSet) WithGroupID

func (df FlagsSet) WithGroupID(val dv1.GroupID) FlagsSet

func (FlagsSet) WithGseq

func (df FlagsSet) WithGseq(val uint32) FlagsSet

func (FlagsSet) WithLeaseID

func (df FlagsSet) WithLeaseID(val mtypes.LeaseID) FlagsSet

func (FlagsSet) WithOrderID

func (df FlagsSet) WithOrderID(val mtypes.OrderID) FlagsSet

func (FlagsSet) WithOseq

func (df FlagsSet) WithOseq(val uint32) FlagsSet

func (FlagsSet) WithOutput

func (df FlagsSet) WithOutput(val string) FlagsSet

func (FlagsSet) WithOutputJSON

func (df FlagsSet) WithOutputJSON() FlagsSet

func (FlagsSet) WithOwner

func (df FlagsSet) WithOwner(val string) FlagsSet

func (FlagsSet) WithPrice

func (df FlagsSet) WithPrice(coin sdk.DecCoin) FlagsSet

func (FlagsSet) WithProvider

func (df FlagsSet) WithProvider(val string) FlagsSet

func (FlagsSet) WithSerial

func (df FlagsSet) WithSerial(val string) FlagsSet

func (FlagsSet) WithSkipConfirm

func (df FlagsSet) WithSkipConfirm() FlagsSet

func (FlagsSet) WithState

func (df FlagsSet) WithState(val string) FlagsSet

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 ProviderConfig

type ProviderConfig struct {
	Host       string           `json:"host" yaml:"host"`
	Info       types.Info       `json:"info" yaml:"info"`
	Attributes tattr.Attributes `json:"attributes" yaml:"attributes"`
}

ProviderConfig is the struct that stores provider config

func ReadProviderConfigPath

func ReadProviderConfigPath(path string) (ProviderConfig, error)

ReadProviderConfigPath reads and parses file

func (ProviderConfig) GetAttributes

func (c ProviderConfig) GetAttributes() tattr.Attributes

GetAttributes returns config attributes into key value pairs

type VestingData

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

Source Files

  • audit_query.go
  • audit_tx.go
  • auth_flags.go
  • auth_multisign.go
  • auth_query.go
  • auth_tx.go
  • bank_tx.go
  • bech32.go
  • broadcast.go
  • cert_query.go
  • cert_tx.go
  • client.go
  • deployment_query.go
  • deployment_tx.go
  • escrow_query.go
  • escrow_tx.go
  • gentxs.go
  • market_query.go
  • market_tx.go
  • provider_query.go
  • provider_tx.go
  • query.go
  • test_helpers.go
  • tx.go
  • utils.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