Local Development Fleet Testing¶
Overview¶
To aid in application development, a network of federated Ursulas can be run locally. These Ursulas do not utilize blockchain functionality, but afford the same cryptographic capabilities of the public PRE nodes on the Threshold Network.
Note
Currently only “Federated Only” mode is supported for local fleets
- All Demo Ursulas:
Run on
localhost
In
--federated-only
modeOn the
TEMPORARY_DOMAIN
(implied by--dev
)Using temporary resources (files, database, etc.)
Running a Local Fleet¶
Install NuCypher
Acquire the NuCypher application code and install the dependencies. For a full installation guide see the Installation Reference.
Run a Lonely Ursula
The first step is to launch the first Ursula on the network by running:
$ cd scripts/local_fleet
$ python run_lonely_ursula.py
- This will start an Ursula node:
With seednode discovery disabled
On port
11500
Run a Local Fleet of Ursulas
Next, launch subsequent Ursulas in another terminal, informing them of the first Ursula:
$ python run_local_ursula_fleet.py
- This will run 5 temporary Ursulas that:
All specify the lonely Ursula as a teacher
Run on ports
11501
through11506
Run an Entry-Point Ursula (Optional)
While the local fleet is running, you may want an entry-point to introspect the code in a debugger.
For this we provide the optional script run_single_ursula.py
for your convenience.
$ python run_single_ursula.py
This will run a single temporary Ursula:
That specifies a random fleet node as a teacher
On a random available port
Connecting to the Local Fleet¶
Alternately, you can connect any node run from the CLI by specifying one of the nodes
in the local fleet as a teacher, the same network domain, and the same operating mode.
By default, nodes started with the --dev
flag run on a dedicated domain (TEMPORARY_DOMAIN
) and
on a different port than the production default port (9151
).
Local fleet Ursulas range from ports 11500
to 11506
by default.
Here is an example of connecting to a node in the local development fleet:
nucypher ursula run --dev --teacher localhost:11501
Note
The local development fleet is an example meant to demonstrate how to design and use your own local fleet.