cmds

package
v0.0.0-...-1b25507 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: GPL-3.0 Imports: 41 Imported by: 0

Documentation

Overview

Package cmds provides command line tools.

Index

Constants

This section is empty.

Variables

View Source
var PNameValidateBlocks = ps.Name("validate-blocks")

Functions

This section is empty.

Types

type AddressTokenAmountFlag

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

func (*AddressTokenAmountFlag) Address

func (v *AddressTokenAmountFlag) Address() []base.Address

func (*AddressTokenAmountFlag) Amount

func (v *AddressTokenAmountFlag) Amount() []common.Big

func (*AddressTokenAmountFlag) UnmarshalText

func (v *AddressTokenAmountFlag) UnmarshalText(b []byte) error

type ApproveCommand

type ApproveCommand struct {
	OperationCommand
	Approved1 ccmds.AddressFlag `arg:"" name:"approved" help:"approved account" required:"true"`
	Approved2 ccmds.AddressFlag `arg:"" name:"approved" help:"approved account" required:"true"`
	Amount    ccmds.BigFlag     `arg:"" name:"amount" help:"amount to approve" required:"true"`
	// contains filtered or unexported fields
}

func (*ApproveCommand) Run

func (cmd *ApproveCommand) Run(pctx context.Context) error

type BaseCommand

type BaseCommand struct {
	Encoder  encoder.Encoder   `kong:"-"`
	Encoders *encoder.Encoders `kong:"-"`
	Log      *zerolog.Logger   `kong:"-"`
	Out      io.Writer         `kong:"-"`
}

type BaseNetworkClientCommand

type BaseNetworkClientCommand struct {
	BaseCommand
	launchcmd.BaseNetworkClientNodeInfoFlags
	Client   *isaacnetwork.BaseClient `kong:"-"`
	ClientID string                   `name:"client-id" help:"client id"`
}

func (*BaseNetworkClientCommand) Prepare

func (cmd *BaseNetworkClientCommand) Prepare(pctx context.Context) error

func (*BaseNetworkClientCommand) Print

func (cmd *BaseNetworkClientCommand) Print(v interface{}, out io.Writer) error

type BurnCommand

type BurnCommand struct {
	OperationCommand
	Target ccmds.AddressFlag `arg:"" name:"target" help:"token target" required:"true"`
	Amount ccmds.BigFlag     `arg:"" name:"amount" help:"amount to burn" required:"true"`
	// contains filtered or unexported fields
}

func (*BurnCommand) Run

func (cmd *BurnCommand) Run(pctx context.Context) error

type ImportCommand

type ImportCommand struct {
	// revive:disable:line-length-limit
	launch.DesignFlag
	Source      string           `arg:"" name:"source directory" help:"block data directory to import" type:"existingdir"`
	HeightRange launch.RangeFlag `name:"range" help:"<from>-<to>" default:""`
	launch.PrivatekeyFlags
	Do             bool   `name:"do" help:"really do import"`
	CacheDirectory string `name:"cache-directory" help:"directory for remote block item file"`

	launch.DevFlags `embed:"" prefix:"dev."`
	// contains filtered or unexported fields
}

func (*ImportCommand) Run

func (cmd *ImportCommand) Run(pctx context.Context) error

type MintCommand

type MintCommand struct {
	OperationCommand
	Receiver ccmds.AddressFlag `arg:"" name:"receiver" help:"token receiver" required:"true"`
	Amount   ccmds.BigFlag     `arg:"" name:"amount" help:"amount to mint" required:"true"`
	// contains filtered or unexported fields
}

func (*MintCommand) Run

func (cmd *MintCommand) Run(pctx context.Context) error

type NetworkClientBlockItemFileCommand

type NetworkClientBlockItemFileCommand struct {
	BaseNetworkClientCommand
	Height   launch.HeightFlag  `arg:""`
	Item     base.BlockItemType `arg:"item" help:"item type"`
	Validate bool               `name:"validate" negatable:"" help:"validate by default" default:"true"`
}

func (*NetworkClientBlockItemFileCommand) Run

type NetworkClientBlockItemFilesCommand

type NetworkClientBlockItemFilesCommand struct {
	BaseNetworkClientCommand
	Privatekey         string            `arg:"" name:"privatekey" help:"privatekey string"`
	Height             launch.HeightFlag `arg:""`
	OutputDirectory    string            `arg:"" name:"output directory" default:""`
	DownloadRemoteItem bool              `name:"download-remote-item"`
	DownloadAllItems   bool              `name:"download-all-items"`
	// contains filtered or unexported fields
}

func (*NetworkClientBlockItemFilesCommand) Run

type NetworkClientCommand

type NetworkClientCommand struct {
	//revive:disable:line-length-limit
	//revive:disable:nested-structs
	NodeInfo      launchcmd.NetworkClientNodeInfoCommand     `cmd:"" name:"node-info" help:"remote node info"`
	SendOperation NetworkClientSendOperationCommand          `cmd:"" name:"send-operation" help:"send operation"`
	State         launchcmd.NetworkClientStateCommand        `cmd:"" name:"state" help:"get state"`
	LastBlockMap  launchcmd.NetworkClientLastBlockMapCommand `cmd:"" name:"last-blockmap" help:"get last blockmap"`
	Design        struct {
		Read  NetworkClientReadNodeCommand  `cmd:"" name:"read" help:"read node value"`
		Write NetworkClientWriteNodeCommand `cmd:"" name:"write" help:"write node value"`
	} `cmd:"" name:"design" help:""`
	Event launchcmd.NetworkClientEventLoggingCommand `cmd:"" name:"event" help:"event log"`
}

type NetworkClientReadNodeCommand

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

func (*NetworkClientReadNodeCommand) Help

func (*NetworkClientReadNodeCommand) Prepare

func (cmd *NetworkClientReadNodeCommand) Prepare(pctx context.Context) error

func (*NetworkClientReadNodeCommand) Run

type NetworkClientSendOperationCommand

type NetworkClientSendOperationCommand struct {
	BaseNetworkClientCommand
	Input    string `arg:"" name:"input" help:"input; default is stdin" default:"-"`
	IsString bool   `name:"input.is-string" help:"input is string, not file"`
}

func (*NetworkClientSendOperationCommand) Run

type NetworkClientStateCommand

type NetworkClientStateCommand struct {
	BaseNetworkClientCommand
	Key  string `arg:"" name:"state key" help:"state key"`
	Hash string `arg:"" name:"state hash" help:"state hash" default:""`
}

func (*NetworkClientStateCommand) Run

type NetworkClientWriteNodeCommand

type NetworkClientWriteNodeCommand struct {
	Input  string `arg:"" name:"input" help:"input"`
	IsFile bool   `name:"input.is-file" help:"input is file"`
	// contains filtered or unexported fields
}

func (*NetworkClientWriteNodeCommand) Help

func (*NetworkClientWriteNodeCommand) Prepare

func (cmd *NetworkClientWriteNodeCommand) Prepare(pctx context.Context) error

func (*NetworkClientWriteNodeCommand) Run

type OperationCommand

type OperationCommand struct {
	BaseCommand
	ccmds.OperationFlags
	Sender   ccmds.AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract ccmds.AddressFlag    `arg:"" name:"contract" help:"contract address to register token" required:"true"`
	Currency ccmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	// contains filtered or unexported fields
}

type RegisterModelCommand

type RegisterModelCommand struct {
	OperationCommand
	Symbol        TokenSymbolFlag `arg:"" name:"symbol" help:"token symbol" required:"true"`
	Name          string          `arg:"" name:"name" help:"token name" required:"true"`
	Decimal       ccmds.BigFlag   `arg:"" name:"decimal" help:"decimal of token" required:"true"`
	InitialSupply ccmds.BigFlag   `arg:"" name:"initial-supply" help:"initial supply of token" required:"true"`
}

func (*RegisterModelCommand) Run

func (cmd *RegisterModelCommand) Run(pctx context.Context) error

type RunCommand

type RunCommand struct {
	ccmds.RunCommand
}

func (*RunCommand) Run

func (cmd *RunCommand) Run(pctx context.Context) error

type Storage

type Storage struct {
	Import         ImportCommand                  `cmd:"" help:"import block data files"`
	Clean          launchcmd.CleanCommand         `cmd:"" help:"clean storage"`
	ValidateBlocks ValidateBlocksCommand          `cmd:"" help:"validate blocks in storage"`
	Status         launchcmd.StorageStatusCommand `cmd:"" help:"storage status"`
	Database       launchcmd.DatabaseCommand      `cmd:"" help:""`
}

type TokenCommand

type TokenCommand struct {
	RegisterToken RegisterModelCommand `cmd:"" name:"register-model" help:"register token to contract account"`
	Mint          MintCommand          `cmd:"" name:"mint" help:"mint token to receiver"`
	Burn          BurnCommand          `cmd:"" name:"burn" help:"burn token of target"`
	Approve       ApproveCommand       `cmd:"" name:"approve" help:"approve token to approved account"`
	Transfer      TransferCommand      `cmd:"" name:"transfer" help:"transfer token to receiver"`
	TransferFrom  TransferFromCommand  `cmd:"" name:"transfer-from" help:"transfer token to receiver from target"`
}

type TokenSymbolFlag

type TokenSymbolFlag struct {
	Symbol types.TokenSymbol
}

func (*TokenSymbolFlag) String

func (v *TokenSymbolFlag) String() string

func (*TokenSymbolFlag) UnmarshalText

func (v *TokenSymbolFlag) UnmarshalText(b []byte) error

type TransferCommand

type TransferCommand struct {
	OperationCommand
	ReceiverAmount AddressTokenAmountFlag `arg:"" name:"receiver-amount" help:"receiver token amount (ex: \"<address>,<amount>\") separator @" required:"true"`
}

func (*TransferCommand) Run

func (cmd *TransferCommand) Run(pctx context.Context) error

type TransferFromCommand

type TransferFromCommand struct {
	OperationCommand
	Receiver     ccmds.AddressFlag      `arg:"" name:"receiver" help:"token receiver" required:"true"`
	TargetAmount AddressTokenAmountFlag `arg:"" name:"target" help:"target approving" required:"true"`
	// contains filtered or unexported fields
}

func (*TransferFromCommand) Run

func (cmd *TransferFromCommand) Run(pctx context.Context) error

type ValidateBlocksCommand

type ValidateBlocksCommand struct {
	launch.DesignFlag
	launch.PrivatekeyFlags
	HeightRange launch.RangeFlag `name:"range" help:"<from>-<to>" default:""`

	launch.DevFlags `embed:"" prefix:"dev."`
	// contains filtered or unexported fields
}

func (*ValidateBlocksCommand) Run

func (cmd *ValidateBlocksCommand) Run(pctx context.Context) error

Jump to

Keyboard shortcuts

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