Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ApiCmd = &cli.Command{ Name: "api", Usage: "Run the singularity API", Flags: []cli.Flag{ &cli.StringFlag{ Name: "bind", Usage: "Bind address for the API server", Value: "127.0.0.1:9090", }, }, Action: api.Run, } )
View Source
var ContentProviderCmd = &cli.Command{ Name: "content-provider", Usage: "Start a content provider that serves retrieval requests", Flags: []cli.Flag{ &cli.StringFlag{ Name: "http-bind", Usage: "Address to bind the HTTP server to", Value: "127.0.0.1:8088", }, &cli.StringFlag{ Name: "identity-key", Usage: "The base64 encoded private key for libp2p peer", Value: "", DefaultText: "AutoGenerated", }, &cli.StringSliceFlag{ Name: "libp2p-listen", Usage: "Addresses to listen on for libp2p connections", DefaultText: "AutoDetect", }, }, Action: func(c *cli.Context) error { db := database.MustOpenFromCLI(c) s, err := service.NewContentProviderService(db, c.String("http-bind"), c.String("identity-key"), c.StringSlice("libp2p-listen")) if err != nil { return cli.Exit(err.Error(), 1) } s.Start() return nil }, }
View Source
var DatasetWorkerCmd = &cli.Command{ Name: "dataset-worker", Usage: "Start a dataset preparation worker to process dataset scanning and preparation tasks", Flags: []cli.Flag{ &cli.IntFlag{ Name: "concurrency", Usage: "Number of concurrent workers to run", EnvVars: []string{"DATASET_WORKER_CONCURRENCY"}, Value: 1, }, &cli.BoolFlag{ Name: "enable-scan", Usage: "Enable scanning of datasets", EnvVars: []string{"DATASET_WORKER_ENABLE_SCAN"}, Value: true, }, &cli.BoolFlag{ Name: "enable-pack", Usage: "Enable packing of datasets that calculates CIDs and packs them into CAR files", EnvVars: []string{"DATASET_WORKER_ENABLE_PACK"}, Value: true, }, &cli.BoolFlag{ Name: "enable-dag", Usage: "Enable dag generation of datasets that maintains the directory structure of datasets", EnvVars: []string{"DATASET_WORKER_ENABLE_DAG"}, Value: true, }, &cli.BoolFlag{ Name: "exit-on-complete", Usage: "Exit the worker when there is no more work to do", EnvVars: []string{"DATASET_WORKER_EXIT_ON_COMPLETE"}, Value: false, }, }, Action: func(c *cli.Context) error { db := database.MustOpenFromCLI(c) worker := service.NewDatasetWorker( db, c.Int("concurrency"), c.Bool("exit-on-complete"), c.Bool("enable-scan"), c.Bool("enable-pack"), c.Bool("enable-dag")) err := worker.Run(c.Context) if err != nil { return err } return nil }, }
View Source
var DealMakerCmd = &cli.Command{ Name: "dealmaker", Usage: "Start a deal making/tracking worker to process deal making", Flags: []cli.Flag{ &cli.StringFlag{ Name: "lotus-api", Category: "Lotus", Usage: "Lotus RPC API endpoint, only used to get miner info", Value: "https://api.node.glif.io/rpc/v1", }, &cli.StringFlag{ Name: "lotus-token", Category: "Lotus", Usage: "Lotus RPC API token, only used to get miner info", Value: "", }, }, Action: func(c *cli.Context) error { db := database.MustOpenFromCLI(c) dealMaker, err := service.NewDealMakerService(db, c.String("lotus-api"), c.String("lotus-token")) if err != nil { return cli.Exit(err.Error(), 1) } return dealMaker.Run(c.Context) }, }
View Source
var SpadeAPICmd = &cli.Command{ Name: "spade-api", Usage: "Start a Spade compatible API for storage provider deal proposal self service", Flags: []cli.Flag{ &cli.StringFlag{ Name: "bind", Usage: "Bind address for the API server", Value: "127.0.0.1:9091", }, &cli.StringFlag{ Name: "lotus-api", Category: "Lotus", Usage: "Lotus RPC API endpoint, only used to get miner info", Value: "https://api.node.glif.io/rpc/v1", }, &cli.StringFlag{ Name: "lotus-token", Category: "Lotus", Usage: "Lotus RPC API token, only used to get miner info", Value: "", }, }, Action: func(c *cli.Context) error { db := database.MustOpenFromCLI(c) h, err := util.InitHost(context.Background(), nil) if err != nil { return err } dealMaker, err := replication.NewDealMaker(c.String("lotus-api"), c.String("lotus-token"), h) if err != nil { return err } return service.NewSpadeAPIService(db, dealMaker, &replication.WalletChooser{}, c.String("bind")).Start() }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.