diff options
Diffstat (limited to 'libeufin/regional-custom-manual.rst')
-rw-r--r-- | libeufin/regional-custom-manual.rst | 109 |
1 files changed, 63 insertions, 46 deletions
diff --git a/libeufin/regional-custom-manual.rst b/libeufin/regional-custom-manual.rst index 8477c18d..580168f3 100644 --- a/libeufin/regional-custom-manual.rst +++ b/libeufin/regional-custom-manual.rst @@ -72,6 +72,11 @@ Now you have to set the conversion rates and the ``admin`` debt limit via the ba Configuring the Exchange for Conversion +++++++++++++++++++++++++++++++++++++++ +An exchange that supports currency conversion needs to advertise two bank +accounts, one in the regional currency and a second in the fiat currency. The +conversion logic ensures that wire transfers in either account are +immediately reflected in the other account. + This section explains how to enable currency conversion at the exchange, which is critical for wallets to know how to wire fiat currency to an exchange to obtain regional currency. @@ -90,75 +95,87 @@ the possibility of currency conversion (cash in): .. code-block:: console - # taler-exchange-offline \ + # source config/user.conf + # sudo -u taler-exchange-offline \ + taler-exchange-offline \ + wire-fee now iban "${CURRENCY}":0 "${CURRENCY}":0 \ enable-account \ - payto://iban/$IBAN?receiver-name=$NAME \ - conversion-url "$CONVERSION_URL" \ - debit-restriction \ - deny \ + "${CONVERSION_PAYTO}" \ + conversion-url "${PROTO}://bank.$DOMAIN_NAME/conversion-info/" \ + display-hint 10 "CHF" \ + debit-restriction deny \ credit-restriction \ regex \ 'payto://iban/.*/CH.*?receiver-name=.*' \ 'Swiss only' \ - '{ "de" : "nur Schweiz", \ - "fr" : "Suisse uniquement" }' + '{"de":"nur Schweiz","fr":"Suisse uniquement"}' \ upload Here, the ``$CONVERSION_URL`` must be set to the base URL of the conversion endpoint of the bank, which should be -``https://bank.$DOMAIN/conversion-info/`` in our setup. Note that you can -leave out the "credit-restriction" if you want to allow international inbound -wire transfers. The "debit-restriction" is largely mandatory as in this setup -the taler-exchange-transfer is only configured to deal with the regional +``https://bank.$DOMAIN/conversion-info/`` in our setup. + +The above commands set up the exchange to perform conversion with a +restriction to only accept credit transfers from Swiss bank accounts. You may +want to configure such restrictions on the bank accounts that may originate +funds to prevent international wire transfers that may expose you to +additional compliance risks. + +You can leave out the "credit-restriction" if you want to allow international +inbound wire transfers. + +The "debit-restriction" is largely mandatory as in this setup the +``taler-exchange-transfer`` is only configured to deal with the regional currency bank. Crediting fiat bank accounts must thus be done via the cash-out functionality of the regional currency bank account. +The "display-hint" gives priority (10) for the fiat cash-in account over the +regional currency account in the withdraw dialog of the wallets and labels the +account with "CHF". + .. note:: The above command adds a **second** bank account to the exchange. You (or the guided setup script) should have already enabled the regional currency bank account (without any "conversion-url"). -System ON! -++++++++++ - -The last step is to enable libeufin-nexus to :ref:`import incoming bank -transactions <receive-transaction-data>` (cash in) and to :ref:`trigger -outgoing bank transactions <sending-payments>` (cash out). - -.. code-block:: console - - # systemctl enable --now libeufin-nexus.target - - -Configuring exchange terms -++++++++++++++++++++++++++ - -You can use your own terms of service and privacy policy. You can use the default templates in ``/usr/share/taler/terms`` as a guide. -Assuming you have custom terms of service and privacy policy ``rst`` teamplte files at ``TOS_PATH`` and ``PRIVACY_PATH``, the following commands generate the terms files: +.. include:: ../frags/regional-system-on.rst +.. include:: ../frags/deploying-tos.rst +.. include:: ../frags/regional-manual-use.rst -.. code-block:: console - # taler-terms-generator -i "$TOS_PATH" - # taler-terms-generator -i "$PRIVACY_PATH" +Maintenance ++++++++++++ -You now have to specify the terms file names in the exchange config: +The ``taler-exchange-offline`` commands given above set fees only for the +current year (``now``). Thus, before January 1st of each year, you must to set +up new fees for the new calendar year. In a regional currency setup, this +typically requires up to three annual settings: .. code-block:: console - # TERMS_ETAG="$(basename "$TOS_PATH" .rst)" - # PRIVACY_ETAG="$(basename "$PRIVACY_PATH" .rst)" - -.. code-block:: ini - - [exchange] - TERMS_ETAG=${TERMS_ETAG} - PRIVACY_ETAG=${PRIVACY_ETAG} + # YEAR=2025 # edit if necessary + # FIAT_CURRENCY=CHF # edit if necessary + # REGIO_CURRENCY=NETZBON # edit if necessary + # sudo -u taler-exchange-offline \ + taler-exchange-offline \ + wire-fee "$YEAR" \ + iban "${FIAT_CURRENCY}":0 "${FIAT_CURRENCY}":0 \ + wire-fee "$YEAR" \ + x-taler-bank "${REGIO_CURRENCY}":0 "${REGIO_CURRENCY}":0 \ + global-fee $YEAR \ + "${REGIO_CURRENCY}:0" \ + "${REGIO_CURRENCY}:0" \ + "${REGIO_CURRENCY}:0" + 4w 6y 4 \ + upload + +If the fees are not all zero, simply change the respective place to specify +a non-zero fee. -Make sure to restart taler-exchange after changing these configuration options: - -.. code-block:: console - - # systemctl restart taler-exchange.target +.. note:: -.. include:: ../frags/regional-manual-use.rst + Additionally, the denomination signing keys will only have been + pre-generated for some time, depending on your ``LOOKAHEAD_SIGN`` + configuration option. Thus, you may need to periodically run + the "taler-exchange-offline download sign upload" sequence as well! |