Add hint about `--config-file` to output of new configuration init for non-default configuration filepath.

Add docs note about non-default worker configuration files and the use of `--config-file <FILEPATH>`.
pull/2617/head
derekpierre 2021-03-29 10:58:21 -04:00
parent 7c80c3c31e
commit a89e1deb4b
2 changed files with 29 additions and 5 deletions

View File

@ -208,7 +208,7 @@ Instead of using docker, the nucypher worker can be run as a systemd service.
$(nucypher) pip install -U nucypher $(nucypher) pip install -U nucypher
2. Configure the worker using the nucypher CLI. 2. Configure the worker using the nucypher CLI, and store the configuration to disk:
.. code-block:: .. code-block::
@ -227,6 +227,14 @@ Replace the following values with your own:
* ``<GWEI>`` - The maximum price of gas to spend on commitment transactions * ``<GWEI>`` - The maximum price of gas to spend on commitment transactions
.. important::
The default configuration file is ``ursula.json``. If there is an existing default configuration file, a new
Worker configuration file with a unique suffix is created e.g. ``ursula-0216ad10.json``. Since this file would not
be the default, subsequent ``ursula`` CLI commands should use the ``--config-file <FILEPATH>`` option to specify
the non-default filepath of the Worker configuration file.
3. Use this template to create a file named ``ursula.service`` and place it in ``/etc/systemd/system/``. 3. Use this template to create a file named ``ursula.service`` and place it in ``/etc/systemd/system/``.
.. code-block:: .. code-block::
@ -298,6 +306,8 @@ Run Worker Manually
If you'd like to use another own method of running the worker process in the background, or are If you'd like to use another own method of running the worker process in the background, or are
using one of the testnets, here is how to run Ursula using the CLI directly. using one of the testnets, here is how to run Ursula using the CLI directly.
First initialize a Worker configuration and store it to disk:
.. code-block:: .. code-block::
$(nucypher) nucypher ursula init \ $(nucypher) nucypher ursula init \
@ -313,6 +323,15 @@ Replace the following values with your own:
* ``<SIGNER URI>`` - The URI to an ethereum keystore or signer: `keystore:///root/.ethereum/keystore` * ``<SIGNER URI>`` - The URI to an ethereum keystore or signer: `keystore:///root/.ethereum/keystore`
* ``<GWEI>`` - The maximum price of gas to spend on commitment transactions * ``<GWEI>`` - The maximum price of gas to spend on commitment transactions
.. important::
The default configuration file is ``ursula.json``. If there is an existing default configuration file, a new
Worker configuration file with a unique suffix is created e.g. ``ursula-0216ad10.json``. Since this file would not
be the default, subsequent ``ursula`` CLI commands should use the ``--config-file <FILEPATH>`` option to specify
the non-default filepath of the Worker configuration file.
.. note:: .. note::
All worker configuration values can be changed using the `config` command All worker configuration values can be changed using the `config` command

View File

@ -57,10 +57,16 @@ def paint_new_installation_help(emitter, new_configuration, filepath):
emitter.message(f"Generated keyring {new_configuration.keyring_root}", color='green') emitter.message(f"Generated keyring {new_configuration.keyring_root}", color='green')
config_filepath_type = "default" default_config_filepath = True
if new_configuration.default_filepath() != filepath: if new_configuration.default_filepath() != filepath:
config_filepath_type = "non-default" default_config_filepath = False
emitter.message(f"Generated configuration file at {config_filepath_type} filepath {filepath}", color='green') emitter.message(f'Generated configuration file at {"default" if default_config_filepath else "non-default"} '
f'filepath {filepath}', color='green')
# add hint about --config-file
if not default_config_filepath:
emitter.message(f'* NOTE: for a non-default configuration filepath use `--config-file "{filepath}"` '
f'with subsequent `{character_name}` CLI commands', color='yellow')
# Felix # Felix
if character_name == 'felix': if character_name == 'felix':
@ -84,7 +90,6 @@ To initialize a new faucet recipient database run: nucypher felix createdb
* Start HTTP server -> nucypher alice run * Start HTTP server -> nucypher alice run
''' '''
elif character_name == 'bob': elif character_name == 'bob':
hint = ''' hint = '''
* Review configuration -> nucypher bob config * Review configuration -> nucypher bob config