cmds

package
v2.0.0-...-092c721 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: GPL-3.0 Imports: 42 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.SignerHint, Instance: types.Signer{}},
	{Hint: types.SignersHint, Instance: types.Signers{}},
	{Hint: types.NFTHint, Instance: types.NFT{}},
	{Hint: types.DesignHint, Instance: types.Design{}},
	{Hint: types.OperatorsBookHint, Instance: types.OperatorsBook{}},
	{Hint: types.CollectionPolicyHint, Instance: types.CollectionPolicy{}},
	{Hint: types.CollectionDesignHint, Instance: types.CollectionDesign{}},
	{Hint: types.NFTBoxHint, Instance: types.NFTBox{}},

	{Hint: nft.CreateCollectionHint, Instance: nft.CreateCollection{}},
	{Hint: nft.UpdateCollectionPolicyHint, Instance: nft.UpdateCollectionPolicy{}},
	{Hint: nft.MintItemHint, Instance: nft.MintItem{}},
	{Hint: nft.MintHint, Instance: nft.Mint{}},
	{Hint: nft.TransferItemHint, Instance: nft.TransferItem{}},
	{Hint: nft.TransferHint, Instance: nft.Transfer{}},
	{Hint: nft.DelegateItemHint, Instance: nft.DelegateItem{}},
	{Hint: nft.DelegateHint, Instance: nft.Delegate{}},
	{Hint: nft.ApproveItemHint, Instance: nft.ApproveItem{}},
	{Hint: nft.ApproveHint, Instance: nft.Approve{}},
	{Hint: nft.SignItemHint, Instance: nft.SignItem{}},
	{Hint: nft.SignHint, Instance: nft.Sign{}},

	{Hint: state.LastNFTIndexStateValueHint, Instance: state.LastNFTIndexStateValue{}},
	{Hint: state.NFTStateValueHint, Instance: state.NFTStateValue{}},
	{Hint: state.NFTBoxStateValueHint, Instance: state.NFTBoxStateValue{}},
	{Hint: state.OperatorsBookStateValueHint, Instance: state.OperatorsBookStateValue{}},
	{Hint: state.CollectionStateValueHint, Instance: state.CollectionStateValue{}},
}
View Source
var AddedSupportedHinters = []encoder.DecodeDetail{
	{Hint: nft.CreateCollectionFactHint, Instance: nft.CreateCollectionFact{}},
	{Hint: nft.UpdateCollectionPolicyFactHint, Instance: nft.UpdateCollectionPolicyFact{}},
	{Hint: nft.MintFactHint, Instance: nft.MintFact{}},
	{Hint: nft.TransferFactHint, Instance: nft.TransferFact{}},
	{Hint: nft.DelegateFactHint, Instance: nft.DelegateFact{}},
	{Hint: nft.ApproveFactHint, Instance: nft.ApproveFact{}},
	{Hint: nft.SignFactHint, Instance: nft.SignFact{}},
}
View Source
var PNameOperationProcessorsMap = ps.Name("mitum-nft-operation-processors-map")
View Source
var PNameValidateBlocks = ps.Name("validate-blocks")
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 {
	BaseCommand
	currencycmds.OperationFlags
	Sender   currencycmds.AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract currencycmds.AddressFlag    `arg:"" name:"contract" help:"contract address" required:"true"`
	Approved currencycmds.AddressFlag    `arg:"" name:"approved" help:"approved account address" required:"true"`
	NFTidx   uint64                      `arg:"" name:"nft" help:"target nft idx to approve"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" 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 CreateCollectionCommand

type CreateCollectionCommand struct {
	BaseCommand
	currencycmds.OperationFlags
	Sender   currencycmds.AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract currencycmds.AddressFlag    `arg:"" name:"contract" help:"contract account to register policy" required:"true"`
	Name     string                      `arg:"" name:"name" help:"collection name" required:"true"`
	Royalty  uint                        `arg:"" name:"royalty" help:"royalty parameter; 0 <= royalty param < 100" required:"true"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	URI      string                      `name:"uri" help:"collection uri" optional:""`
	White    currencycmds.AddressFlag    `name:"white" help:"whitelisted address" optional:""`
	// contains filtered or unexported fields
}

func (*CreateCollectionCommand) Run

type DelegateCommand

type DelegateCommand struct {
	BaseCommand
	currencycmds.OperationFlags
	Sender   currencycmds.AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract currencycmds.AddressFlag    `arg:"" name:"contract" help:"contract address" required:"true"`
	Operator currencycmds.AddressFlag    `arg:"" name:"operator" help:"operator account address"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	Mode     string                      `name:"mode" help:"delegate mode" optional:""`
	// contains filtered or unexported fields
}

func (*DelegateCommand) Run

func (cmd *DelegateCommand) 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 {
	BaseCommand
	currencycmds.OperationFlags
	Sender       currencycmds.AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract     currencycmds.AddressFlag    `arg:"" name:"contract" help:"contract address" required:"true"`
	Receiver     currencycmds.AddressFlag    `arg:"" name:"receiver" help:"receiver address" required:"true"`
	Hash         string                      `arg:"" name:"hash" help:"nft hash" required:"true"`
	Uri          string                      `arg:"" name:"uri" help:"nft uri" required:"true"`
	Currency     currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	Creator      SignerFlag                  `name:"creator" help:"nft contents creator \"<address>,<share>\"" optional:""`
	CreatorTotal uint                        `name:"creator-total" help:"creators total share" optional:""`
	// contains filtered or unexported fields
}

func (*MintCommand) Run

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

type NFTCommand

type NFTCommand struct {
	CreateCollection       CreateCollectionCommand       `cmd:"" name:"create-collection" help:"register new collection design"`
	UpdateCollectionPolicy UpdateCollectionPolicyCommand `cmd:"" name:"update-collection-policy" help:"update collection design"`
	Mint                   MintCommand                   `cmd:"" name:"mint" help:"mint new nft to collection"`
	Transfer               TransferCommand               `cmd:"" name:"transfer" help:"transfer nfts to receiver"`
	Delegate               DelegateCommand               `cmd:"" name:"delegate" help:"delegate operator or cancel operator delegation"`
	Approve                ApproveCommand                `cmd:"" name:"approve" help:"approve account for nft"`
	Sign                   SignCommand                   `cmd:"" name:"sign" help:"sign nft as creator | copyrighter"`
}

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

type SignCommand struct {
	BaseCommand
	currencycmds.OperationFlags
	Sender   currencycmds.AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract currencycmds.AddressFlag    `arg:"" name:"contract" help:"contract address" required:"true"`
	NFT      uint64                      `arg:"" name:"nft" help:"target nft; \"<collection>,<idx>\""`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	// contains filtered or unexported fields
}

func (*SignCommand) Run

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

type SignerFlag

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

func (*SignerFlag) Encode

func (v *SignerFlag) Encode(enc encoder.Encoder) (base.Address, error)

func (*SignerFlag) String

func (v *SignerFlag) String() string

func (*SignerFlag) UnmarshalText

func (v *SignerFlag) UnmarshalText(b []byte) 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 TransferCommand

type TransferCommand struct {
	BaseCommand
	currencycmds.OperationFlags
	Sender   currencycmds.AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Receiver currencycmds.AddressFlag    `arg:"" name:"receiver" help:"nft owner" required:"true"`
	Contract currencycmds.AddressFlag    `arg:"" name:"contract" help:"contract address" required:"true"`
	NFT      uint64                      `arg:"" name:"nft" help:"target nft"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	// contains filtered or unexported fields
}

func (*TransferCommand) Run

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

type UpdateCollectionPolicyCommand

type UpdateCollectionPolicyCommand struct {
	BaseCommand
	currencycmds.OperationFlags
	Sender   currencycmds.AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract currencycmds.AddressFlag    `arg:"" name:"contract" help:"contract address" required:"true"`
	Name     string                      `arg:"" name:"name" help:"collection name" required:"true"`
	Royalty  uint                        `arg:"" name:"royalty" help:"royalty parameter; 0 <= royalty param < 100" required:"true"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	URI      string                      `name:"uri" help:"collection uri" optional:""`
	White    currencycmds.AddressFlag    `name:"white" help:"whitelisted address" optional:""`
	// contains filtered or unexported fields
}

func (*UpdateCollectionPolicyCommand) Run

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