cmds

package
v0.0.0-...-4a04f35 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 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 AddedHinters = []encoder.DecodeDetail{

	{Hint: types.ApproveBoxHint, Instance: types.ApproveBox{}},
	{Hint: types.ApproveInfoHint, Instance: types.ApproveInfo{}},
	{Hint: types.PolicyHint, Instance: types.Policy{}},
	{Hint: types.DesignHint, Instance: types.Design{}},

	{Hint: state.DesignStateValueHint, Instance: state.DesignStateValue{}},
	{Hint: state.TokenBalanceStateValueHint, Instance: state.TokenBalanceStateValue{}},

	{Hint: token.RegisterTokenHint, Instance: token.RegisterToken{}},
	{Hint: token.MintHint, Instance: token.Mint{}},
	{Hint: token.BurnHint, Instance: token.Burn{}},
	{Hint: token.ApproveHint, Instance: token.Approve{}},
	{Hint: token.TransferHint, Instance: token.Transfer{}},
	{Hint: token.TransferFromHint, Instance: token.TransferFrom{}},
}
View Source
var AddedSupportedHinters = []encoder.DecodeDetail{
	{Hint: token.RegisterTokenFactHint, Instance: token.RegisterTokenFact{}},
	{Hint: token.MintFactHint, Instance: token.MintFact{}},
	{Hint: token.BurnFactHint, Instance: token.BurnFact{}},
	{Hint: token.ApproveFactHint, Instance: token.ApproveFact{}},
	{Hint: token.TransferFactHint, Instance: token.TransferFact{}},
	{Hint: token.TransferFromFactHint, Instance: token.TransferFromFact{}},
}
View Source
var PNameOperationProcessorsMap = ps.Name("mitum-token-operation-processors-map")
View Source
var SupportedProposalOperationFactHinters []encoder.DecodeDetail

Functions

func DefaultImportPS

func DefaultImportPS() *ps.PS

func IsSupportedProposalOperationFactHintFunc

func IsSupportedProposalOperationFactHintFunc() func(hint.Hint) bool

func LoadHinters

func LoadHinters(encs *encoder.Encoders) error

func PAddHinters

func PAddHinters(pctx context.Context) (context.Context, error)

func PDigesterFollowUp

func PDigesterFollowUp(ctx context.Context) (context.Context, error)

func POperationProcessorsMap

func POperationProcessorsMap(pctx context.Context) (context.Context, error)

func ProcessDigester

func ProcessDigester(ctx context.Context) (context.Context, error)

func ProcessStartDigester

func ProcessStartDigester(ctx context.Context) (context.Context, error)

Types

type ApproveCommand

type ApproveCommand struct {
	OperationCommand
	Approved currencycmds.AddressFlag `arg:"" name:"approved" help:"approved account" required:"true"`
	Amount   currencycmds.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 currencycmds.AddressFlag `arg:"" name:"target" help:"token target" required:"true"`
	Amount currencycmds.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 currencycmds.AddressFlag `arg:"" name:"receiver" help:"token receiver" required:"true"`
	Amount   currencycmds.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 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  launchcmd.NetworkClientReadNodeCommand  `cmd:"" name:"read" help:"read design value"`
		Write launchcmd.NetworkClientWriteNodeCommand `cmd:"" name:"write" help:"write design value"`
	} `cmd:"" name:"design" help:""`
	Event launchcmd.NetworkClientEventLoggingCommand `cmd:"" name:"event" help:"event log"`
}

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 OperationCommand

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

type RegisterTokenCommand

type RegisterTokenCommand struct {
	OperationCommand
	Symbol        currencycmds.CurrencyIDFlag `arg:"" name:"symbol" help:"token symbol" required:"true"`
	Name          string                      `arg:"" name:"name" help:"token name" required:"true"`
	InitialSupply currencycmds.BigFlag        `arg:"" name:"initial-supply" help:"initial supply of token" required:"true"`
}

func (*RegisterTokenCommand) Run

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

type RunCommand

type RunCommand struct {
	//revive:disable:line-length-limit
	launch.DesignFlag
	launch.DevFlags `embed:"" prefix:"dev."`
	launch.PrivatekeyFlags
	Discovery []launch.ConnInfoFlag `help:"member discovery" placeholder:"ConnInfo"`
	Hold      launch.HeightFlag     `help:"hold consensus states"`
	HTTPState string                `name:"http-state" help:"runtime statistics thru https" placeholder:"bind address"`
	launch.ACLFlags
	// contains filtered or unexported fields
}

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 launchcmd.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 RegisterTokenCommand `cmd:"" name:"register-token" 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"`
}

type TransferCommand

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

func (*TransferCommand) Run

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

type TransferFromCommand

type TransferFromCommand struct {
	OperationCommand
	Receiver currencycmds.AddressFlag `arg:"" name:"receiver" help:"token receiver" required:"true"`
	Target   currencycmds.AddressFlag `arg:"" name:"target" help:"target approving" required:"true"`
	Amount   currencycmds.BigFlag     `arg:"" name:"amount" help:"amount to transfer" required:"true"`
	// contains filtered or unexported fields
}

func (*TransferFromCommand) Run

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

Jump to

Keyboard shortcuts

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