diff --git a/README.md b/README.md index f0dc759a8857cd812d98a7d2f91ccf43a4f9ee23..28a91641fc892b646200d80a60a9c46571d6e5bd 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,8 @@ is added to this testing suite via the run script (`run.sh`) The [localNetwork package](./localNetwork) is a more general-use network tool. This package will run a local version of the xx network on a single machine until a -manually killed by the user. This can be done either via the `run.sh` script, -which will run the network with internal IP addresses, or the `runpublish.sh`, which runs the network -with remotely accessible IP addresses. With this network established, a developer may, +manually killed by the user. This can be done using either the `run.sh` or the `runpublish.sh` scripts. +With this network established, a developer may, for example, test the xxDK. ## How to manually run locally diff --git a/localNetwork/README.md b/localNetwork/README.md index 402606c305e67b8201ae26a974d17a8800a06dec..875936bc703e1682fb2ce7942786e5d8331060cb 100644 --- a/localNetwork/README.md +++ b/localNetwork/README.md @@ -1,9 +1,9 @@ -= Local Continuously Running Network (localNetwork) +# Local Continuously Running Network (localNetwork) This tool runs several servers as a local simulation of the xx network. The basic structure is as follows: -* 3 Nodes, BatchSize of 32 +* 3 cMix Nodes, BatchSize of 32 * 3 Gateways, each connected to its own node * User Discovery Bot * Scheduling Server @@ -12,7 +12,72 @@ The basic structure is as follows: With these tools you may run the xxDK off of the produced [ndf](./ndf.json), testing locally without having to operate on MainNet or any other live network. -## Configurability +## Operating the Network -If you wish to operate with a larger local network, you may generate a programmable number of gateways/servers -using the (generate) +To run the local network, you only need to run either `run.sh` or `runpublic.sh`. The difference +between these two scripts is described below, in the [scripts section](#scripts). Below is an example of running +`run.sh`: + +```commandline +./run.sh +rm: cannot remove 'gateway*-knownRound': No such file or directory +rm: cannot remove 'errServer-*': No such file or directory +rm: cannot remove '*.log': No such file or directory +rm: cannot remove 'roundId.txt': No such file or directory +rm: cannot remove '*-knownRound': No such file or directory +rm: cannot remove 'updateId*': No such file or directory +rm: cannot remove 'lastupdateid*': No such file or directory +rm: cannot remove 'udbsession': No such file or directory +STARTING SERVERS... +Permissioning: 112749 +Client Registrar: 112750 +Server 0: 112757 +Server 1: 112762 +Server 2: 112763 +Gateway 0 -- 112774 +Gateway 1 -- 112775 +Gateway 2 -- 112776 +You can't use the network until rounds run. +If it doesn't happen after 1 minute, please Ctrl+C +and review logs for what went wrong. +Waiting for rounds to run..............STARTING UDB... +UDB: 112937 +\nNetwork rounds have run. You may now attempt to connect. +Press enter to exit... +``` + +This script will run continuously until the user has sent a kill signal. The run script expects +`Enter/Return` once the network is set up. However, at any point prior of after the network is set +up, the user may kill the script using standard kill signals (`CTR+C`, `CTR+D`, etc.). + +## Scripts + +### `run.sh` +The `run.sh` script will run the network with internal IP addresses. This will allow the user +to test the xxDK from the machine running the local network. + +### runpublish.sh` +The `runpublish.sh` runs the network with remotely accessible IP addresses. This +will allow the user to test the xxDK from another machine, provided they have passed the ndf +along. + +## Configurability of Local Network + +If you wish to test with a larger local network, you may use the [config file generation script](./configGen/gen.py). +This will generate a programmable number of gateways/servers config files. + The snippet below gives an example on how to run this script: + +```commandline +$ cd configGen/ +$ python3 gen.py +Total number of nodes: 9 +Minimum number of nodes online to start network: 3 +Size of each team: 3 +``` + +This example generates 9 cMix nodes with 9 associated gateways. The rounds will have 3 nodes in a team, +and the network only needs 3 nodes running to start running rounds. + +Once config files have been generated, you need only execute the run script to run a network of the desired size +and specifications. Please note that this network does run locally, and as such larger networks +may be resource intensive (depending on the user's machine).