Skip to content

Commit

Permalink
Merge pull request #8672 from filecoin-project/feat/worker-nodefault
Browse files Browse the repository at this point in the history
feat: worker: lotus-worker run --no-default
  • Loading branch information
magik6k authored May 23, 2022
2 parents 2cea84d + abf8316 commit dde3672
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmd/lotus-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,16 @@ var runCmd = &cli.Command{
Usage: "enable window post",
Value: false,
},

&cli.BoolFlag{
Name: "winningpost",
Usage: "enable winning post",
Value: false,
},
&cli.BoolFlag{
Name: "no-default",
Usage: "disable all default compute tasks, use the worker for storage/fetching only",
Value: false,
},
&cli.IntFlag{
Name: "parallel-fetch-limit",
Usage: "maximum fetch operations to run in parallel",
Expand Down Expand Up @@ -308,8 +312,11 @@ var runCmd = &cli.Command{
}

if workerType == "" {
workerType = sealtasks.WorkerSealing
taskTypes = append(taskTypes, sealtasks.TTFetch, sealtasks.TTCommit1, sealtasks.TTProveReplicaUpdate1, sealtasks.TTFinalize, sealtasks.TTFinalizeReplicaUpdate)

if !cctx.Bool("no-default") {
workerType = sealtasks.WorkerSealing
}
}

if (workerType == sealtasks.WorkerSealing || cctx.IsSet("addpiece")) && cctx.Bool("addpiece") {
Expand Down Expand Up @@ -337,6 +344,10 @@ var runCmd = &cli.Command{
taskTypes = append(taskTypes, sealtasks.TTRegenSectorKey)
}

if cctx.Bool("no-default") && workerType == "" {
workerType = sealtasks.WorkerSealing
}

if len(taskTypes) == 0 {
return xerrors.Errorf("no task types specified")
}
Expand Down
1 change: 1 addition & 0 deletions documentation/en/cli-lotus-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OPTIONS:
--regen-sector-key enable regen sector key (default: true)
--windowpost enable window post (default: false)
--winningpost enable winning post (default: false)
--no-default disable all default compute tasks, use the worker for storage/fetching only (default: false)
--parallel-fetch-limit value maximum fetch operations to run in parallel (default: 5)
--post-parallel-reads value maximum number of parallel challenge reads (0 = no limit) (default: 128)
--post-read-timeout value time limit for reading PoSt challenges (0 = no limit) (default: 0s)
Expand Down

0 comments on commit dde3672

Please sign in to comment.