commands

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommonFlags []cli.Flag = []cli.Flag{
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:    "wallet",
		Usage:   "deal client wallet address on node",
		Aliases: []string{"w"},
		EnvVars: []string{"DEALBOT_WALLET_ADDRESS"},
	}),
}
View Source
var ControllerCmd = &cli.Command{
	Name:   "controller",
	Usage:  "Start the dealbot controller",
	Flags:  ControllerFlags,
	Action: controllerCommand,
}
View Source
var ControllerFlags = []cli.Flag{
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:    "listen",
		Usage:   "host:port to bind http server on",
		Aliases: []string{"l"},
		EnvVars: []string{"DEALBOT_LISTEN"},
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:    "metrics",
		Usage:   "value of 'prometheus' or 'log'",
		Aliases: []string{"m"},
		EnvVars: []string{"DEALBOT_METRICS"},
	}),
	altsrc.NewPathFlag(&cli.PathFlag{
		Name:    "identity",
		Usage:   "location of node identity for authenticating results",
		Aliases: []string{"i"},
		EnvVars: []string{"DEALBOT_IDENTITY_KEYPAIR"},
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:    "driver",
		Usage:   "type of database backend to use",
		EnvVars: []string{"DEALBOT_PERSISTENCE_DRIVER"},
		Value:   "sqlite",
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:    "dbloc",
		Usage:   "connection string for sql DB",
		EnvVars: []string{"DEALBOT_PERSISTENCE_CONN"},
	}),
}
View Source
var DaemonCmd = &cli.Command{
	Name:   "daemon",
	Usage:  "Start a dealbot daemon, accepting tasks over RPC",
	Flags:  DaemonFlags,
	Action: daemonCommand,
}
View Source
var DaemonFlags = append(DealFlags, append(CommonFlags, []cli.Flag{
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:    "listen",
		Usage:   "host:port to bind http server on",
		Aliases: []string{"l"},
		EnvVars: []string{"DEALBOT_LISTEN"},
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:     "endpoint",
		Usage:    "HTTP endpoint of the controller",
		Aliases:  []string{"e"},
		EnvVars:  []string{"DEALBOT_CONTROLLER_ENDPOINT"},
		Required: true,
	}),
}...)...)
View Source
var DealFlags = []cli.Flag{
	altsrc.NewPathFlag(&cli.PathFlag{
		Name:     "data-dir",
		Usage:    "writable directory used to transfer data to node",
		Aliases:  []string{"d"},
		EnvVars:  []string{"DEALBOT_DATA_DIRECTORY"},
		Required: true,
	}),
	altsrc.NewPathFlag(&cli.PathFlag{
		Name:    "node-data-dir",
		Usage:   "data-dir from relative to node's location [data-dir]",
		Aliases: []string{"n"},
		EnvVars: []string{"DEALBOT_NODE_DATA_DIRECTORY"},
	}),
}
View Source
var MakeRetrievalDealCmd = &cli.Command{
	Name:  "retrieval-deal",
	Usage: "Make retrieval deals with provided miners.",
	Flags: append(SingleTaskFlags, []cli.Flag{
		&cli.StringFlag{
			Name:  "cid",
			Usage: "payload cid to fetch from miner",
			Value: "bafykbzacedikkmeotawrxqquthryw3cijaonobygdp7fb5bujhuos6wdkwomm",
		},
	}...),
	Action: makeRetrievalDeal,
}
View Source
var MakeStorageDealCmd = &cli.Command{
	Name:  "storage-deal",
	Usage: "Make storage deals with provided miners.",
	Flags: append(SingleTaskFlags, []cli.Flag{
		&cli.BoolFlag{
			Name:    "fast-retrieval",
			Usage:   "request fast retrieval [true]",
			Aliases: []string{"f"},
			EnvVars: []string{"DEALBOT_FAST_RETRIEVAL"},
			Value:   true,
		},
		&cli.BoolFlag{
			Name:    "verified-deal",
			Usage:   "true if deal is verified [false]",
			Aliases: []string{"v"},
			EnvVars: []string{"DEALBOT_VERIFIED_DEAL"},
			Value:   false,
		},
		&cli.StringFlag{
			Name:    "size",
			Usage:   "size of deal (1KB, 2MB, 12GB, etc.) [1MB]",
			Aliases: []string{"s"},
			EnvVars: []string{"DEALBOT_DEAL_SIZE"},
			Value:   "1KB",
		},
		&cli.Int64Flag{
			Name:    "max-price",
			Usage:   "maximum Attofil to pay per byte per epoch []",
			EnvVars: []string{"DEALBOT_MAX_PRICE"},
			Value:   5e16,
		},
		&cli.Int64Flag{
			Name:    "start-offset",
			Usage:   "epochs deal start will be offset from now [30760 (10 days)]",
			EnvVars: []string{"DEALBOT_START_OFFSET"},
			Value:   30760,
		},
	}...),
	Action: makeStorageDeal,
}
View Source
var SingleTaskFlags = append(DealFlags, []cli.Flag{
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:     "miner",
		Usage:    "address of miner to make deal with",
		Aliases:  []string{"m"},
		EnvVars:  []string{"DEALBOT_MINER_ADDRESS"},
		Required: true,
	}),
}...)

Functions

func ProcessContext added in v0.0.3

func ProcessContext() context.Context

Types

This section is empty.

Jump to

Keyboard shortcuts

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