diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index 070fe601fd1..9447912759d 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -275,6 +275,12 @@ var runCmd = &cli.Command{ Name: "http-server-timeout", Value: "30s", }, + &cli.BoolFlag{ + Name: "data-cid", + Usage: "Run the data-cid task. true|false", + Value: true, + DefaultText: "inherits --addpiece", + }, }, Before: func(cctx *cli.Context) error { if cctx.IsSet("address") { @@ -386,8 +392,19 @@ var runCmd = &cli.Command{ } } + ttDataCidDefault := false if (workerType == sealtasks.WorkerSealing || cctx.IsSet("addpiece")) && cctx.Bool("addpiece") { - taskTypes = append(taskTypes, sealtasks.TTAddPiece, sealtasks.TTDataCid) + taskTypes = append(taskTypes, sealtasks.TTAddPiece) + ttDataCidDefault = true + } + if workerType == sealtasks.WorkerSealing { + if cctx.IsSet("data-cid") { + if cctx.Bool("data-cid") { + taskTypes = append(taskTypes, sealtasks.TTDataCid) + } + } else if ttDataCidDefault { + taskTypes = append(taskTypes, sealtasks.TTDataCid) + } } if (workerType == sealtasks.WorkerSealing || cctx.IsSet("sector-download")) && cctx.Bool("sector-download") { taskTypes = append(taskTypes, sealtasks.TTDownloadSector) diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md index 0017111b954..cb3d34729a8 100644 --- a/documentation/en/cli-lotus-worker.md +++ b/documentation/en/cli-lotus-worker.md @@ -38,6 +38,7 @@ USAGE: OPTIONS: --addpiece enable addpiece (default: true) [$LOTUS_WORKER_ADDPIECE] --commit enable commit (default: true) [$LOTUS_WORKER_COMMIT] + --data-cid Run the data-cid task. true|false (default: inherits --addpiece) --http-server-timeout value (default: "30s") --listen value host address and port the worker api will listen on (default: "0.0.0.0:3456") [$LOTUS_WORKER_LISTEN] --name value custom worker name (default: hostname) [$LOTUS_WORKER_NAME]