mirror of https://github.com/nucypher/nucypher.git
Merge pull request #2945 from derekpierre/auto-restart
Add recommendations/information about auto restart capabilities when running a PRE nodepull/2955/head
commit
acf604d2af
|
@ -11,7 +11,16 @@ PRE Node Deployment Automation
|
|||
via `nucypher-ops <https://github.com/nucypher/nucypher-ops>`_.
|
||||
|
||||
|
||||
In this tutorial we're going to setup a Threshold PRE Node using a remote cloud provider (Digital Ocean, AWS, and more in the future).
|
||||
In this tutorial we're going to setup a Threshold PRE node using a remote cloud provider (Digital Ocean, AWS, and more in the future).
|
||||
The PRE node will run via a Docker container.
|
||||
|
||||
.. note::
|
||||
|
||||
By default, ``nucypher-ops`` uses a Docker container restart policy of ``unless-stopped``.
|
||||
This ensures that the Docker container will be automatically restarted if it exited,
|
||||
except if the container was stopped via an appropriate command. See `Docker Restart Policies <https://docs.docker.com/engine/reference/run/#restart-policies---restart>`_
|
||||
for more information.
|
||||
|
||||
This example will demonstrate how to deploy to Digital Ocean. There are a few pre-requisites before we can get started.
|
||||
First, we need to create accounts on `Digital Ocean <https://cloud.digitalocean.com/>`_ and `Infura <https://infura.io>`_.
|
||||
Also ensure that your local environment has python 3.8 or later installed.
|
||||
|
@ -20,7 +29,7 @@ Also ensure that your local environment has python 3.8 or later installed.
|
|||
Launch Remote Node
|
||||
-------------------
|
||||
|
||||
.. note::
|
||||
.. important::
|
||||
|
||||
nucypher-ops requires python 3.8 or later.
|
||||
|
||||
|
|
|
@ -222,6 +222,7 @@ This step starts the PRE node.
|
|||
|
||||
$ docker run -d --rm \
|
||||
--name ursula \
|
||||
--restart on-failure \
|
||||
-v ~/.local/share/nucypher:/root/.local/share/nucypher \
|
||||
-v ~/.ethereum/:/root/.ethereum \
|
||||
-p 9151:9151 \
|
||||
|
@ -230,6 +231,14 @@ This step starts the PRE node.
|
|||
nucypher/nucypher:latest \
|
||||
nucypher ursula run
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
Setting the ``--restart`` parameter to ``on-failure`` ensures that the Docker
|
||||
container will be automatically restarted if the application exited unexpectedly (e.g. an application crash).
|
||||
See `Docker Restart Policies <https://docs.docker.com/engine/reference/run/#restart-policies---restart>`_
|
||||
for more information.
|
||||
|
||||
View Node Logs
|
||||
++++++++++++++
|
||||
|
||||
|
@ -307,6 +316,7 @@ Create a file named ``ursula.service`` in ``/etc/systemd/system``, and add this
|
|||
[Service]
|
||||
User=<YOUR USERNAME>
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
Environment="NUCYPHER_OPERATOR_ETH_PASSWORD=<YOUR OPERATOR ADDRESS PASSWORD>"
|
||||
Environment="NUCYPHER_KEYSTORE_PASSWORD=<YOUR PASSWORD>"
|
||||
ExecStart=<VIRTUALENV PATH>/bin/nucypher ursula run
|
||||
|
@ -324,6 +334,15 @@ Replace the following values with your own:
|
|||
Run ``pipenv –venv`` within the virtual environment to get the virtual environment path.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
Setting the ``Restart`` option to ``on-failure``, ensures that the systemd service
|
||||
will be automatically restarted if it exited with a non-zero exit code, except if
|
||||
the container was stopped using the ``systemctl stop`` command. See
|
||||
`Systemd Restart <https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=>`_
|
||||
for more information.
|
||||
|
||||
|
||||
Enable Node Service
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Add recommendation/information about restart functionality when running a PRE node.
|
Loading…
Reference in New Issue