cmd

package
v0.0.0-...-369a1d7 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EthereumCommand = &cobra.Command{
	Use:   "ethereum",
	Short: `Provides access to Keep network Ethereum contracts.`,
	Long:  ethereumDescription,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if err := clientConfig.ReadConfig(configFilePath, cmd.Flags(), config.General, config.Ethereum); err != nil {
			logger.Fatalf("error reading config: %v", err)
		}

		beaconcmd.ModuleCommand.SetConfig(&clientConfig.Ethereum)
		ecdsacmd.ModuleCommand.SetConfig(&clientConfig.Ethereum)
		tbtccmd.ModuleCommand.SetConfig(&clientConfig.Ethereum)
		thresholdcmd.ModuleCommand.SetConfig(&clientConfig.Ethereum)
	},
}

EthereumCommand contains the definition of the ethereum command-line subcommand and its own subcommands.

View Source
var MaintainerCliCommand = &cobra.Command{
	Use:              "maintainer-cli",
	Short:            "Maintainer CLI Tools",
	Long:             "The tool exposes commands for tools associated with maintainers.",
	TraverseChildren: true,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if err := clientConfig.ReadConfig(
			configFilePath,
			cmd.Flags(),
			config.General, config.Ethereum, config.BitcoinElectrum,
		); err != nil {
			logger.Fatalf("error reading config: %v", err)
		}
	},
}

MaintainerCliCommand contains the definition of tools associated with maintainers module.

View Source
var MaintainerCommand = &cobra.Command{
	Use:   "maintainer",
	Short: `(experimental) Starts maintainers`,
	Long:  `(experimental) The maintainer command starts maintainers`,
	PreRun: func(cmd *cobra.Command, args []string) {
		if err := clientConfig.ReadConfig(
			configFilePath,
			cmd.Flags(),
			config.MaintainerCategories...,
		); err != nil {
			logger.Fatalf("error reading config: %v", err)
		}
	},
	RunE: maintainers,
}

MaintainerCommand contains the definition of the maintainer command-line subcommand.

View Source
var PingCommand = &cobra.Command{
	Use:                   "ping [multiaddr]...",
	Short:                 `bidirectional send between two peers to test the network`,
	Long:                  pingDescription,
	DisableFlagsInUseLine: true,
	RunE:                  pingRequest,
}

PingCommand contains the definition of the ping command-line subcommand.

View Source
var RootCmd = &cobra.Command{
	Use:              path.Base(os.Args[0]),
	Short:            "CLI for The Keep Network",
	Long:             "Command line interface (CLI) for running a Keep provider",
	TraverseChildren: true,
}

RootCmd contains the definition of the root command-line command.

View Source
var StartCommand = &cobra.Command{
	Use:   "start",
	Short: "Starts the Keep Client",
	Long:  "Starts the Keep Client in the foreground",
	PreRun: func(cmd *cobra.Command, args []string) {
		if err := clientConfig.ReadConfig(configFilePath, cmd.Flags(), config.StartCmdCategories...); err != nil {
			logger.Fatalf("error reading config: %v", err)
		}
	},
	Run: func(cmd *cobra.Command, args []string) {
		if err := start(cmd); err != nil {
			logger.Fatal(err)
		}
	},
}

StartCommand contains the definition of the start command-line subcommand.

Functions

func Initialize

func Initialize(version, revision string) *cobra.Command

Initialize initializes the root command and returns it.

Types

type PingMessage

type PingMessage struct {
	Sender  string
	Payload string
}

PingMessage is a network message sent between bootstrap peer and non-bootstrap peer in order to test the connection.

func (*PingMessage) Marshal

func (pm *PingMessage) Marshal() ([]byte, error)

Marshal converts this PingMessage to a byte array suitable for network communication.

func (*PingMessage) Type

func (pm *PingMessage) Type() string

Type returns a string type of the `PingMessage` so that it conforms to `net.Message` interface.

func (*PingMessage) Unmarshal

func (pm *PingMessage) Unmarshal(bytes []byte) error

Unmarshal converts a byte array produced by Marshal to a PingMessage.

type PongMessage

type PongMessage struct {
	Sender  string
	Payload string
}

PongMessage is a network message sent between bootstrap peer and non-bootstrap peer in order to test the connection.

func (*PongMessage) Marshal

func (pm *PongMessage) Marshal() ([]byte, error)

Marshal converts this PongMessage to a byte array suitable for network communication.

func (*PongMessage) Type

func (pm *PongMessage) Type() string

Type returns a string type of the `PongMessage` so that it conforms to `net.Message` interface.

func (*PongMessage) Unmarshal

func (pm *PongMessage) Unmarshal(bytes []byte) error

Unmarshal converts a byte array produced by Marshal to a PongMessage.

Jump to

Keyboard shortcuts

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