System Requirements and Dependencies¶
At least 1 GB of RAM is required for secure password-based key derivation with scrypt.
We have tested
nucypherwith Windows, Mac OS, and GNU/Linux (GNU/Linux is recommended).
If you don’t already have it, install Python. As of October 2019, we are working with Python 3.6 and 3.7.
We also require the following system packages (Linux):
We recommend installing
nucypher with either
Standard Pip Installation¶
In order to isolate global system dependencies from nucypher-specific dependencies, we highly recommend
python-virtualenv to install
nucypher inside a dedicated virtual environment.
For full documentation on virtualenv see: https://virtualenv.pypa.io/en/latest/
Here is the recommended procedure for setting up
nucypher in this fashion:
Create a Virtual Environment
$ virtualenv /your/path/nucypher-venv ...
Activate the newly created virtual environment:
$ source /your/path/nucypher-venv/bin/activate ... $(nucypher-venv)
Successful virtualenv activation is indicated by ‘(nucypher-venv)$’ prepended to your console’s prompt
Install Application Code with Pip
$(nucypher-venv) pip3 install -U nucypher
In the console:
Standard Pipenv Installation¶
Install Application code with Pipenv
Ensure you have
pipenvinstalled (See full documentation for pipenv here: Pipenv Documentation). Then to install
$ pipenv install nucypher
In the console:
(Optional) Follow these post install instructions: https://docs.docker.com/install/linux/linux-postinstall/
Get the latest nucypher image:
docker pull nucypher/nucypher:latest
That’s it. Now you can run commands like
docker run -v /home/ubuntu:/root/.local/share/ nucypher/nucypher:latest nucypher alice init
Note the volume mounts.
-v <path to a directory on your computer>:/root/.local/share/
This is important because it allows your Nucypher node to store persistent data as well as commonly access ipc with a locally running geth node.
Additional dependencies and setup steps are required to perform a “developer installation”.
Ensure you have
git installed (Git Documentation).
Acquire NuCypher Codebase¶
Fork the nucypher repository on GitHub, as explained in the Contribution Guide, then clone your fork’s repository to your local machine:
$ git clone https://github.com/<YOUR_GITHUB_USERNAME>/nucypher.git
After acquiring a local copy of the application code, you will need to
install the project dependencies, we recommend using either
Pipenv Development Installation¶
The most common development installation method is using pipenv:
$ pipenv install --dev --three --skip-lock --pre
Activate the pipenv shell
$ pipenv shell
If this is successful, your terminal command prompt will be prepended with
Install the Solidity compiler (solc):
$(nucypher) pipenv run install-solc
Pip Development Installation¶
Alternately, you can install the development dependencies with pip:
$ pip3 install -e .[development] $ ./scripts/installation/install_solc.sh
Development Docker Installation¶
The intention of the Docker configurations in this directory is to enable anyone to develop and test NuCypher on all major operating systems with minimal prerequisites and installation hassle (tested on Ubuntu 16, MacOS 10.14, Windows 10).
Start with standard Docker Installation¶
Then you can do things like:
Run the tests:
docker-compose run nucypher-dev pytest
Start up an Ursula:
docker-compose run nucypher-dev nucypher ursula run --dev --federated-only
Open a shell:
docker-compose run nucypher-dev bash
Try some of the scripts in
From there you can develop, modify code, test as normal.
Run a network of 8 independent Ursulas
docker-compose -f 8-federated-ursulas.yml up
Get the local ports these ursulas will be exposed on
To stop them…
docker-compose -f 8-federated-ursulas.yml stop
Systemd Service Installation¶
Use this template to create a file named
ursula.serviceand place it in
[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 --teacher <SEEDNODE_URI> [Install] WantedBy=multi-user.target
Replace the following values with your own:
<YOUR_USER>- The host system’s username to run the process with
<YOUR_PASSWORD>- Ursula’s keyring password
<VIRTUALENV_PATH>- The absolute path to the python virtual environment containing the
<SEEDNODE_URI>- A seednode URI of a node on the network you are connecting to
Enable Ursula System Service
$ sudo systemctl enable ursula
Run Ursula System Service
To start Ursula services using systemd
$ sudo systemctl start ursula
Check Ursula service status
$ sudo systemctl status ursula
To restart your node service
$ sudo systemctl restart ursula