cmds

package
v0.0.0-...-e2facaa Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: GPL-3.0 Imports: 47 Imported by: 0

Documentation

Overview

Package cmds provides command line tools.

Index

Constants

View Source
const (
	ProcessNameDigestAPI      = "digest_api"
	ProcessNameStartDigestAPI = "start_digest_api"
	HookNameSetLocalChannel   = "set_local_channel"
)
View Source
const (
	ProcessNameDigester      = "digester"
	ProcessNameStartDigester = "start_digester"
	HookNameDigesterFollowUp = "followup_digester"
)
View Source
const ProcessNameDigestDatabase = "digest_database"

Variables

View Source
var (
	ContextValueDigestDesign   util.ContextKey = "digest_design"
	ContextValueDigestDatabase util.ContextKey = "digest_database"
	ContextValueDigestNetwork  util.ContextKey = "digest_network"
	ContextValueDigester       util.ContextKey = "digester"
	ContextValueCurrencyPool   util.ContextKey = "currency_pool"
)
View Source
var (
	DefaultDigestAPICache *url.URL
	DefaultDigestAPIBind  string
	DefaultDigestAPIURL   string
)
View Source
var (
	DefaultDigestURL  = "https://localhost:4430"
	DefaultDigestBind = "https://0.0.0.0:4430"
)
View Source
var (
	Hinters []hint.Hinter
	Types   []hint.Type
)
View Source
var (
	GenesisAccountKey = "genesis_account"
	GenesisBalanceKey = "genesis_balance"
)
View Source
var (
	ProcessorDigestAPI      pm.Process
	ProcessorStartDigestAPI pm.Process
)
View Source
var (
	ProcessorDigester      pm.Process
	ProcessorStartDigester pm.Process
)
View Source
var BaseNodeCommandHooks = func(cmd *BaseNodeCommand) []pm.Hook {
	return []pm.Hook{
		pm.NewHook(pm.HookPrefixPost, process.ProcessNameEncoders,
			process.HookNameAddHinters, process.HookAddHinters(Types, Hinters)).
			SetOverride(true),
		pm.NewHook(pm.HookPrefixPost, process.ProcessNameConfig,
			"load_digest_config", cmd.hookLoadDigestConfig).
			SetOverride(true).
			SetDir(process.HookNameConfigGenesisOperations, pm.HookDirAfter),
		pm.NewHook(pm.HookPrefixPost, process.ProcessNameConfig,
			"validate_digest_config", cmd.hookValidateDigestConfig).
			SetOverride(true).
			SetDir(process.HookNameValidateConfig, pm.HookDirAfter),
		pm.NewHook(pm.HookPrefixPost, process.ProcessNameConfig,
			process.HookNameConfigVerbose, hookVerboseConfig).
			SetOverride(true),
	}
}
View Source
var InitCommandHooks = func(cmd *InitCommand) []pm.Hook {
	genesisOperationHandlers := map[string]process.HookHandlerGenesisOperations{
		"genesis-currencies": GenesisOperationsHandlerGenesisCurrencies,
	}

	for k, v := range process.DefaultHookHandlersGenesisOperations {
		genesisOperationHandlers[k] = v
	}

	return []pm.Hook{
		pm.NewHook(pm.HookPrefixPre, process.ProcessNameProposalProcessor,
			"initialize_proposal_processor", cmd.hookInitializeProposalProcessor).SetOverride(true),
		pm.NewHook(pm.HookPrefixPost, process.ProcessNameConfig,
			process.HookNameConfigGenesisOperations, process.HookGenesisOperationFunc(genesisOperationHandlers)).
			SetOverride(true),
	}
}
View Source
var KeyAddressVars = kong.Vars{
	"create_account_threshold": "100",
}
View Source
var ProcessorDigestDatabase pm.Process
View Source
var RunCommandHooks = func(cmd *RunCommand) []pm.Hook {
	return []pm.Hook{
		pm.NewHook(pm.HookPrefixPost, process.ProcessNameDatabase,
			"set_database", HookLoadCurrencies).SetOverride(true),
		pm.NewHook(pm.HookPrefixPost, process.ProcessNameNetwork,
			"set_currency_network_handlers", cmd.hookSetNetworkHandlers).SetOverride(true),
		pm.NewHook(pm.HookPrefixPre, process.ProcessNameProposalProcessor,
			"initialize_proposal_processor", HookInitializeProposalProcessor).SetOverride(true),
		pm.NewHook(pm.HookPrefixPost, ProcessNameDigestAPI,
			"set_digest_api_handlers", cmd.hookDigestAPIHandlers).SetOverride(true),
		pm.NewHook(pm.HookPrefixPost, ProcessNameDigester,
			"set_state_handler", cmd.hookSetStateHandler).SetOverride(true),
		pm.NewHook(pm.HookPrefixPost, ProcessNameDigester,
			HookNameDigesterFollowUp, HookDigesterFollowUp).SetOverride(true),
		pm.NewHook(pm.HookPrefixPre, ProcessNameDigestAPI,
			HookNameSetLocalChannel, HookSetLocalChannel).SetOverride(true),
	}
}
View Source
var SendVars = kong.Vars{
	"node_url": "quic://localhost:54321",
}

Functions

func AttachProposalProcessor

func AttachProposalProcessor(
	policy *isaac.LocalPolicy,
	nodepool *network.Nodepool,
	suffrage base.Suffrage,
	cp *currency.CurrencyPool,
) (*currency.OperationProcessor, error)

func GenerateKey

func GenerateKey(seed string) (key.Privatekey, error)

func GenesisOperationsHandlerGenesisCurrencies

func GenesisOperationsHandlerGenesisCurrencies(
	ctx context.Context,
	m map[string]interface{},
) (operation.Operation, error)

func HookDigesterFollowUp

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

func HookInitializeProposalProcessor

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

func HookLoadCurrencies

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

func HookSetLocalChannel

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

func InitializeProposalProcessor

func InitializeProposalProcessor(ctx context.Context, opr *currency.OperationProcessor) (context.Context, error)

func LoadCurrencyPoolContextValue

func LoadCurrencyPoolContextValue(ctx context.Context, l **currency.CurrencyPool) error

func LoadDatabaseContextValue

func LoadDatabaseContextValue(ctx context.Context, l **mongodbstorage.Database) error

func LoadDigestDatabaseContextValue

func LoadDigestDatabaseContextValue(ctx context.Context, l **digest.Database) error

func LoadDigestDesignContextValue

func LoadDigestDesignContextValue(ctx context.Context, l *DigestDesign) error

func LoadDigestNetworkContextValue

func LoadDigestNetworkContextValue(ctx context.Context, l **digest.HTTP2Server) error

func LoadDigesterContextValue

func LoadDigesterContextValue(ctx context.Context, l **digest.Digester) error

func LoadSeal

func LoadSeal(b []byte, networkID base.NetworkID) (seal.Seal, error)

func LoadSealAndAddOperation

func LoadSealAndAddOperation(
	b []byte,
	privatekey key.Privatekey,
	networkID base.NetworkID,
	op operation.Operation,
) (operation.Seal, error)

func NewSendHandler

func NewSendHandler(
	priv key.Privatekey,
	networkID base.NetworkID,
	chans func() ([]network.Channel, error),
	connInfo network.ConnInfo,
) func(interface{}) (seal.Seal, error)

func NodeInfoHandler

func NodeInfoHandler(
	handler network.NodeInfoHandler,
) network.NodeInfoHandler

func PrettyPrint

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

func ProcessDigestAPI

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

func ProcessDigestDatabase

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

func ProcessDigester

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

func ProcessStartDigestAPI

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

func ProcessStartDigester

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

func SignSeal

func SignSeal(sl seal.Seal, priv key.Privatekey, networkID base.NetworkID) (seal.Seal, error)

Types

type AccountKeysDesign

type AccountKeysDesign struct {
	Threshold  uint
	KeysDesign []*KeyDesign             `yaml:"keys"`
	Keys       currency.BaseAccountKeys `yaml:"-"`
	Address    currency.Address         `yaml:"-"`
}

func (*AccountKeysDesign) IsValid

func (akd *AccountKeysDesign) IsValid([]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 {
	*mitumcmds.BaseCommand
	Out io.Writer `kong:"-"`
}

func NewBaseCommand

func NewBaseCommand(name string) *BaseCommand

type BaseNodeCommand

type BaseNodeCommand struct {
	*logging.Logging
}

func NewBaseNodeCommand

func NewBaseNodeCommand(l *logging.Logging) *BaseNodeCommand

func (*BaseNodeCommand) BaseProcesses

func (cmd *BaseNodeCommand) BaseProcesses(ps *pm.Processes) (*pm.Processes, error)

type BigFlag

type BigFlag struct {
	currency.Big
}

func (*BigFlag) UnmarshalText

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

type CleanByHeightStorageCommand

type CleanByHeightStorageCommand struct {
	*mitumcmds.CleanByHeightStorageCommand
	*BaseNodeCommand
}

type CleanStorageCommand

type CleanStorageCommand struct {
	*mitumcmds.CleanStorageCommand
	*BaseNodeCommand
}

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
	Keys      []KeyFlag            `name:"key" help:"key for new account (ex: \"<public key>,<weight>\")" sep:"@"`
	Seal      mitumcmds.FileLoad   `help:"seal" optional:""`
	Amounts   []CurrencyAmountFlag `arg:"" name:"currency-amount" help:"amount (ex: \"<currency>,<amount>\")"`
	// contains filtered or unexported fields
}

func NewCreateAccountCommand

func NewCreateAccountCommand() CreateAccountCommand

func (*CreateAccountCommand) Run

func (cmd *CreateAccountCommand) Run(version util.Version) error

type CurrencyAmountFlag

type CurrencyAmountFlag struct {
	CID currency.CurrencyID
	Big currency.Big
}

func (*CurrencyAmountFlag) String

func (v *CurrencyAmountFlag) String() string

func (*CurrencyAmountFlag) UnmarshalText

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

type CurrencyDesign

type CurrencyDesign struct {
	CurrencyString             *string         `yaml:"currency"`
	BalanceString              *string         `yaml:"balance"`
	NewAccountMinBalanceString *string         `yaml:"new-account-min-balance"`
	Feeer                      *FeeerDesign    `yaml:"feeer"`
	Balance                    currency.Amount `yaml:"-"`
	NewAccountMinBalance       currency.Big    `yaml:"-"`
}

func (*CurrencyDesign) IsValid

func (de *CurrencyDesign) IsValid([]byte) error

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"`
	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 currency.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 CurrencyPolicyUpdaterCommand

type CurrencyPolicyUpdaterCommand 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"`
	// contains filtered or unexported fields
}

func NewCurrencyPolicyUpdaterCommand

func NewCurrencyPolicyUpdaterCommand() CurrencyPolicyUpdaterCommand

func (*CurrencyPolicyUpdaterCommand) Run

func (cmd *CurrencyPolicyUpdaterCommand) Run(version util.Version) 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 CurrencyRegisterCommand

type CurrencyRegisterCommand struct {
	*BaseCommand
	OperationFlags
	CurrencyDesignFlags
}

func NewCurrencyRegisterCommand

func NewCurrencyRegisterCommand() CurrencyRegisterCommand

func (*CurrencyRegisterCommand) Run

func (cmd *CurrencyRegisterCommand) Run(version util.Version) error

type DeployCommand

type DeployCommand struct {
	Key DeployKeyCommand `cmd:"" name:"key" help:"deploy key"`
}

func NewDeployCommand

func NewDeployCommand() DeployCommand

type DeployKeyCommand

type DeployKeyCommand struct {
	New    mitumcmds.DeployKeyNewCommand    `cmd:"" name:"new" help:"request new deploy key"`
	Keys   mitumcmds.DeployKeyKeysCommand   `cmd:"" name:"keys" help:"deploy keys"`
	Key    mitumcmds.DeployKeyKeyCommand    `cmd:"" name:"key" help:"deploy key"`
	Revoke mitumcmds.DeployKeyRevokeCommand `cmd:"" name:"revoke" help:"revoke deploy key"`
}

func NewDeployKeyCommand

func NewDeployKeyCommand() DeployKeyCommand

type DigestDesign

type DigestDesign struct {
	NetworkYAML *yamlconfig.LocalNetwork `yaml:"network,omitempty"`
	CacheYAML   *string                  `yaml:"cache,omitempty"`
	// contains filtered or unexported fields
}

func (*DigestDesign) Cache

func (no *DigestDesign) Cache() *url.URL

func (DigestDesign) MarshalJSON

func (no DigestDesign) MarshalJSON() ([]byte, error)

func (*DigestDesign) Network

func (no *DigestDesign) Network() config.LocalNetwork

func (*DigestDesign) Set

func (no *DigestDesign) Set(ctx context.Context) (context.Context, error)

type DigestDesignPackerJSON

type DigestDesignPackerJSON struct {
	Network config.LocalNetwork `json:"network"`
	Cache   string              `json:"cache"`
}

type FeeerDesign

type FeeerDesign struct {
	Type   string
	Extras map[string]interface{} `yaml:",inline"`
}

FeeerDesign is used for genesis currencies and naturally it's receiver is genesis account

func (*FeeerDesign) IsValid

func (no *FeeerDesign) IsValid([]byte) error

func (FeeerDesign) MarshalJSON

func (no FeeerDesign) MarshalJSON() ([]byte, error)

type GenerateKeyCommand

type GenerateKeyCommand struct {
	*BaseCommand
	Seed   string `name:"seed" help:"seed (default: random string)" optional:""`
	JSON   bool   `name:"json" help:"json output format (default: false)" optional:"" default:"false"`
	Pretty bool   `name:"pretty" help:"pretty format"`
}

func NewGenerateKeyCommand

func NewGenerateKeyCommand() GenerateKeyCommand

func (*GenerateKeyCommand) Run

func (cmd *GenerateKeyCommand) Run(version util.Version) error

type GenesisCurrenciesDesign

type GenesisCurrenciesDesign struct {
	AccountKeys *AccountKeysDesign `yaml:"account-keys"`
	Currencies  []*CurrencyDesign  `yaml:"currencies"`
}

func (*GenesisCurrenciesDesign) IsValid

func (de *GenesisCurrenciesDesign) IsValid([]byte) error

type InitCommand

type InitCommand struct {
	*BaseNodeCommand
	*mitumcmds.InitCommand
}

func NewInitCommand

func NewInitCommand(dryrun bool) (InitCommand, error)

type KeyAddressCommand

type KeyAddressCommand struct {
	*BaseCommand
	Threshold uint `` // nolint
	/* 126-byte string literal not displayed */
	Keys []KeyFlag `arg:"" name:"key" help:"key for address (ex: \"<public key>,<weight>\")" sep:"@" optional:""`
}

func NewKeyAddressCommand

func NewKeyAddressCommand() KeyAddressCommand

func (*KeyAddressCommand) Run

func (cmd *KeyAddressCommand) Run(version util.Version) error

type KeyCommand

type KeyCommand struct {
	New     GenerateKeyCommand `cmd:"" help:"new keypair"`
	Verify  VerifyKeyCommand   `cmd:"" help:"verify key"`
	Address KeyAddressCommand  `cmd:"" help:"generate address from key"`
	Sign    SignKeyCommand     `cmd:"" help:"signature signing"`
}

func NewKeyCommand

func NewKeyCommand() KeyCommand

type KeyDesign

type KeyDesign struct {
	PublickeyString string `yaml:"publickey"`
	Weight          uint
	Key             currency.BaseAccountKey `yaml:"-"`
}

func (*KeyDesign) IsValid

func (kd *KeyDesign) IsValid([]byte) error

type KeyFlag

type KeyFlag struct {
	Key currency.BaseAccountKey
}

func (*KeyFlag) UnmarshalText

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

type KeyUpdaterCommand

type KeyUpdaterCommand struct {
	*BaseCommand
	OperationFlags
	Target    AddressFlag    `arg:"" name:"target" help:"target address" required:"true"`
	Currency  CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	Threshold uint           `help:"threshold for keys (default: ${create_account_threshold})" default:"${create_account_threshold}"` // nolint
	Keys      []KeyFlag      `name:"key" help:"key for account (ex: \"<public key>,<weight>\")" sep:"@"`
	// contains filtered or unexported fields
}

func NewKeyUpdaterCommand

func NewKeyUpdaterCommand() KeyUpdaterCommand

func (*KeyUpdaterCommand) Run

func (cmd *KeyUpdaterCommand) Run(version util.Version) error

type NodeCommand

type NodeCommand struct {
	Init          InitCommand                    `cmd:"" help:"initialize node"`
	Run           RunCommand                     `cmd:"" help:"run node"`
	Info          NodeInfoCommand                `cmd:"" help:"node information"`
	StartHandover mitumcmds.StartHandoverCommand `cmd:"" name:"start-handover" help:"start handover"`
}

func NewNodeCommand

func NewNodeCommand() (NodeCommand, error)

type NodeInfoCommand

type NodeInfoCommand struct {
	*mitumcmds.NodeInfoCommand
}

func NewNodeInfoCommand

func NewNodeInfoCommand() NodeInfoCommand

func (*NodeInfoCommand) Run

func (cmd *NodeInfoCommand) Run(version util.Version) error

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  mitumcmds.NetworkIDFlag `name:"network-id" help:"network-id" required:"true"`
	Memo       string                  `name:"memo" help:"memo"`
	Pretty     bool                    `name:"pretty" help:"pretty format"`
}

func (*OperationFlags) IsValid

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

type PrivatekeyFlag

type PrivatekeyFlag struct {
	key.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 RunCommand

type RunCommand struct {
	*mitumcmds.RunCommand
	*BaseNodeCommand
}

func NewRunCommand

func NewRunCommand(dryrun bool) (RunCommand, error)

type SealCommand

type SealCommand struct {
	Send                  SendCommand                  `cmd:"" name:"send" help:"send seal to remote mitum node"`
	CreateAccount         CreateAccountCommand         `cmd:"" name:"create-account" help:"create new account"`
	Transfer              TransferCommand              `cmd:"" name:"transfer" help:"transfer big"`
	KeyUpdater            KeyUpdaterCommand            `cmd:"" name:"key-updater" help:"update keys"`
	CurrencyRegister      CurrencyRegisterCommand      `cmd:"" name:"currency-register" help:"register new currency"`
	CurrencyPolicyUpdater CurrencyPolicyUpdaterCommand `cmd:"" name:"currency-policy-updater" help:"update currency policy"`  // revive:disable-line:line-length-limit
	SuffrageInflation     SuffrageInflationCommand     `cmd:"" name:"suffrage-inflation" help:"suffrage inflation operation"` // revive:disable-line:line-length-limit
	Sign                  SignSealCommand              `cmd:"" name:"sign" help:"sign seal"`
	SignFact              SignFactCommand              `cmd:"" name:"sign-fact" help:"sign facts of operation seal"`
}

func NewSealCommand

func NewSealCommand() SealCommand

type SendCommand

type SendCommand struct {
	*BaseCommand
	URL        []*url.URL              `name:"node" help:"remote mitum url (default: ${node_url})" default:"${node_url}"` // nolint
	NetworkID  mitumcmds.NetworkIDFlag `name:"network-id" help:"network-id" `
	Seal       mitumcmds.FileLoad      `help:"seal" optional:""`
	DryRun     bool                    `help:"dry-run, print operation" optional:"" default:"false"`
	Pretty     bool                    `name:"pretty" help:"pretty format"`
	Privatekey PrivatekeyFlag          `arg:"" name:"privatekey" help:"privatekey for sign"`
	Timeout    time.Duration           `name:"timeout" help:"timeout; default: 5s"`
	TLSInscure bool                    `name:"tls-insecure" help:"allow inseucre TLS connection; default is false"`
	From       string                  `name:"from" help:"from conninfo; default is empty"`
}

func NewSendCommand

func NewSendCommand() SendCommand

func (*SendCommand) Run

func (cmd *SendCommand) Run(version util.Version) error

type SignFactCommand

type SignFactCommand struct {
	*BaseCommand
	Privatekey PrivatekeyFlag          `arg:"" name:"privatekey" help:"sender's privatekey" required:"true"`
	NetworkID  mitumcmds.NetworkIDFlag `name:"network-id" help:"network-id" required:"true"`
	Pretty     bool                    `name:"pretty" help:"pretty format"`
	Seal       mitumcmds.FileLoad      `help:"seal" optional:""`
}

func NewSignFactCommand

func NewSignFactCommand() SignFactCommand

func (*SignFactCommand) Run

func (cmd *SignFactCommand) Run(version util.Version) error

type SignKeyCommand

type SignKeyCommand struct {
	*BaseCommand
	Key   StringLoad `arg:"" name:"privatekey" help:"privatekey" required:"true"`
	Base  string     `arg:"" name:"signature base" help:"signature base for signing" required:"true"`
	Quite bool       `name:"quite" short:"q" help:"keep silence"`
}

func NewSignKeyCommand

func NewSignKeyCommand() SignKeyCommand

func (*SignKeyCommand) Run

func (cmd *SignKeyCommand) Run(version util.Version) error

type SignSealCommand

type SignSealCommand struct {
	*BaseCommand
	Privatekey PrivatekeyFlag          `arg:"" name:"privatekey" help:"sender's privatekey" required:"true"`
	NetworkID  mitumcmds.NetworkIDFlag `name:"network-id" help:"network-id" required:"true"`
	Pretty     bool                    `name:"pretty" help:"pretty format"`
	Seal       mitumcmds.FileLoad      `help:"seal" optional:""`
}

func NewSignSealCommand

func NewSignSealCommand() SignSealCommand

func (*SignSealCommand) Run

func (cmd *SignSealCommand) Run(version util.Version) error

type StorageCommand

type StorageCommand struct {
	Download                    mitumcmds.BlockDownloadCommand    `cmd:"" name:"download" help:"download block data"`
	BlockdataVerify             mitumcmds.BlockdataVerifyCommand  `cmd:"" name:"verify-blockdata" help:"verify block data"` // revive:disable-line:line-length-limit
	DatabaseVerify              mitumcmds.DatabaseVerifyCommand   `cmd:"" name:"verify-database" help:"verify database"`    // revive:disable-line:line-length-limit
	CleanStorage                CleanStorageCommand               `cmd:"" name:"clean" help:"clean storage"`
	CleanByHeightStorageCommand CleanByHeightStorageCommand       `cmd:"" name:"clean-by-height" help:"clean storage by height"` // revive:disable-line:line-length-limit
	Restore                     restoreCommand                    `cmd:"" help:"restore blocks from blockdata"`
	SetBlockdataMaps            mitumcmds.SetBlockdataMapsCommand `cmd:"" name:"set-blockdatamaps" help:"set blockdatamaps"` // revive:disable-line:line-length-limit
}

func NewStorageCommand

func NewStorageCommand() (StorageCommand, error)

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 SuffrageInflationCommand

type SuffrageInflationCommand struct {
	*BaseCommand
	OperationFlags
	Items []SuffrageInflationItemFlag `arg:"" name:"inflation item" help:"ex: \"<receiver address>,<currency>,<amount>\""`
	// contains filtered or unexported fields
}

func NewSuffrageInflationCommand

func NewSuffrageInflationCommand() SuffrageInflationCommand

func (*SuffrageInflationCommand) Run

func (cmd *SuffrageInflationCommand) Run(version util.Version) error

type SuffrageInflationItemFlag

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

func (*SuffrageInflationItemFlag) IsValid

func (v *SuffrageInflationItemFlag) IsValid([]byte) error

func (*SuffrageInflationItemFlag) String

func (v *SuffrageInflationItemFlag) String() string

func (*SuffrageInflationItemFlag) UnmarshalText

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

type TransferCommand

type TransferCommand struct {
	*BaseCommand
	OperationFlags
	Sender   AddressFlag          `arg:"" name:"sender" help:"sender address" required:"true"`
	Receiver AddressFlag          `arg:"" name:"receiver" help:"receiver address" required:"true"`
	Seal     mitumcmds.FileLoad   `help:"seal" optional:""`
	Amounts  []CurrencyAmountFlag `arg:"" name:"currency-amount" help:"amount (ex: \"<currency>,<amount>\")"`
	// contains filtered or unexported fields
}

func NewTransferCommand

func NewTransferCommand() TransferCommand

func (*TransferCommand) Run

func (cmd *TransferCommand) Run(version util.Version) error

type VerifyKeyCommand

type VerifyKeyCommand struct {
	*BaseCommand
	Key    StringLoad `arg:"" name:"key" help:"key" required:"true"`
	Quite  bool       `name:"quite" short:"q" help:"keep silence"`
	JSON   bool       `name:"json" help:"json output format (default: false)" optional:"" default:"false"`
	Pretty bool       `name:"pretty" help:"pretty format"`
}

func NewVerifyKeyCommand

func NewVerifyKeyCommand() VerifyKeyCommand

func (*VerifyKeyCommand) Run

func (cmd *VerifyKeyCommand) Run(version util.Version) error

Jump to

Keyboard shortcuts

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