2019-01-29 02:11:52 +00:00
=============================================
NuCypher Federated Testnet (NuFT) Setup Guide
=============================================
2019-01-22 02:42:55 +00:00
2019-01-24 00:46:48 +00:00
This guide is for individuals who intend to spin-up and maintain an Ursula node in the early stages of the NuFT
while working with the NuCypher team to improve user experience, comfort, and code-quality of the NuCypher network.
Following the steps will launch a functioning federated-only Ursula node operating from a machine you control.
Before getting started, please note:
2019-01-22 02:42:55 +00:00
2019-01-26 01:56:14 +00:00
* We encourage you to launch your node on a machine that is able to remain online with as few interruptions as possible, for as long as possible. Although it is possible to restart a node, excessive deactivation/reactivation can contribute to a lack of usable feedback from the test network. Additionally, node uptime will be important for proper functioning of Mainnet. Thus, it’ s worthwhile to start working with a reliable machine now so that your nodes are compliant with the network's uptime requirements when the time comes.
2019-01-22 02:42:55 +00:00
2019-01-26 01:56:14 +00:00
* Setup requires knowledge of your machine’ s public-facing IPv4 address and local network configuration. It is advised to use a static IP address since changing IP addresses will require node reconfiguration. Configure port-forwarding rules on port 9151 if you are operating a node behind a firewall. Once successfully up and running, your node will be discoverable by all other nodes in the test network.
2019-01-22 02:42:55 +00:00
2019-01-24 00:46:48 +00:00
* NuFT transmits application errors and crash reports to NuCypher’ s sentry server. This functionality is enabled by default for NuFT only and will be deactivated by default for mainnet.
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
.. warning ::
2019-01-29 01:31:13 +00:00
The “NuCypher Federated Testnet” (NuFT) is an experimental pre-release of nucypher. Expect bugs, downtime, and unannounced domain-wide restarts. NuFT nodes do not connect to any blockchain. **DO NOT** perform transactions using NuFT node addresses.
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. important ::
2019-01-29 01:31:13 +00:00
Exiting the setup process prior to completion may lead to issues/bugs. If you encounter issues, report feedback by opening an Issue on our GitHub (https://github.com/nucypher/nucypher/issues)
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
Contents
--------
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
* `Stage A | Install The Nucypher Environment`_
* `Stage B | Configure Ursula`_
* `Stage C | Run the Node (Interactive Method)`_
* `Stage C | Run the Node (System Service Method)`_
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
Configure a NuFT Node
---------------------
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
Stage A | Install The Nucypher Environment
------------------------------------------
2019-01-22 02:42:55 +00:00
2019-01-24 00:46:48 +00:00
1. Install Python and Git
2019-01-29 02:11:52 +00:00
If you don’ t already have them, install Python and git.
As of January 2019, we are working with Python 3.6, 3.7, and 3.8.
2019-01-24 02:30:28 +00:00
2019-01-29 02:11:52 +00:00
* Official Python Website: https://www.python.org/downloads/
* Git Install Guide: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
2019-01-22 02:42:55 +00:00
2019-01-23 05:58:41 +00:00
2. Create Virtual Environment
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
Create a system directory for the nucypher application code
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ mkdir nucypher
2019-01-29 02:11:52 +00:00
Create a virtual environment for your node to run in using virtualenv
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ virtualenv nucypher -p python3
...
2019-01-29 02:11:52 +00:00
Activate your virtual environment
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ source nucypher/bin/activate
...
(nucypher)$
2019-01-22 02:42:55 +00:00
3. Install Nucypher
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
Install nucypher with git and pip3 into your virtual environment
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
(nucypher)$ pip3 install git+https://github.com/nucypher/nucypher.git@master
2019-01-29 02:11:52 +00:00
Re-activate your environment after installing
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ source nucypher/bin/activate
...
(nucypher)$
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
Stage B | Configure Ursula
--------------------------
2019-01-22 02:42:55 +00:00
2019-01-24 00:46:48 +00:00
1. Verify that the installation was successful
2019-01-29 02:11:52 +00:00
Activate your virtual environment and run the `nucypher --help` command
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ source nucypher/bin/activate
...
(nucypher)$ nucypher --help
2019-01-29 02:11:52 +00:00
You will see a list of possible usage options (`--version` , `-v` , `--dev` , etc.) and commands (`accounts` , `configure` , `deploy` , etc.). For example, you can use `nucypher configure destroy` to delete all files associated with the node.
2019-01-22 02:42:55 +00:00
2. Configure a new Ursula node
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
(nucypher)$ nucypher ursula init --federated-only
...
2019-01-22 02:42:55 +00:00
3. Enter your public-facing IPv4 address when prompted
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
`Enter Node's Public IPv4 Address: <YOUR NODE IP HERE>`
2019-01-22 02:42:55 +00:00
2019-01-24 00:46:48 +00:00
4. Enter a password when prompted
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
Enter a passphrase to encrypt your keyring: <YOUR PASSWORD HERE>
.. important ::
2019-01-24 00:46:48 +00:00
Save your password as you will need it to relaunch the node, and please note:
2019-01-29 02:11:52 +00:00
2019-01-24 00:46:48 +00:00
- Minimum password length is 16 characters
- There is no password recovery process for NuFT nodes
- Do not use a password that you use anywhere else
2019-01-26 01:56:14 +00:00
- Security audits are ongoing on this codebase. For now, treat it as un-audited.
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
Running a NuFT Node
-------------------
2019-01-22 02:42:55 +00:00
2019-01-29 02:11:52 +00:00
Stage C | Run the Node (Interactive Method)
-------------------------------------------
2019-01-24 00:46:48 +00:00
2019-01-22 02:42:55 +00:00
1. Connect to Testnet
2019-01-29 02:11:52 +00:00
NuCypher is maintaining a purpose-built endpoint to initially connect to the test network. To connect to the swarm run:
.. code :: bash
2019-01-24 00:46:48 +00:00
$(nucypher) nucypher ursula run --teacher-uri <SEEDNODE_URI>
...
2019-01-22 02:42:55 +00:00
2. Verify Connection
2019-01-29 02:11:52 +00:00
This will drop your terminal session into the “Ursula Interactive Console” indicated by the `>>>` . Verify that the node setup was successful by running the `status` command.
.. code ::
2019-01-24 00:46:48 +00:00
Ursula >>> status
...
2019-01-29 02:11:52 +00:00
To view a list of known nodes, execute the known_nodes command
.. code ::
Ursula >>> known_nodes
2019-01-24 00:46:48 +00:00
...
2019-01-26 01:56:14 +00:00
2019-01-29 02:11:52 +00:00
You can also view your node’ s network status webpage by navigating your web browser to `https://<your-node-ip-address>:9151/status` .
.. note ::
Since nodes self-sign TLS certificates, you may receive a warning from your web browser.
To stop your node from the interactive console and return to the terminal session
.. code ::
Ursula >>> stop
2019-01-24 00:46:48 +00:00
...
2019-01-29 02:11:52 +00:00
Subsequent node restarts do not need the teacher endpoint specified.
.. code :: bash
(nucypher)$ nucypher ursula run
2019-01-24 00:46:48 +00:00
...
2019-01-22 02:42:55 +00:00
Alternately you can run your node as a system service.
See the *“System Service Method”* section below.
2019-01-29 02:11:52 +00:00
Stage C | Run the Node (System Service Method)
----------------------------------------------
2019-01-29 04:52:59 +00:00
*NOTE - This is an alternative to the “Interactive Method” and assumes you're using systemd.*
2019-01-22 02:42:55 +00:00
2019-01-24 00:46:48 +00:00
1. Create Ursula System Service
2019-01-29 04:52:59 +00:00
Use this template to create a file named *ursula.service* and place it in */etc/systemd/system/* .
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
[Unit]
Description="Run 'Ursula', a NuCypher Staking Node."
[Service]
User=<YOUR USER>
Type=simple
Environment="NUCYPHER_KEYRING_PASSWORD=<YOUR PASSWORD>"
ExecStart=<VIRTUALENV PATH>/bin/nucypher ursula run <SEEDNODE_URI>
[Install]
WantedBy=multi-user.target
2019-01-22 02:42:55 +00:00
2. Enable Ursula System Service
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ sudo systemctl enable ursula
...
2019-01-22 02:42:55 +00:00
3. Run Ursula System Service
2019-01-24 00:46:48 +00:00
To start Ursula services using systemd
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ sudo systemctl start ursula
...
2019-01-29 02:11:52 +00:00
2019-01-24 00:46:48 +00:00
Check Ursula service status
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ sudo systemctl status ursula
...
2019-01-29 02:11:52 +00:00
2019-01-24 00:46:48 +00:00
To restart your node service
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ sudo systemctl restart ursula
`` `
2019-01-29 02:11:52 +00:00
Updating a NuFT Node
---------------------
2019-01-22 02:42:55 +00:00
2019-01-25 00:48:24 +00:00
Nucypher is under active development, you can expect frequent code changes to occur as bugs are
discovered and code fixes are submitted. As a result, Ursula nodes will need to be frequently updated
to use the most up-to-date version of the application code.
2019-01-29 02:11:52 +00:00
.. important ::
The steps to update an Ursula running on NuFT are as follows and depends on the type of installation that was employed.
2019-01-25 00:48:24 +00:00
2019-01-22 02:42:55 +00:00
2019-01-24 00:46:48 +00:00
1. Stop the node
2019-01-29 02:11:52 +00:00
Interactive method
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
Ursula >>> stop
2019-01-29 02:11:52 +00:00
OR
Systemd method
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
.. code ::
2019-01-24 00:46:48 +00:00
$ sudo systemctl stop ursula
2019-01-29 02:11:52 +00:00
2019-01-22 02:42:55 +00:00
2. Update to the latest code version
2019-01-29 02:11:52 +00:00
Update your virtual environment
.. code ::
(nucypher)$ pip3 install git+https://github.com/nucypher/nucypher.git@federated`
2019-01-22 02:42:55 +00:00
3. Restart Ursula Node
2019-01-24 00:46:48 +00:00
2019-01-29 02:11:52 +00:00
Re-activate your environment after updating
Interactive method:
.. code ::
2019-01-24 00:46:48 +00:00
$ source nucypher/bin/activate
...
(nucypher)$ nucypher ursula run
2019-01-29 02:11:52 +00:00
OR
Systemd Method:
.. code ::
2019-01-24 00:46:48 +00:00
$ sudo systemctl start ursula
2019-01-29 02:11:52 +00:00