diff --git a/cmd/lotus-worker/main.go b/cmd/lotus-worker/main.go index 73771ff6b24..5af63f70c7e 100644 --- a/cmd/lotus-worker/main.go +++ b/cmd/lotus-worker/main.go @@ -91,15 +91,16 @@ func main() { Usage: fmt.Sprintf("Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON"), }, &cli.BoolFlag{ - Name: "enable-gpu-proving", - Usage: "enable use of GPU for mining operations", - Value: true, + Name: "enable-gpu-proving", + Usage: "enable use of GPU for mining operations", + Value: true, + EnvVars: []string{"LOTUS_WORKER_ENABLE_GPU_PROVING"}, }, }, After: func(c *cli.Context) error { if r := recover(); r != nil { - // Generate report in LOTUS_PATH and re-raise panic + // Generate report in LOTUS_PANIC_REPORT_PATH and re-raise panic build.GeneratePanicReport(c.String("panic-reports"), c.String(FlagWorkerRepo), c.App.Name) panic(r) } @@ -142,22 +143,25 @@ var runCmd = &cli.Command{ Usage: "Start lotus worker", Flags: []cli.Flag{ &cli.StringFlag{ - Name: "listen", - Usage: "host address and port the worker api will listen on", - Value: "0.0.0.0:3456", + Name: "listen", + Usage: "host address and port the worker api will listen on", + Value: "0.0.0.0:3456", + EnvVars: []string{"LOTUS_WORKER_LISTEN"}, }, &cli.StringFlag{ Name: "address", Hidden: true, }, &cli.BoolFlag{ - Name: "no-local-storage", - Usage: "don't use storageminer repo for sector storage", + Name: "no-local-storage", + Usage: "don't use storageminer repo for sector storage", + EnvVars: []string{"LOTUS_WORKER_NO_LOCAL_STORAGE"}, }, &cli.BoolFlag{ - Name: "no-swap", - Usage: "don't use swap", - Value: false, + Name: "no-swap", + Usage: "don't use swap", + Value: false, + EnvVars: []string{"LOTUS_WORKER_NO_SWAP"}, }, &cli.StringFlag{ Name: "name", @@ -166,79 +170,94 @@ var runCmd = &cli.Command{ DefaultText: "hostname", }, &cli.BoolFlag{ - Name: "addpiece", - Usage: "enable addpiece", - Value: true, + Name: "addpiece", + Usage: "enable addpiece", + Value: true, + EnvVars: []string{"LOTUS_WORKER_ADDPIECE"}, }, &cli.BoolFlag{ - Name: "precommit1", - Usage: "enable precommit1 (32G sectors: 1 core, 128GiB Memory)", - Value: true, + Name: "precommit1", + Usage: "enable precommit1 (32G sectors: 1 core, 128GiB Memory)", + Value: true, + EnvVars: []string{"LOTUS_WORKER_PRECOMMIT1"}, }, &cli.BoolFlag{ - Name: "unseal", - Usage: "enable unsealing (32G sectors: 1 core, 128GiB Memory)", - Value: true, + Name: "unseal", + Usage: "enable unsealing (32G sectors: 1 core, 128GiB Memory)", + Value: true, + EnvVars: []string{"LOTUS_WORKER_UNSEAL"}, }, &cli.BoolFlag{ - Name: "precommit2", - Usage: "enable precommit2 (32G sectors: all cores, 96GiB Memory)", - Value: true, + Name: "precommit2", + Usage: "enable precommit2 (32G sectors: all cores, 96GiB Memory)", + Value: true, + EnvVars: []string{"LOTUS_WORKER_PRECOMMIT2"}, }, &cli.BoolFlag{ - Name: "commit", - Usage: "enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap)", - Value: true, + Name: "commit", + Usage: "enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap)", + Value: true, + EnvVars: []string{"LOTUS_WORKER_COMMIT"}, }, &cli.BoolFlag{ - Name: "replica-update", - Usage: "enable replica update", - Value: true, + Name: "replica-update", + Usage: "enable replica update", + Value: true, + EnvVars: []string{"LOTUS_WORKER_REPLICA_UPDATE"}, }, &cli.BoolFlag{ - Name: "prove-replica-update2", - Usage: "enable prove replica update 2", - Value: true, + Name: "prove-replica-update2", + Usage: "enable prove replica update 2", + Value: true, + EnvVars: []string{"LOTUS_WORKER_PROVE_REPLICA_UPDATE2"}, }, &cli.BoolFlag{ - Name: "regen-sector-key", - Usage: "enable regen sector key", - Value: true, + Name: "regen-sector-key", + Usage: "enable regen sector key", + Value: true, + EnvVars: []string{"LOTUS_WORKER_REGEN_SECTOR_KEY"}, }, &cli.BoolFlag{ - Name: "windowpost", - Usage: "enable window post", - Value: false, + Name: "windowpost", + Usage: "enable window post", + Value: false, + EnvVars: []string{"LOTUS_WORKER_WINDOWPOST"}, }, &cli.BoolFlag{ - Name: "winningpost", - Usage: "enable winning post", - Value: false, + Name: "winningpost", + Usage: "enable winning post", + Value: false, + EnvVars: []string{"LOTUS_WORKER_WINNINGPOST"}, }, &cli.BoolFlag{ - Name: "no-default", - Usage: "disable all default compute tasks, use the worker for storage/fetching only", - Value: false, + Name: "no-default", + Usage: "disable all default compute tasks, use the worker for storage/fetching only", + Value: false, + EnvVars: []string{"LOTUS_WORKER_NO_DEFAULT"}, }, &cli.IntFlag{ - Name: "parallel-fetch-limit", - Usage: "maximum fetch operations to run in parallel", - Value: 5, + Name: "parallel-fetch-limit", + Usage: "maximum fetch operations to run in parallel", + Value: 5, + EnvVars: []string{"LOTUS_WORKER_PARALLEL_FETCH_LIMIT"}, }, &cli.IntFlag{ - Name: "post-parallel-reads", - Usage: "maximum number of parallel challenge reads (0 = no limit)", - Value: 128, + Name: "post-parallel-reads", + Usage: "maximum number of parallel challenge reads (0 = no limit)", + Value: 128, + EnvVars: []string{"LOTUS_WORKER_POST_PARALLEL_READS"}, }, &cli.DurationFlag{ - Name: "post-read-timeout", - Usage: "time limit for reading PoSt challenges (0 = no limit)", - Value: 0, + Name: "post-read-timeout", + Usage: "time limit for reading PoSt challenges (0 = no limit)", + Value: 0, + EnvVars: []string{"LOTUS_WORKER_POST_READ_TIMEOUT"}, }, &cli.StringFlag{ - Name: "timeout", - Usage: "used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function", - Value: "30m", + Name: "timeout", + Usage: "used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function", + Value: "30m", + EnvVars: []string{"LOTUS_WORKER_TIMEOUT"}, }, }, Before: func(cctx *cli.Context) error { diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md index 2ef2da22606..ee5c5c1ded1 100644 --- a/documentation/en/cli-lotus-worker.md +++ b/documentation/en/cli-lotus-worker.md @@ -21,7 +21,7 @@ COMMANDS: help, h Shows a list of commands or help for one command GLOBAL OPTIONS: - --enable-gpu-proving enable use of GPU for mining operations (default: true) + --enable-gpu-proving enable use of GPU for mining operations (default: true) [$LOTUS_WORKER_ENABLE_GPU_PROVING] --help, -h show help (default: false) --miner-repo value, --storagerepo value Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON (default: "~/.lotusminer") [$LOTUS_MINER_PATH, $LOTUS_STORAGE_PATH] --version, -v print the version (default: false) @@ -38,25 +38,25 @@ USAGE: lotus-worker run [command options] [arguments...] OPTIONS: - --addpiece enable addpiece (default: true) - --commit enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap) (default: true) - --listen value host address and port the worker api will listen on (default: "0.0.0.0:3456") + --addpiece enable addpiece (default: true) [$LOTUS_WORKER_ADDPIECE] + --commit enable commit (32G sectors: all cores or GPUs, 128GiB Memory + 64GiB swap) (default: true) [$LOTUS_WORKER_COMMIT] + --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] - --no-default disable all default compute tasks, use the worker for storage/fetching only (default: false) - --no-local-storage don't use storageminer repo for sector storage (default: false) - --no-swap don't use swap (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) - --precommit1 enable precommit1 (32G sectors: 1 core, 128GiB Memory) (default: true) - --precommit2 enable precommit2 (32G sectors: all cores, 96GiB Memory) (default: true) - --prove-replica-update2 enable prove replica update 2 (default: true) - --regen-sector-key enable regen sector key (default: true) - --replica-update enable replica update (default: true) - --timeout value used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function (default: "30m") - --unseal enable unsealing (32G sectors: 1 core, 128GiB Memory) (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) [$LOTUS_WORKER_NO_DEFAULT] + --no-local-storage don't use storageminer repo for sector storage (default: false) [$LOTUS_WORKER_NO_LOCAL_STORAGE] + --no-swap don't use swap (default: false) [$LOTUS_WORKER_NO_SWAP] + --parallel-fetch-limit value maximum fetch operations to run in parallel (default: 5) [$LOTUS_WORKER_PARALLEL_FETCH_LIMIT] + --post-parallel-reads value maximum number of parallel challenge reads (0 = no limit) (default: 128) [$LOTUS_WORKER_POST_PARALLEL_READS] + --post-read-timeout value time limit for reading PoSt challenges (0 = no limit) (default: 0s) [$LOTUS_WORKER_POST_READ_TIMEOUT] + --precommit1 enable precommit1 (32G sectors: 1 core, 128GiB Memory) (default: true) [$LOTUS_WORKER_PRECOMMIT1] + --precommit2 enable precommit2 (32G sectors: all cores, 96GiB Memory) (default: true) [$LOTUS_WORKER_PRECOMMIT2] + --prove-replica-update2 enable prove replica update 2 (default: true) [$LOTUS_WORKER_PROVE_REPLICA_UPDATE2] + --regen-sector-key enable regen sector key (default: true) [$LOTUS_WORKER_REGEN_SECTOR_KEY] + --replica-update enable replica update (default: true) [$LOTUS_WORKER_REPLICA_UPDATE] + --timeout value used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function (default: "30m") [$LOTUS_WORKER_TIMEOUT] + --unseal enable unsealing (32G sectors: 1 core, 128GiB Memory) (default: true) [$LOTUS_WORKER_UNSEAL] + --windowpost enable window post (default: false) [$LOTUS_WORKER_WINDOWPOST] + --winningpost enable winning post (default: false) [$LOTUS_WORKER_WINNINGPOST] ```