Merge pull request #640 from meejah/ticket3236-helper-config

add a --helper command-line option to 'tahoe create-node'
This commit is contained in:
meejah 2019-08-13 16:23:32 +00:00 committed by GitHub
commit 453ea15639
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -207,6 +207,7 @@ def _create_node(reactor, request, temp_dir, introducer_furl, flog_gatherer, nam
'--shares-needed', unicode(needed),
'--shares-happy', unicode(happy),
'--shares-total', unicode(total),
'--helper',
]
if not storage:
args.append('--no-storage')

View File

@ -0,0 +1 @@
Enable the helper when creating a node with `tahoe create-node --helper`

View File

@ -180,6 +180,7 @@ class CreateNodeOptions(CreateClientOptions):
optFlags = [
("no-storage", None, "Do not offer storage service to other nodes."),
("storage-dir", None, "Path where the storage will be placed."),
("helper", None, "Enable helper"),
] + TOR_FLAGS + I2P_FLAGS
synopsis = "[options] [NODEDIR]"
@ -334,7 +335,10 @@ def write_client_config(c, config):
c.write("[helper]\n")
c.write("# Shall this node run a helper service that clients can use?\n")
c.write("enabled = false\n")
if config.get("helper"):
c.write("enabled = true\n")
else:
c.write("enabled = false\n")
c.write("\n")