cmds

package
v3.0.0-alpha.0...-e637ab8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: GPL-3.0 Imports: 66 Imported by: 27

Documentation

Overview

Package cmds provides command line tools.

Index

Constants

View Source
const (
	PNameDigester      = ps.Name("digester")
	PNameStartDigester = ps.Name("start_digester")
)

Variables

View Source
var (
	DesignACLScope               = launch.ACLScope("design")
	StatesAllowConsensusACLScope = launch.ACLScope("states.allow_consensus")
	DiscoveryACLScope            = launch.ACLScope("discovery")
	ACLACLScope                  = launch.ACLScope("acl")
	BlockItemFilesACLScope       = launch.ACLScope("block_item_files")
)
View Source
var (
	PNameAPI              = ps.Name("api")
	PNameStartAPI         = ps.Name("start_api")
	PNameDigesterDataBase = ps.Name("digester_database")
)
View Source
var (
	PNameDigestDesign                   = ps.Name("digest-design")
	PNameGenerateGenesis                = ps.Name("mitum-currency-generate-genesis")
	PNameDigestAPIHandlers              = ps.Name("mitum-currency-digest-api-handlers")
	PNameDigesterFollowUp               = ps.Name("mitum-currency-followup_digester")
	BEncoderContextKey                  = util.ContextKey("bson-encoder")
	ProposalOperationFactHintContextKey = util.ContextKey("proposal-operation-fact-hint")
	OperationProcessorContextKey        = util.ContextKey("mitum-currency-operation-processor")
)
View Source
var AddedHinters = []encoder.DecodeDetail{

	{Hint: common.BaseStateHint, Instance: common.BaseState{}},
	{Hint: common.NodeHint, Instance: common.BaseNode{}},

	{Hint: types.AccountHint, Instance: types.Account{}},
	{Hint: types.AccountKeyHint, Instance: types.BaseAccountKey{}},
	{Hint: types.AccountKeysHint, Instance: types.BaseAccountKeys{}},
	{Hint: types.NilAccountKeysHint, Instance: types.NilAccountKeys{}},
	{Hint: types.AddressHint, Instance: types.Address{}},
	{Hint: types.StringAddressHint, Instance: types.StringAddress{}},
	{Hint: types.AmountHint, Instance: types.Amount{}},
	{Hint: types.ContractAccountKeysHint, Instance: types.ContractAccountKeys{}},
	{Hint: types.ContractAccountStatusHint, Instance: types.ContractAccountStatus{}},
	{Hint: types.CurrencyDesignHint, Instance: types.CurrencyDesign{}},
	{Hint: types.CurrencyPolicyHint, Instance: types.CurrencyPolicy{}},
	{Hint: types.FixedFeeerHint, Instance: types.FixedFeeer{}},
	{Hint: types.MEPrivatekeyHint, Instance: types.MEPrivatekey{}},
	{Hint: types.MEPublickeyHint, Instance: types.MEPublickey{}},
	{Hint: types.NilFeeerHint, Instance: types.NilFeeer{}},
	{Hint: types.RatioFeeerHint, Instance: types.RatioFeeer{}},

	{Hint: currency.CreateAccountHint, Instance: currency.CreateAccount{}},
	{Hint: currency.CreateAccountItemMultiAmountsHint, Instance: currency.CreateAccountItemMultiAmounts{}},
	{Hint: currency.CreateAccountItemSingleAmountHint, Instance: currency.CreateAccountItemSingleAmount{}},
	{Hint: currency.UpdateCurrencyHint, Instance: currency.UpdateCurrency{}},
	{Hint: currency.RegisterCurrencyHint, Instance: currency.RegisterCurrency{}},
	{Hint: currency.RegisterGenesisCurrencyHint, Instance: currency.RegisterGenesisCurrency{}},
	{Hint: currency.RegisterGenesisCurrencyFactHint, Instance: currency.RegisterGenesisCurrencyFact{}},
	{Hint: currency.UpdateKeyHint, Instance: currency.UpdateKey{}},
	{Hint: currency.MintHint, Instance: currency.Mint{}},
	{Hint: currency.TransferHint, Instance: currency.Transfer{}},
	{Hint: currency.TransferItemMultiAmountsHint, Instance: currency.TransferItemMultiAmounts{}},
	{Hint: currency.TransferItemSingleAmountHint, Instance: currency.TransferItemSingleAmount{}},

	{Hint: extension.CreateContractAccountHint, Instance: extension.CreateContractAccount{}},
	{Hint: extension.CreateContractAccountItemMultiAmountsHint, Instance: extension.CreateContractAccountItemMultiAmounts{}},
	{Hint: extension.CreateContractAccountItemSingleAmountHint, Instance: extension.CreateContractAccountItemSingleAmount{}},
	{Hint: extension.UpdateHandlerHint, Instance: extension.UpdateHandler{}},
	{Hint: extension.UpdateRecipientHint, Instance: extension.UpdateRecipient{}},
	{Hint: extension.WithdrawHint, Instance: extension.Withdraw{}},
	{Hint: extension.WithdrawItemMultiAmountsHint, Instance: extension.WithdrawItemMultiAmounts{}},
	{Hint: extension.WithdrawItemSingleAmountHint, Instance: extension.WithdrawItemSingleAmount{}},

	{Hint: extras.BaseAuthenticationHint, Instance: extras.BaseAuthentication{}},
	{Hint: extras.BaseSettlementHint, Instance: extras.BaseSettlement{}},
	{Hint: extras.BaseProxyPayerHint, Instance: extras.BaseProxyPayer{}},

	{Hint: isaacoperation.GenesisNetworkPolicyHint, Instance: isaacoperation.GenesisNetworkPolicy{}},
	{Hint: isaacoperation.FixedSuffrageCandidateLimiterRuleHint, Instance: isaacoperation.FixedSuffrageCandidateLimiterRule{}},
	{Hint: isaacoperation.MajoritySuffrageCandidateLimiterRuleHint, Instance: isaacoperation.MajoritySuffrageCandidateLimiterRule{}},
	{Hint: types.NetworkPolicyHint, Instance: types.NetworkPolicy{}},
	{Hint: types.NetworkPolicyStateValueHint, Instance: types.NetworkPolicyStateValue{}},
	{Hint: isaacoperation.SuffrageCandidateHint, Instance: isaacoperation.SuffrageCandidate{}},
	{Hint: isaacoperation.SuffrageDisjoinHint, Instance: isaacoperation.SuffrageDisjoin{}},
	{Hint: isaacoperation.SuffrageGenesisJoinHint, Instance: isaacoperation.SuffrageGenesisJoin{}},
	{Hint: isaacoperation.SuffrageJoinHint, Instance: isaacoperation.SuffrageJoin{}},
	{Hint: isaacoperation.NetworkPolicyHint, Instance: isaacoperation.NetworkPolicy{}},

	{Hint: ccstate.AccountStateValueHint, Instance: ccstate.AccountStateValue{}},
	{Hint: ccstate.BalanceStateValueHint, Instance: ccstate.BalanceStateValue{}},
	{Hint: ccstate.DesignStateValueHint, Instance: ccstate.DesignStateValue{}},

	{Hint: cestate.ContractAccountStateValueHint, Instance: cestate.ContractAccountStateValue{}},

	{Hint: digest.AccountValueHint, Instance: digest.AccountValue{}},
	{Hint: digest.OperationValueHint, Instance: digest.OperationValue{}},
	{Hint: digestisaac.ManifestHint, Instance: digestisaac.Manifest{}},

	{Hint: types.DesignHint, Instance: types.Design{}},
	{Hint: types.DataHint, Instance: types.Data{}},
	{Hint: types.DIDResourceHint, Instance: types.DIDResource{}},
	{Hint: types.DIDDocumentHint, Instance: types.DIDDocument{}},
	{Hint: types.AsymmetricKeyAuthenticationHint, Instance: types.AsymmetricKeyAuthentication{}},
	{Hint: types.SocialLogInAuthenticationHint, Instance: types.SocialLogInAuthentication{}},

	{Hint: did_registry.CreateDIDHint, Instance: did_registry.CreateDID{}},
	{Hint: did_registry.UpdateDIDDocumentHint, Instance: did_registry.UpdateDIDDocument{}},
	{Hint: did_registry.RegisterModelHint, Instance: did_registry.RegisterModel{}},
	{Hint: dstate.DataStateValueHint, Instance: dstate.DataStateValue{}},
	{Hint: dstate.DesignStateValueHint, Instance: dstate.DesignStateValue{}},
	{Hint: dstate.DocumentStateValueHint, Instance: dstate.DocumentStateValue{}},
}
View Source
var AddedSupportedHinters = []encoder.DecodeDetail{
	{Hint: currency.CreateAccountFactHint, Instance: currency.CreateAccountFact{}},
	{Hint: currency.UpdateCurrencyFactHint, Instance: currency.UpdateCurrencyFact{}},
	{Hint: currency.RegisterCurrencyFactHint, Instance: currency.RegisterCurrencyFact{}},
	{Hint: currency.UpdateKeyFactHint, Instance: currency.UpdateKeyFact{}},
	{Hint: currency.MintFactHint, Instance: currency.MintFact{}},
	{Hint: currency.TransferFactHint, Instance: currency.TransferFact{}},

	{Hint: extension.CreateContractAccountFactHint, Instance: extension.CreateContractAccountFact{}},
	{Hint: extension.UpdateHandlerFactHint, Instance: extension.UpdateHandlerFact{}},
	{Hint: extension.UpdateRecipientFactHint, Instance: extension.UpdateRecipientFact{}},
	{Hint: extension.WithdrawFactHint, Instance: extension.WithdrawFact{}},

	{Hint: isaacoperation.GenesisNetworkPolicyFactHint, Instance: isaacoperation.GenesisNetworkPolicyFact{}},
	{Hint: isaacoperation.SuffrageCandidateFactHint, Instance: isaacoperation.SuffrageCandidateFact{}},
	{Hint: isaacoperation.SuffrageDisjoinFactHint, Instance: isaacoperation.SuffrageDisjoinFact{}},
	{Hint: isaacoperation.SuffrageGenesisJoinFactHint, Instance: isaacoperation.SuffrageGenesisJoinFact{}},
	{Hint: isaacoperation.SuffrageJoinFactHint, Instance: isaacoperation.SuffrageJoinFact{}},
	{Hint: isaacoperation.NetworkPolicyFactHint, Instance: isaacoperation.NetworkPolicyFact{}},

	{Hint: did_registry.CreateDIDFactHint, Instance: did_registry.CreateDIDFact{}},
	{Hint: did_registry.UpdateDIDDocumentFactHint, Instance: did_registry.UpdateDIDDocumentFact{}},
	{Hint: did_registry.RegisterModelFactHint, Instance: did_registry.RegisterModelFact{}},
}
View Source
var KeyAddressVars = kong.Vars{
	"create_account_threshold": "100",
}
View Source
var NodeReadWriteEventLogger launch.EventLoggerName = "node_readwrite"
View Source
var (
	OperationProcessorsMapBContextKey = util.ContextKey("operation-processors-map-b")
)
View Source
var PNameValidateBlocks = ps.Name("validate-blocks")
View Source
var SupportedProposalOperationFactHinters []encoder.DecodeDetail

Functions

func AttachHandlerSendOperation

func AttachHandlerSendOperation(pctx context.Context) error

func DefaultINITPS

func DefaultINITPS() *ps.PS

func DefaultImportPS

func DefaultImportPS() *ps.PS

func DefaultRunPS

func DefaultRunPS() *ps.PS

func ExcludeHint

func ExcludeHint(hint hint.Hint, launchHinters []encoder.DecodeDetail) []encoder.DecodeDetail

func IsSupportedProposalOperationFactHintFunc

func IsSupportedProposalOperationFactHintFunc() func(hint.Hint) bool

func LoadFromStdInput

func LoadFromStdInput() ([]byte, error)

func LoadHinters

func LoadHinters(encs *encoder.Encoders) error

func PAddHinters

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

func PCloseMemberlist

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

func PEncoder

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

func PGenerateGenesis

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

func PLoadDigestDesign

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

func PLongRunningMemberlistJoin

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

func PMemberlist

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

func PNetworkHandlers

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

func PNetworkHandlersReadWriteNode

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

func POperationProcessorsMap

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

func PPatchMemberlist

func PPatchMemberlist(pctx context.Context) (ctx context.Context, err error)

func PProposalMaker

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

func PProposalProcessors

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

func PStartMemberlist

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

func PStatesNetworkHandlers

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

func PSuffrageCandidateLimiterSet

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

func PdigesterFollowUp

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

func PrettyPrint

func PrettyPrint(out io.Writer, i interface{})

func ProcessAPI

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

func ProcessDigester

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

func ProcessDigesterDatabase

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

func ProcessStartAPI

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

func ProcessStartDigester

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

func ReadNodeFromNetworkHandler

func ReadNodeFromNetworkHandler(
	ctx context.Context,
	priv base.Privatekey,
	networkID base.NetworkID,
	key string,
	stream quicstreamheader.StreamFunc,
) (t interface{}, found bool, _ error)

func SendOperationFilterFunc

func SendOperationFilterFunc(ctx context.Context) (
	func(base.Operation) (bool, error),
	error,
)

func WriteNodeFromNetworkHandler

func WriteNodeFromNetworkHandler(
	ctx context.Context,
	priv base.Privatekey,
	networkID base.NetworkID,
	key string,
	value string,
	stream quicstreamheader.StreamFunc,
) (found bool, _ error)

Types

type AddressCurrencyAmountFlag

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

func (*AddressCurrencyAmountFlag) Address

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

func (*AddressCurrencyAmountFlag) Amount

func (v *AddressCurrencyAmountFlag) Amount() []types.Amount

func (*AddressCurrencyAmountFlag) UnmarshalText

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

type AddressFlag

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

func (*AddressFlag) Encode

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

func (*AddressFlag) String

func (v *AddressFlag) String() string

func (*AddressFlag) UnmarshalText

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

type BigFlag struct {
	common.Big
}

func (*BigFlag) UnmarshalText

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

type ContractIDFlag

type ContractIDFlag struct {
	ID types.ContractID
}

func (*ContractIDFlag) String

func (v *ContractIDFlag) String() string

func (*ContractIDFlag) UnmarshalText

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

type CreateAccountCommand

type CreateAccountCommand struct {
	BaseCommand
	OperationFlags
	Sender    AddressFlag        `arg:"" name:"sender" help:"sender address" required:"true"`
	Threshold uint               `help:"threshold for keys (default: ${create_account_threshold})" default:"${create_account_threshold}"` // nolint
	Key       KeyFlag            `name:"key" help:"key for new account (ex: \"<public key>,<weight>\") separator @"`
	Amount    CurrencyAmountFlag `arg:"" name:"currency-amount" help:"amount (ex: \"<currency>,<amount>\")"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*CreateAccountCommand) Run

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

type CreateContractAccountCommand

type CreateContractAccountCommand struct {
	BaseCommand
	OperationFlags
	Sender    AddressFlag        `arg:"" name:"sender" help:"sender address" required:"true"`
	Threshold uint               `help:"threshold for keys (default: ${create_contract_account_threshold})" default:"${create_contract_account_threshold}"` // nolint
	Key       KeyFlag            `name:"key" help:"key for new account (ex: \"<public key>,<weight>\") separator @"`
	Amount    CurrencyAmountFlag `arg:"" name:"currency-amount" help:"amount (ex: \"<currency>,<amount>\")"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*CreateContractAccountCommand) Run

type CreateDIDCommand

type CreateDIDCommand struct {
	BaseCommand
	OperationFlags
	Sender          AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract        AddressFlag    `arg:"" name:"contract" help:"contract address" required:"true"`
	AuthType        string         `arg:"" name:"auth-type" help:"authentication type" required:"true"`
	PubKey          string         `arg:"" name:"pubKey" help:"public key" required:"true"`
	ServiceType     string         `arg:"" name:"service-type" help:"service type" required:"true"`
	ServiceEndpoint string         `arg:"" name:"service-endpoint" help:"service endpoint" required:"true"`
	Currency        CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*CreateDIDCommand) Run

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

type CurrencyAmountFlag

type CurrencyAmountFlag struct {
	CID types.CurrencyID
	Big common.Big
}

func (*CurrencyAmountFlag) String

func (v *CurrencyAmountFlag) String() string

func (*CurrencyAmountFlag) UnmarshalText

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

type CurrencyCommand

type CurrencyCommand struct {
	CreateAccount         CreateAccountCommand         `cmd:"" name:"create-account" help:"create new account"`
	UpdateKey             UpdateKeyCommand             `cmd:"" name:"update-key" help:"update account keys"`
	Transfer              TransferCommand              `cmd:"" name:"transfer" help:"transfer"`
	RegisterCurrency      RegisterCurrencyCommand      `cmd:"" name:"register-currency" help:"register new currency"`
	UpdateCurrency        UpdateCurrencyCommand        `cmd:"" name:"update-currency" help:"update currency policy"`
	CreateContractAccount CreateContractAccountCommand `cmd:"" name:"create-contract-account" help:"create new contract account"`
	UpdateHandler         UpdateHandlerCommand         `cmd:"" name:"update-handler" help:"update handler of contract account"`
	UpdateRecipient       UpdateRecipientCommand       `cmd:"" name:"update-recipient" help:"update recipient of contract account"`
	Withdraw              WithdrawCommand              `cmd:"" name:"withdraw" help:"withdraw amounts from target contract account"`
}

type CurrencyDesignFlags

type CurrencyDesignFlags struct {
	Currency                CurrencyIDFlag `arg:"" name:"currency-id" help:"currency id" required:"true"`
	GenesisAmount           BigFlag        `arg:"" name:"genesis-amount" help:"genesis amount" required:"true"`
	Decimal                 BigFlag        `arg:"" name:"decimal" help:"decimal" required:"true"`
	GenesisAccount          AddressFlag    `arg:"" name:"genesis-account" help:"genesis-account address for genesis balance" required:"true"` // nolint lll
	CurrencyPolicyFlags     `prefix:"policy-" help:"currency policy" required:"true"`
	FeeerString             string `name:"feeer" help:"feeer type, {nil, fixed, ratio}" required:"true"`
	CurrencyFixedFeeerFlags `prefix:"feeer-fixed-" help:"fixed feeer"`
	CurrencyRatioFeeerFlags `prefix:"feeer-ratio-" help:"ratio feeer"`
	// contains filtered or unexported fields
}

func (*CurrencyDesignFlags) IsValid

func (fl *CurrencyDesignFlags) IsValid([]byte) error

type CurrencyFixedFeeerFlags

type CurrencyFixedFeeerFlags struct {
	Receiver AddressFlag `name:"receiver" help:"fee receiver account address"`
	Amount   BigFlag     `name:"amount" help:"fee amount"`
	// contains filtered or unexported fields
}

func (*CurrencyFixedFeeerFlags) IsValid

func (fl *CurrencyFixedFeeerFlags) IsValid([]byte) error

type CurrencyIDFlag

type CurrencyIDFlag struct {
	CID types.CurrencyID
}

func (*CurrencyIDFlag) String

func (v *CurrencyIDFlag) String() string

func (*CurrencyIDFlag) UnmarshalText

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

type CurrencyPolicyFlags

type CurrencyPolicyFlags struct {
	NewAccountMinBalance BigFlag `name:"new-account-min-balance" help:"minimum balance for new account"` // nolint lll
}

func (*CurrencyPolicyFlags) IsValid

func (*CurrencyPolicyFlags) IsValid([]byte) error

type CurrencyRatioFeeerFlags

type CurrencyRatioFeeerFlags struct {
	Receiver AddressFlag `name:"receiver" help:"fee receiver account address"`
	Ratio    float64     `name:"ratio" help:"fee ratio, multifly by operation amount"`
	Min      BigFlag     `name:"min" help:"minimum fee"`
	Max      BigFlag     `name:"max" help:"maximum fee"`
	// contains filtered or unexported fields
}

func (*CurrencyRatioFeeerFlags) IsValid

func (fl *CurrencyRatioFeeerFlags) IsValid([]byte) error

type DIDCommand

type DIDCommand struct {
	CreateDID         CreateDIDCommand         `cmd:"" name:"create-did" help:"create new did"`
	UpdateDIDDocument UpdateDIDDocumentCommand `cmd:"" name:"update-did-document" help:"update did document"`
	RegisterModel     RegisterModelCommand     `cmd:"" name:"register-model" help:"register did model"`
}

type GenesisBlockGenerator

type GenesisBlockGenerator struct {
	*logging.Logging
	// contains filtered or unexported fields
}

func NewGenesisBlockGenerator

func NewGenesisBlockGenerator(
	local base.LocalNode,
	networkID base.NetworkID,
	encs *encoder.Encoders,
	db isaac.Database,
	dataroot string,
	facts []base.Fact,
	loadImportedBlockMap func() (base.BlockMap, bool, error),
	ctx context.Context,
) *GenesisBlockGenerator

func (*GenesisBlockGenerator) Generate

func (g *GenesisBlockGenerator) Generate() (base.BlockMap, error)

type INITCommand

type INITCommand struct {
	GenesisDesign string `arg:"" name:"genesis design" help:"genesis design" type:"filepath"`
	launch.PrivatekeyFlags
	launch.DesignFlag
	launch.DevFlags `embed:"" prefix:"dev."`
}

func (*INITCommand) Run

func (cmd *INITCommand) 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 KeyAddressCommand

type KeyAddressCommand struct {
	BaseCommand
	Threshold uint `` // nolint
	/* 126-byte string literal not displayed */
	Key         KeyFlag `arg:"" name:"key" help:"key for address (ex: \"<public key>,<weight>\") separator @" optional:""`
	AddressType string  `help:"key type for address. select mitum or ether" default:"mitum"`
}

func (*KeyAddressCommand) Run

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

type KeyFlag

type KeyFlag struct {
	Values []types.BaseAccountKey
}

func (*KeyFlag) UnmarshalText

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

type KeyLoadCommand

type KeyLoadCommand struct {
	BaseCommand
	KeyString string `arg:"" name:"key string" help:"key string"`
}

func (*KeyLoadCommand) Run

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

type KeyNewCommand

type KeyNewCommand struct {
	BaseCommand
	Seed string `arg:"" name:"seed" optional:"" help:"seed for generating key"`
}

func (*KeyNewCommand) Run

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

type KeySignCommand

type KeySignCommand struct {
	BaseCommand
	KeyString string             `arg:"" name:"privatekey" help:"privatekey string"`
	NetworkID string             `arg:"" name:"network-id" help:"network-id"`
	Body      *os.File           `arg:"" help:"body"`
	Node      launch.AddressFlag `help:"node address"`
	Token     string             `help:"set fact token"`
	// contains filtered or unexported fields
}

func (*KeySignCommand) Run

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

type MintCommand

type MintCommand struct {
	BaseCommand
	OperationFlags
	Node AddressFlag `arg:"" name:"node" help:"node address" required:"true"`

	ReceiverAmount AddressCurrencyAmountFlag `arg:"" name:"receiver amount" help:"ex: \"<receiver address>,<currency>,<amount>\" separator @"`
	// 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"`
	NodeMetric     launchcmd.NetworkClientNodeMetricsCommand  `cmd:"" name:"node-metric" help:"remote node metrics"`
	SendOperation  NetworkClientSendOperationCommand          `cmd:"" name:"send-operation" help:"send operation"`
	State          NetworkClientStateCommand                  `cmd:"" name:"state" help:"get state"`
	LastBlockMap   launchcmd.NetworkClientLastBlockMapCommand `cmd:"" name:"last-blockmap" help:"get last blockmap"`
	BlockItemFiles NetworkClientBlockItemFilesCommand         `cmd:"" name:"block-item-files" help:"download block item files"`
	BlockItemFile  NetworkClientBlockItemFileCommand          `cmd:"" name:"block-item-file" help:"download block item file"`
	Node           struct {
		Read  NetworkClientReadNodeCommand  `cmd:"" name:"read" help:"read node value"`
		Write NetworkClientWriteNodeCommand `cmd:"" name:"write" help:"write node value"`
	} `cmd:"" name:"node" 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 NetworkIDFlag

type NetworkIDFlag []byte

func (NetworkIDFlag) NetworkID

func (v NetworkIDFlag) NetworkID() base.NetworkID

func (*NetworkIDFlag) UnmarshalText

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

type NetworkPolicyCommand

type NetworkPolicyCommand struct {
	BaseCommand
	OperationFlags

	MaxOperationInProposal    uint64      `help:"max operation in proposal" default:"${max_operation_in_proposal}"`   // nolint
	SuffrageCandidateLifespan uint64      `help:"suffrage candidate lifespan" default:"${max_operation_in_proposal}"` // nolint
	MaxSuffrageSize           uint64      `help:"max suffrage size" default:"${max_operation_in_proposal}"`           // nolint
	SuffrageExpelLifespan     uint64      `help:"suffrage expel lifespan" default:"${max_operation_in_proposal}"`     // nolint
	EmptyProposalNoBlock      bool        `help:"empty proposal no block"`                                            // nolint
	Node                      AddressFlag `arg:"" name:"node" help:"node address" required:"true"`
	// contains filtered or unexported fields
}

func (*NetworkPolicyCommand) Run

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

type OperationExtensionFlags

type OperationExtensionFlags struct {
	DIDContract        AddressFlag    `name:"authentication-contract" help:"contract account for authentication"`
	AuthenticationID   string         `name:"authentication-id" help:"auth id for authentication"`
	Proof              string         `name:"authentication-proof" help:"data for proof authentication"`
	IsPrivateKey       bool           `name:"is-privatekey" help:"proor-data is private key, not signature"`
	OpSender           AddressFlag    `name:"settlement-op-sender" help:"op sender account for settlement"`
	OpSenderPrivatekey PrivatekeyFlag `name:"settlement-op-sender-privatekey" help:"op sender privatekey for settlement"`
	ProxyPayer         AddressFlag    `name:"settlement-proxy-payer" help:"proxy payer account for settlement"`
	// contains filtered or unexported fields
}

type OperationFlags

type OperationFlags struct {
	Privatekey PrivatekeyFlag `arg:"" name:"privatekey" help:"privatekey to sign operation" required:"true"`
	Token      string         `help:"token for operation" optional:""`
	NetworkID  NetworkIDFlag  `name:"network-id" help:"network-id" required:"true" default:"${network_id}"`
	Pretty     bool           `name:"pretty" help:"pretty format"`
}

func (*OperationFlags) IsValid

func (op *OperationFlags) IsValid([]byte) error

type PrivatekeyFlag

type PrivatekeyFlag struct {
	base.Privatekey
	// contains filtered or unexported fields
}

func (PrivatekeyFlag) Empty

func (v PrivatekeyFlag) Empty() bool

func (*PrivatekeyFlag) UnmarshalText

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

type ProposalOperationFactHintFunc

type ProposalOperationFactHintFunc func() func(hint.Hint) bool

type PublickeyFlag

type PublickeyFlag struct {
	base.Publickey
	// contains filtered or unexported fields
}

func (PublickeyFlag) Empty

func (v PublickeyFlag) Empty() bool

func (*PublickeyFlag) UnmarshalText

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

type RegisterCurrencyCommand

type RegisterCurrencyCommand struct {
	BaseCommand
	OperationFlags
	CurrencyDesignFlags
	Node AddressFlag `arg:"" name:"node" help:"node address" required:"true"`
	// contains filtered or unexported fields
}

func (*RegisterCurrencyCommand) Run

type RegisterModelCommand

type RegisterModelCommand struct {
	BaseCommand
	OperationFlags
	Sender    AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract  AddressFlag    `arg:"" name:"contract" help:"contract account to register policy" required:"true"`
	DIDMethod string         `arg:"" name:"did-method" help:"did method" required:"true"`
	Currency  CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*RegisterModelCommand) Run

func (cmd *RegisterModelCommand) 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 ValidateBlocksCommand          `cmd:"" help:"validate blocks in storage"`
	Status         launchcmd.StorageStatusCommand `cmd:"" help:"storage status"`
	Database       launchcmd.DatabaseCommand      `cmd:"" help:""`
}

type StringLoad

type StringLoad []byte

func (StringLoad) Bytes

func (v StringLoad) Bytes() []byte

func (StringLoad) String

func (v StringLoad) String() string

func (*StringLoad) UnmarshalText

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

type SuffrageCandidateCommand

type SuffrageCandidateCommand struct {
	BaseCommand
	OperationFlags
	Node      AddressFlag   `arg:"" name:"node" help:"node address" required:"true"`
	PublicKey PublickeyFlag `arg:"" name:"public-key" help:"public key" required:"true"`
	// contains filtered or unexported fields
}

func (*SuffrageCandidateCommand) Run

type SuffrageCommand

type SuffrageCommand struct {
	Mint              MintCommand              `cmd:"" name:"mint" help:"mint operation"`
	SuffrageCandidate SuffrageCandidateCommand `cmd:"" name:"suffrage-candidate" help:"suffrage candidate operation"`
	SuffrageJoin      SuffrageJoinCommand      `cmd:"" name:"suffrage-join" help:"suffrage join operation"`
	SuffrageDisjoin   SuffrageDisjoinCommand   `cmd:"" name:"suffrage-disjoin" help:"suffrage disjoin operation"` // revive:disable-line:line-length-limit
	NetworkPolicy     NetworkPolicyCommand     `cmd:"" help:"network-policy" help:"network policy operation"`
}

type SuffrageDisjoinCommand

type SuffrageDisjoinCommand struct {
	BaseCommand
	OperationFlags
	Node  AddressFlag `arg:"" name:"node" help:"node address" required:"true"`
	Start base.Height `arg:"" name:"height" help:"block height" required:"true"`
	// contains filtered or unexported fields
}

func (*SuffrageDisjoinCommand) Run

type SuffrageJoinCommand

type SuffrageJoinCommand struct {
	BaseCommand
	OperationFlags
	Node  AddressFlag `arg:"" name:"node" help:"candidate address" required:"true"`
	Start base.Height `arg:"" name:"height" help:"block height" required:"true"`
	// contains filtered or unexported fields
}

func (*SuffrageJoinCommand) Run

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

type TransferCommand

type TransferCommand struct {
	BaseCommand
	OperationFlags
	Sender         AddressFlag               `arg:"" name:"sender" help:"sender address" required:"true"`
	ReceiverAmount AddressCurrencyAmountFlag `` /* 129-byte string literal not displayed */
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*TransferCommand) Run

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

type UpdateCurrencyCommand

type UpdateCurrencyCommand struct {
	BaseCommand
	OperationFlags
	Currency                CurrencyIDFlag `arg:"" name:"currency-id" help:"currency id" required:"true"`
	CurrencyPolicyFlags     `prefix:"policy-" help:"currency policy" required:"true"`
	FeeerString             string `name:"feeer" help:"feeer type, {nil, fixed, ratio}" required:"true"`
	CurrencyFixedFeeerFlags `prefix:"feeer-fixed-" help:"fixed feeer"`
	CurrencyRatioFeeerFlags `prefix:"feeer-ratio-" help:"ratio feeer"`
	Node                    AddressFlag `arg:"" name:"node" help:"node address" required:"true"`
	// contains filtered or unexported fields
}

func (*UpdateCurrencyCommand) Run

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

type UpdateDIDDocumentCommand

type UpdateDIDDocumentCommand struct {
	BaseCommand
	OperationFlags
	Sender   AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract AddressFlag    `arg:"" name:"contract" help:"contract address" required:"true"`
	DID      string         `arg:"" name:"did" help:"did" required:"true"`
	Currency CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	Document string         `arg:"" name:"document" help:"document; default is stdin" required:"true" default:"-"`
	IsString bool           `name:"document.is-string" help:"input is string, not file"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*UpdateDIDDocumentCommand) Run

type UpdateHandlerCommand

type UpdateHandlerCommand struct {
	BaseCommand
	OperationFlags
	Sender   AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract AddressFlag    `arg:"" name:"contract" help:"target contract account address" required:"true"`
	Currency CurrencyIDFlag `arg:"" name:"currency-id" help:"currency id" required:"true"`
	Handlers []AddressFlag  `arg:"" name:"handlers" help:"handlers"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*UpdateHandlerCommand) Run

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

type UpdateKeyCommand

type UpdateKeyCommand struct {
	BaseCommand
	OperationFlags
	Sender    AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Threshold uint           `help:"threshold for keys (default: ${create_account_threshold})" default:"${create_account_threshold}"` // nolint
	Key       KeyFlag        `name:"key" help:"key for new account (ex: \"<public key>,<weight>\") separator @"`
	Currency  CurrencyIDFlag `arg:"" name:"currency-id" help:"currency id" required:"true"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*UpdateKeyCommand) Run

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

type UpdateRecipientCommand

type UpdateRecipientCommand struct {
	BaseCommand
	OperationFlags
	Sender     AddressFlag    `arg:"" name:"sender" help:"sender address" required:"true"`
	Contract   AddressFlag    `arg:"" name:"contract" help:"target contract account address" required:"true"`
	Currency   CurrencyIDFlag `arg:"" name:"currency-id" help:"currency id" required:"true"`
	Recipients []AddressFlag  `arg:"" name:"recipients" help:"recipients"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

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

type WithdrawCommand

type WithdrawCommand struct {
	BaseCommand
	OperationFlags
	Sender AddressFlag        `arg:"" name:"sender" help:"sender address" required:"true"`
	Target AddressFlag        `arg:"" name:"target" help:"target contract account address" required:"true"`
	Amount CurrencyAmountFlag `arg:"" name:"currency-amount" help:"amount (ex: \"<currency>,<amount>\")"`
	OperationExtensionFlags
	// contains filtered or unexported fields
}

func (*WithdrawCommand) Run

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

Jump to

Keyboard shortcuts

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