summaryrefslogtreecommitdiff
path: root/libeufin/bank-manual.rst
blob: 40e047db0c4bb05b178da684f8e97c45ae6543df (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
.. target audience: operator, developer

Bank Manual
###########

.. contents:: Table of Contents

LibEuFin Bank implements a simple core banking system with
account and REST APIs, including REST APIs for a Web interface
and REST APIs to interact with GNU Taler components.

In this manual, we explain how to setup a bank.

Installing Bank
===============

The following section was tested on an *OpenJDK 17* environment.

Building from source
--------------------

Bank belongs to the LibEuFin project, and can be downloaded via Git:

.. code-block:: console

  $ git clone git://git.taler.net/libeufin

Note that Kotlin and Gradle should already work on the host system.

Navigate into the *libeufin* local repository, and from top-level run:

.. code-block:: console

  $ ./bootstrap
  $ ./configure --prefix=$PREFIX
  $ make install-bank

If the previous steps succeeded, the ``libeufin-bank`` command should
be found in the $PATH.

Setting up the LibEuFin Bank
============================

The following snippet shows the mandatory configuration values.

.. code-block:: console

  [libeufin-bank]
  CURRENCY = KUDOS

  # Debt limit
  DEFAULT_CUSTOMER_DEBT_LIMIT = KUDOS:0
  DEFAULT_ADMIN_DEBT_LIMIT = KUDOS:200000000

  # Server
  SERVE = tcp
  PORT = 8080

  [libeufin-bankdb-postgres]
  CONFIG = postgresql:///libeufinbank

.. note::
  Refer to the manpage ``libeufin-man.conf(5)``
  for the full array of configuration values.

Assuming that the configuration file exists at ``$config_file``, the following
command would define the database schema and create an admin account.

.. code-block:: console

  libeufin-bank dbinit -c $config_file

If you wish to authenticate as admin, you must change the account password.

.. code-block:: console

  libeufin-bank passwd -c $config_file admin $PASSWORD

Then you can start the HTTP server.

.. code-block:: console

  libeufin-bank serve -c $config_file

Enable regional currency conversion
===================================

.. note::
  You need to have LibEuFin Nexus running to enable conversion.
  Refers to ``nexus-manual.conf`` for more details.

First you have to create an exchange account with username ``exchange``.

TODO

Then you have to enable conversion in configuration and enable at least one TAN channel for cashout.

.. code-block:: console

  [libeufin-bank]
  ALLOW_CONVERSION = yes

  TAN_SMS = libeufin-tan-sms.sh
  # And/Or
  TAN_EMAIL = libeufin-tan-email.sh

Assuming that the configuration file exists at ``$config_file``, the following
command would start the server with conversion API enabled.

.. code-block:: console

  libeufin-bank serve -c $config_file

Finally you have to setup conversion rates though the SPA.

TODO