mirror of https://github.com/nucypher/nucypher.git
Merge pull request #1393 from mswilkison/docker-docs
Docker installation instructions in top-level docspull/1432/head
commit
0fa3c13c7b
|
@ -3,17 +3,17 @@
|
|||
|
||||
## Contents
|
||||
|
||||
* [System Requirements and Dependencies](#System-Requirements-and-Dependencies)
|
||||
* [Standard Installation](#Standard-Installation)
|
||||
* [Development Installation](#Development-Installation)
|
||||
* [Running Ursula with Systemd](#Systemd-Service-Installation)
|
||||
* [System Requirements and Dependencies](#system-requirements-and-dependencies)
|
||||
* [Standard Installation](#standard-installation)
|
||||
* [Docker Installation](#docker-installation)
|
||||
* [Development Installation](#development-installation)
|
||||
* [Running Ursula with Systemd](#systemd-service-installation)
|
||||
|
||||
## System Requirements and Dependencies
|
||||
|
||||
* At least 1 GB of RAM is required for secure password-based key derivation with [scrypt](http://www.tarsnap.com/scrypt.html).
|
||||
* We have tested `nucypher` with Windows, Mac OS, and GNU/Linux (GNU/Linux is recommended).
|
||||
* If you don’t already have it, install [Python](https://www.python.org/downloads/).
|
||||
As of August 2019, we are working with Python 3.6, 3.7, and 3.8.
|
||||
* If you don’t already have it, install [Python](https://www.python.org/downloads/). As of August 2019, we are working with Python 3.6, 3.7, and 3.8.
|
||||
* We also require the following system packages (Linux):
|
||||
|
||||
- `libffi-dev`
|
||||
|
@ -22,7 +22,7 @@ As of August 2019, we are working with Python 3.6, 3.7, and 3.8.
|
|||
|
||||
## Standard Installation
|
||||
|
||||
We recommend installing `nucypher` with either `pip` or `pipenv`
|
||||
We recommend installing `nucypher` with either `pip`, `pipenv`, or `docker`
|
||||
|
||||
* [Pip Documentation](https://pip.pypa.io/en/stable/installing/)
|
||||
* [Pipenv Documentation](https://pipenv.readthedocs.io/en/latest/)
|
||||
|
@ -42,9 +42,9 @@ Here is the recommended procedure for setting up `nucypher` in this fashion:
|
|||
$ virtualenv /your/path/nucypher-venv
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
Activate the newly created virtual environment:
|
||||
|
||||
|
||||
```bash
|
||||
$ source /your/path/nucypher-venv/bin/activate
|
||||
...
|
||||
|
@ -56,7 +56,7 @@ Here is the recommended procedure for setting up `nucypher` in this fashion:
|
|||
|
||||
|
||||
2. Install Application Code with Pip
|
||||
|
||||
|
||||
```bash
|
||||
$(nucypher-venv) pip3 install -U nucypher
|
||||
```
|
||||
|
@ -80,10 +80,10 @@ Here is the recommended procedure for setting up `nucypher` in this fashion:
|
|||
|
||||
|
||||
1. Install Application code with Pipenv
|
||||
|
||||
|
||||
Ensure you have `pipenv` installed (See full documentation for pipenv here: [Pipenv Documentation](https://pipenv.readthedocs.io/en/latest/)).
|
||||
Then to install `nucypher` with `pipenv`, run:
|
||||
|
||||
|
||||
```bash
|
||||
$ pipenv install nucypher
|
||||
```
|
||||
|
@ -103,6 +103,21 @@ Here is the recommended procedure for setting up `nucypher` in this fashion:
|
|||
import nucypher
|
||||
```
|
||||
|
||||
## Docker Installation
|
||||
1. Install [Docker](https://docs.docker.com/install/)
|
||||
|
||||
2. (Optional) Follow these post install instructions: [https://docs.docker.com/install/linux/linux-postinstall/](https://docs.docker.com/install/linux/linux-postinstall/)
|
||||
|
||||
3. Get the latest nucypher image:
|
||||
|
||||
`docker pull nucypher/nucypher:latest`
|
||||
|
||||
4. 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.*
|
||||
|
||||
|
||||
## Development Installation
|
||||
|
||||
Additional dependencies and setup steps are required to perform a "developer installation".
|
||||
|
@ -113,7 +128,7 @@ Ensure you have `git` installed ([Git Documentation](https://git-scm.com/doc)).
|
|||
|
||||
Fork the nucypher repository on GitHub, as explained in the [Contribution Guide](/guides/contribution_guide),
|
||||
then clone your fork's repository to your local machine:
|
||||
|
||||
|
||||
```
|
||||
$ git clone https://github.com/<YOUR_GITHUB_USERNAME>/nucypher.git
|
||||
```
|
||||
|
@ -142,9 +157,9 @@ Install the Solidity compiler (solc):
|
|||
```bash
|
||||
$(nucypher) pipenv run install-solc
|
||||
```
|
||||
|
||||
|
||||
### Pip Development Installation
|
||||
|
||||
|
||||
Alternately, you can install the development dependencies with pip:
|
||||
|
||||
```bash
|
||||
|
@ -152,26 +167,58 @@ $ 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
|
||||
1. Install [Docker](https://docs.docker.com/install/)
|
||||
2. Install [Docker Compose](https://docs.docker.com/compose/install/)
|
||||
3. `cd` to `dev/docker
|
||||
4. Run `docker-compose up --build` **this must be done once to complete install**
|
||||
|
||||
#### Running NuCypher
|
||||
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 `dev/docker/scripts/`
|
||||
|
||||
From there you can develop, modify code, test as normal.
|
||||
|
||||
#### Other cases
|
||||
|
||||
* 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
|
||||
`docker ps`
|
||||
* To stop them...
|
||||
`docker-compose -f 8-federated-ursulas.yml stop`
|
||||
|
||||
|
||||
## Systemd Service Installation
|
||||
|
||||
1. Use this template to create a file named `ursula.service` and place it in `/etc/systemd/system/`.
|
||||
|
||||
|
||||
```
|
||||
[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 `nucypher` executable
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Ursula Configuration Guide
|
||||
==========================
|
||||
|
||||
1. Install NuCypher and geth
|
||||
1. Install geth Ethereum node
|
||||
------------------------------
|
||||
|
||||
If you want to run a NuCypher node that participates in the decentralized network,
|
||||
|
@ -37,6 +37,14 @@ this case.
|
|||
Fund this account with Görli testnet ETH! To do it, go to
|
||||
https://goerli-faucet.slock.it/.
|
||||
|
||||
2. Install NuCypher
|
||||
--------------------------------
|
||||
|
||||
Install ``nucypher`` with ``docker`` (See :doc:`/guides/installation_guide`) or ``pip`` (below).
|
||||
|
||||
Standard Pip Install
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Before installing ``nucypher``, you may need to install necessary developer
|
||||
tools and headers, if you don't have them already. In Ubuntu, Debian, Linux Mint
|
||||
or similar distros, that is:
|
||||
|
@ -74,9 +82,34 @@ If your installation is non-functional, be sure you have the latest version inst
|
|||
|
||||
|
||||
|
||||
2. Configure a new Ursula node
|
||||
3. Configure a new Ursula node
|
||||
--------------------------------
|
||||
|
||||
With Docker
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Recall the volume mounts: `-v <path to a directory on your computer>:/root/.local/share/` which is where your Nucypher node stores persistent data as well as accesses ipc with your locally running geth node.
|
||||
|
||||
Execute the following commands (Ubuntu):
|
||||
|
||||
.. code:: bash
|
||||
|
||||
export NUCYPHER_KEYRING_PASSWORD=<your keyring password>
|
||||
export MY_IP=$(wget -q -O - ifconfig.me);
|
||||
export NUCYPHER_WORKER_ADDRESS=<eth account checksum of your worker>
|
||||
export NUCYPHER_STAKER_ADDRESS=<eth account checksum of your staker>
|
||||
export NUCYPHER_WORKER_ETH_PASSWORD=<your eth account password>
|
||||
|
||||
# init your worker
|
||||
docker run -v /home/ubuntu:/root/.local/share/ -e NUCYPHER_KEYRING_PASSWORD -it nucypher/nucypher:latest nucypher ursula init --provider /root/.local/share/geth/.ethereum/goerli/geth.ipc --poa --worker-address $NUCYPHER_WORKER_ADDRESS --staker-address $NUCYPHER_STAKER_ADDRESS --rest-host $MY_IP --sync
|
||||
|
||||
# and then run the worker in the background
|
||||
docker run -v /home/ubuntu:/root/.local/share/ -dit --restart unless-stopped -p 9151:9151 -e NUCYPHER_KEYRING_PASSWORD -e NUCYPHER_WORKER_ETH_PASSWORD nucypher/nucypher:latest nucypher ursula run --teacher discover.nucypher.network:9151 --sync --poa
|
||||
|
||||
|
||||
Without Docker
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code:: bash
|
||||
|
||||
(nucypher)$ nucypher ursula init --provider <YOUR PROVIDER URI> --poa --staker-address <YOUR STAKER ADDRESS>
|
||||
|
|
Loading…
Reference in New Issue