cmds

package
v0.0.0-...-7e510f9 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 39 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.DesignHint, Instance: types.Design{}},
	{Hint: types.DataHint, Instance: types.Data{}},
	{Hint: types.DocumentHint, Instance: types.Document{}},

	{Hint: did.CreateDIDHint, Instance: did.CreateDID{}},
	{Hint: did.MigrateDIDHint, Instance: did.MigrateDID{}},
	{Hint: did.ReactivateDIDHint, Instance: did.ReactivateDID{}},
	{Hint: did.DeactivateDIDHint, Instance: did.DeactivateDID{}},
	{Hint: did.RegisterModelHint, Instance: did.RegisterModel{}},
	{Hint: did.MigrateDIDItemHint, Instance: did.MigrateDIDItem{}},
	{Hint: state.DataStateValueHint, Instance: state.DataStateValue{}},
	{Hint: state.DesignStateValueHint, Instance: state.DesignStateValue{}},
	{Hint: state.DocumentStateValueHint, Instance: state.DocumentStateValue{}},
}
View Source
var AddedSupportedHinters = []encoder.DecodeDetail{
	{Hint: did.CreateDIDFactHint, Instance: did.CreateDIDFact{}},
	{Hint: did.MigrateDIDFactHint, Instance: did.MigrateDIDFact{}},
	{Hint: did.ReactivateDIDFactHint, Instance: did.ReactivateDIDFact{}},
	{Hint: did.DeactivateDIDFactHint, Instance: did.DeactivateDIDFact{}},
	{Hint: did.RegisterModelFactHint, Instance: did.RegisterModelFact{}},
}
View Source
var PNameOperationProcessorsMap = ps.Name("mitum-did-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 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 CreateDIDCommand

type CreateDIDCommand 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"`
	PubKey   string                      `arg:"" name:"pubKey" help:"public key" required:"true"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	// contains filtered or unexported fields
}

func (*CreateDIDCommand) Run

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

type DIDCommand

type DIDCommand struct {
	CreateDID     CreateDIDCommand     `cmd:"" name:"create-did" help:"create new did"`
	MigrateDID    MigrateDIDCommand    `cmd:"" name:"migrate-did" help:"migrate did"`
	ReactivateDID ReactivateDIDCommand `cmd:"" name:"reactivate-did" help:"reactivate did"`
	DeactivateDID DeactivateDIDCommand `cmd:"" name:"deactivate-did" help:"deactivate did"`
	RegisterModel RegisterModelCommand `cmd:"" name:"register-model" help:"register did model"`
}

type DeactivateDIDCommand

type DeactivateDIDCommand 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"`
	DID      string                      `arg:"" name:"did" help:"did" required:"true"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	// contains filtered or unexported fields
}

func (*DeactivateDIDCommand) Run

func (cmd *DeactivateDIDCommand) 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 MigrateDIDCommand

type MigrateDIDCommand 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"`
	PubKey   string                      `arg:"" name:"pubKey" help:"public key" required:"true"`
	TxID     string                      `arg:"" name:"txID" help:"txID" required:"true"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	// contains filtered or unexported fields
}

func (*MigrateDIDCommand) Run

func (cmd *MigrateDIDCommand) 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 ReactivateDIDCommand

type ReactivateDIDCommand 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"`
	DID      string                      `arg:"" name:"did" help:"did" required:"true"`
	Currency currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	// contains filtered or unexported fields
}

func (*ReactivateDIDCommand) Run

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

type RegisterModelCommand

type RegisterModelCommand 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"`
	DIDMethod      string                      `arg:"" name:"did-method" help:"did method" required:"true"`
	DocContext     string                      `arg:"" name:"doc-context" help:"doc context" required:"true"`
	DocAuthType    string                      `arg:"" name:"doc-authType" help:"doc authentication type" required:"true"`
	DocSvcType     string                      `arg:"" name:"doc-serviceType" help:"doc service type" required:"true"`
	DocSvcEndPoint string                      `arg:"" name:"doc-serviceEndpoint" help:"doc service endpoint" required:"true"`
	Currency       currencycmds.CurrencyIDFlag `arg:"" name:"currency" help:"currency id" required:"true"`
	// 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 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