1- Configuring the simulated network
2- =================================
1+ SimulaQron Configuration
2+ ========================
33
44SimulaQron uses two configuration files:
55
66* ``simulaqron_network.json `` — defines nodes, their socket ports, and network topology (described on this page)
77* ``simulaqron_settings.json `` — configures the simulation backend, timeouts, and other settings
88 (see the Settings section in `Getting Started <GettingStarted.rst >`_)
99
10- -------------------------------------------
10+ -------------------------------------
1111Running all nodes on a single machine
12- -------------------------------------------
12+ -------------------------------------
1313
1414When developing and testing, you typically run all simulated nodes on one computer.
1515In this case, all sockets use ``localhost `` and you just need distinct port numbers for each node.
1616
17- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17+ ^^^^^^^^^^^^^^^^^^^^^^^^
1818Using the SimulaQron CLI
19- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+ ^^^^^^^^^^^^^^^^^^^^^^^^
2020
2121The ``simulaqron `` command manages the backend for you. To start a network with nodes Alice and Bob::
2222
@@ -36,8 +36,9 @@ If something went wrong (e.g. the process was killed) and SimulaQron thinks the
3636
3737The ``simulaqron start `` command accepts these arguments:
3838
39- * ``--nodes <nodes_list> `` (**required **): Comma-separated list of node names to start. These must exist in
40- the network configuration file.
39+ * ``--nodes <nodes_list> `` (optional): Comma-separated list of node names to start. These must exist in
40+ the network configuration file. If not given, SimulaQron will start all the defined nodes in
41+ ``simulaqron_network.json ``.
4142* ``--simulaqron-config-file=PATH `` (optional): Path to a SimulaQron settings file. Defaults to
4243 ``simulaqron_settings.json `` in the current folder.
4344* ``--network-config-file=PATH `` (optional): Path to a network configuration file. Defaults to
@@ -48,9 +49,9 @@ The ``simulaqron start`` command accepts these arguments:
4849.. warning :: ``simulaqron start`` will fail if any of the ports specified in the config files are already in
4950 use by a running SimulaQron network or another program.
5051
51- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5253Using per-example run scripts
53- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5455
5556Each example in ``examples/new-sdk/ `` and ``examples/nativeMode/ `` includes a ``run.sh `` script that starts
5657the SimulaQron backend and launches the node programs. This is the easiest way to try an example::
@@ -61,9 +62,9 @@ the SimulaQron backend and launches the node programs. This is the easiest way t
6162The ``run.sh `` script reads the ``simulaqron_network.json `` and ``simulaqron_settings.json `` in the example
6263directory, so each example is self-contained.
6364
64- -------------------------------------------
65+ ----------------------------------
6566Running nodes on separate machines
66- -------------------------------------------
67+ ----------------------------------
6768
6869To simulate a real distributed quantum network, you can run each node on a different physical computer.
6970In this case, you need to:
@@ -120,9 +121,16 @@ For each node, you specify IP and port for three sockets:
120121* ``qnodeos_socket `` — connection to the QNodeOS server that interprets NetQASM subroutines
121122* ``vnode_socket `` — connection to the SimulaQron VirtualNode that runs the quantum simulation
122123
123- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124+ You can easily copy the default network configuration by using the simulaqron CLI command::
125+
126+ simulaqron nodes default
127+
128+ This will create a ``simulaqron_network.json `` file in the current folder with 5 nodes: `Alice `,
129+ `Bob `, `Charlie `, `David ` and `Eve `.
130+
131+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
124132Using the CLI to add nodes
125- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
126134
127135You can build up a network incrementally using the CLI::
128136
@@ -140,9 +148,9 @@ You can also specify explicit hostnames and ports:
140148* ``--vnode-port ``
141149* ``--neighbors ``
142150
143- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144152Writing the JSON config manually
145- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
153+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146154
147155For more complex setups, write the ``simulaqron_network.json `` file directly.
148156Here is an example with two networks ("default" and "small_network")::
0 commit comments