summaryrefslogtreecommitdiff
path: root/manpages/libeufin-sandbox.1.rst
blob: 239a56cf39c6b5ebd8a2258bbe434102fa0f990d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
libeufin-sandbox(1)
###################

.. only:: html

   Name
   ====

   **libeufin-sandbox** - Simulate a banking system core
   with EBICS access to bank accounts


Synopsis
========

**libeufin-sandbox**
[**-h** | **--help**]
[**--version**]
COMMAND [ARGS...]

Commands: serve, reset-tables, config, make-transaction, camt053tick
default-exchange


Description
===========

**libeufin-sandbox** is a program to simulate a banking system core
with EBICS access to bank accounts.
It maintains state in its own private database.
You interact with it through HTTP
requests either over the network or via a Unix domain socket.
Related program **libeufin-cli** is the preferred front end.

Its options are as follows:

**-h** \| **--help**
   Print short help on options.

**–version**
   Print version information.

The interaction model is as follows:

.. @MS Is the order of the first two steps correct?
   Or are some of the commands to be used AFTER ‘serve’ starts?
   Or is it a mix?  (I believe it is a mix, but am not sure.)

- Configure the sandbox with commands ``config``, ``default-exchange``,
  ``make-transaction``, and ``camt053tick``.

- Start the HTTP server with command ``serve``.
  Let this run in a shell, writing logs to stderr.

- Point program **libeufin-nexus** at the sandbox.

- Interact with **libeufin-nexus**.

- When finished, interrupt the ``serve`` process and clean up with command
  ``reset-tables``.

The following sections describe each command in detail.


Command ``config``
==================

This command takes argument ``NAME`` and creates a demobank with that name.

Option ``--currency CUR`` (default: ``EUR``) specifes another currency.
Option ``--bank-debt-limit N`` (default: 1000000) specifies that
the bank debt limit should be N (units of currency).
Similarly, option ``--users-debt-limit N`` (default: 1000) specifies
that the users debt limit should be N (units of currency).

For example:

.. code-block:: console

  $ libeufin-sandbox config default

This creates the demobank ``default`` with currency ``EUR``,
bank debt limit 1000000, users debt limit 1000,
and allows registrations.


Command ``default-exchange``
============================

.. WRITEME


Command ``make-transaction``
============================
.. WRITEME


Command ``camt053tick``
=======================
.. WRITEME


Command ``serve``
=================

This command starts the HTTP server, listening on port 5000.
To use a different port, use option ``--port INT``.
To listen, instead, on a Unix domain socket,
use option ``--with-unix-socket PATH``.
When both ``--port`` and ``--with-unix-socket`` are given,
``--with-unix-socket`` takes precedence.

The process runs in the foreground, writing its logs to standard error.
The normal log level is ``DEBUG``.
To change it, use ``--log-level LEVEL``, where ``LEVEL`` is one of:
``ERROR``, ``WARN``, ``INFO``, ``DEBUG``, ``TRACE``.

Before invoking ``serve``, the following environment variables need to be set:

``LIBEUFIN_SANDBOX_ADMIN_PASSWORD``
   The password required for later use by ???FIXME???.
   For testing purposes, you can use option ``--no-auth`` to disable
   this requirement.
   (In that case, this environment variable need not be set.)

``LIBEUFIN_SANDBOX_DB_CONNECTION``
   This specifies the database **libeufin-sandbox** uses to maintain state.
   Currently, both Sqlite and PostgreSQL are supported.
   (Only one needs to be specified.)
   Examples:

   - ``jdbc:sqlite:/tmp/libeufin-sandbox.db``
   - ``jdbc:postgresql://localhost:5432/libeufindb?user=Foo&password=secret``

.. @MS Is Control-C the best way to interrupt?
   Are there any other signals handled specially?


Command ``reset-tables``
========================

This command drops all the tables in the internal database.
(The next time the tables are needed, **libeufin-sandbox** creates them
again, automatically.)

It should only be used when the sandbox is quiescent.


See Also
========

.. TODO: libeufin-nexus(1), libeufin-cli(1).


Bugs
====

Report bugs by using https://bugs.taler.net or by sending electronic
mail to <taler@gnu.org>.