taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit 9fa05d70f144fd6c9d84ab269c651090bf1dd65c
parent 8e19477ed8fc6b7fffff40f8283657367aa26179
Author: MS <ms@taler.net>
Date:   Thu,  2 Mar 2023 20:06:45 +0100

circuit tutorial: add Docker section

Diffstat:
Mlibeufin/local-currencies-tutorial.rst | 83++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 78 insertions(+), 5 deletions(-)

diff --git a/libeufin/local-currencies-tutorial.rst b/libeufin/local-currencies-tutorial.rst @@ -11,7 +11,16 @@ LibEuFin service called *Sandbox*. In particular, we'll rely on the :ref:`Circuit API <circuit-api>`. More information about libEufin can be found in the :doc:`How-To page </libeufin/nexus-tutorial>`. -The first step is :ref:`building LibEuFin <building-from-source>`. +The following sections show how to install and launch Sandbox +either `from sources <install-from-sources_>`_, or `with Docker <_docker-setup>`_. + + +.. _install-from-sources: + +Install and config from sources +=============================== + +First :ref:`build LibEuFin <building-from-source>`. If the installation succeeded, configure *Sandbox* with the following command. @@ -27,9 +36,6 @@ following command. to add new accounts. Without this option, other APIs may offer unrestricted registrations. -All the commands mentioned in the following steps support a ``--help`` -option that lists all the available options under the related command. - If the configuration step succeeded, Sandbox should be ready to serve the bank for a currency named *NB*. @@ -46,7 +52,68 @@ password as ``secret``. $ export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=secret $ libeufin-sandbox serve -Sandbox should now be listening on the port 5000. Check it with: +If Sandbox is running, jump to `this part <after-installation_>`_. + +.. _docker-setup: + + +Install and config with Docker +============================== + +First, pull the deployment repository: + +.. code-block:: console + + $ git clone git://git.taler.net/deployment + +Then navigate to the Docker image location: + +.. code-block:: console + + $ cd deployment/nlnet/task1 + +Now build the image with the following command. + +.. code-block:: console + + $ docker build -t nlnet . + +If the build step went well, the following command +should suffice to start Sandbox and bind it to the +host's port 5000. + +.. code-block:: console + + $ docker run -p 5000:5000 -v /libeufin-data:libeufin_data -it nlnet + +The previous command uses a default admin password of +'admin' and the NB currency. Do **CHANGE** the admin +password in a production scenario. The following command +shows how to start the Sandbox with a custom administrator +password. + + +.. code-block:: console + + $ export MY_PASSWORD=secret + # Add '-e CURRENCY=$MY_CURRENCY' to also set the currency. + $ docker run -p 5000:5000 -e LIBEUFIN_SANDBOX_ADMIN_PASSWORD=$MY_PASSWORD + + +This setup stores the database in a Docker *volume*. The +following command therefore shows how to delete the database +volume, in order to reset all the data. + +.. code-block:: console + + $ docker volume rm libeufin_data + +.. _after-installation: + +If Sandbox is running +===================== + +Sandbox should now be reachable on the port 5000. Check it with: .. code-block:: console @@ -56,6 +123,12 @@ If Sandbox is correctly running, it should respond with a greeting message. At this point, the administrator can add a new merchant to the bank with the following command. +.. note:: + + Consult :doc:`this document </libeufin/circuit-cli-commands>`, + to learn all the CLI commands that address the (Circuit) API + used in this tutorial. + .. code-block:: console export LIBEUFIN_SANDBOX_USERNAME=admin