summaryrefslogtreecommitdiff
path: root/README
blob: 803d5020d8c24b574c44c4e66f51af7555a60a2b (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

This code implements a bank Web portal that tightly integrates with
the GNU Taler payment system.  The bank it primarily meant be used as
part of a demonstrator for the Taler system.

================== HOW TO INSTALL THE BANK =================

From the repository's top directory, run

$ ./bootstrap

this operation will fetch additional libraries needed by the
bank (mostly JavaScript includes), and create the configure script.

The next step is to specify the install prefix, run

$ export PREFIX=$HOME/local # Adapt to your needs.
$ ./configure --prefix=$PREFIX

Then the usual GNU-compatible commands, that are

# this will download all dependencies
$ make install

and optionally

$ export PYTHONPATH=$PREFIX/lib/python3.5/site-packages/
$ make check # run the tests

================== HOW TO CONFIGURE THE BANK =================

The bank obeys to the INI syntax for configuration files. When launched, the bank
will by default look for a configuration file located at ~/.config/taler.conf.
To overide this behaviour, give the -c option when launching the bank.

In order to properly run, the bank needs the following parts to be configured

* Database name: connection string for the database to be used, currently Postgresql.
* Serving: whether we want the bank accessible via TCP or unix domain sockets.
* Fractional precision: precision of the fractional part of Taler objects.
* Fractional length: how many digits after the floating point we want to be shown
  in HTML pages.
* Debt thresholds
* Suggested exchange

# Mandatory section name
[bank]

# We accept requests via unix domain sockets
UWSGI_SERVE = unix

# If we want serve the bank via TCP, just replace the statement
# above with the following one:
# UWSGI_SERVE = tcp
# And also give the port to listen to
# UWSGI_PORT = 8585

# The path below indicates where to create the unix domain socket
UWSGI_UNIXPATH = /deployment/sockets/bank.uwsgi

# The mode to assign to the unix domain socket when
# creating it (automatically done by the bank)
UWSGI_UNIXPATH_MODE = 660

# We want at most two fractional digits shown for amounts
# throughout the page pages
NDIGITS = 2

# The fractional part of Taler amount objects is 100000000.
# This value needs to be changed ONLY IF there is a change
# protocol-wise.  In other words, its value it's not up to the
# bank
FRACTION = 100000000

# The bank will try to connect to a database called 'talerlocal'
# running under Postgresql.  The sysadmin will have to make sure
# that the bank has all the rights to work on that database.
# NOTE, this value is optional, and the bank will fallback to sqlite3
# if not given.
DATABASE = postgres:///talerlocal

# Maximum debt allowed for normal users.  The notation
# used for amounts is: CURRENCY:x.y.  Note, at least one
# digit in the fractional part is required.
MAX_DEBT = KUDOS:60.0

# Maximum debt allowed for the bank itself.
MAX_DEBT_BANK = KUDOS:0.0 # Infinite debt allowed.

# The following option lets the bank suggest a default exchange
# when the customer withdraws Taler coins.
SUGGESTED_EXCHANGE = http://exchange.example.com/

================== HOW TO LAUNCH THE BANK =================

The bank can accept connections via the UWSGI protocol and HTTP.

To launch it for the UWSGI protocol, issue

$ taler-bank-manage serve-uwsgi

To launch it for HTTP, issue

$ taler-bank-manage serve-http

the port the bank will listen to, can be either specified on the
command line (option -p), or in the configuration file with the
HTTP_PORT option. Note, launching the bank with 'serve-http',
will make the UWSGI_SERVE option to be ignored.


================== HOW TO RUN YOUR TESTS =================

From the repository's top directory, just issue

$ make check

in order to have test cases run.  A previous 'make install' is
NOT required.

NOTE: as tests do create a database (tipically named test_XYZ), the user
launching those must have some "write permissions" on the DMBS.

================= HOW TO FORCE MIGRATIONS =================

https://simpleisbetterthancomplex.com/tutorial/2016/07/26/how-to-reset-migrations.html