summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2023-08-02 15:12:39 +0200
committerMS <ms@taler.net>2023-08-02 15:15:15 +0200
commit2b6efc17cc2f4da9f3f5a15572fafb42f4326bd9 (patch)
tree4112c4d5176b47c54a3786570352b030d0a9773e
parentfb0b6d8ada63c867c078584fd9a666c460bef6ba (diff)
downloaddeployment-2b6efc17cc2f4da9f3f5a15572fafb42f4326bd9.tar.gz
deployment-2b6efc17cc2f4da9f3f5a15572fafb42f4326bd9.tar.bz2
deployment-2b6efc17cc2f4da9f3f5a15572fafb42f4326bd9.zip
NLnet task 5.
Getting the demonstrator of time-framed bank histories to pass.
-rw-r--r--nlnet/task5/date-range/Dockerfile2
-rwxr-xr-xnlnet/task5/date-range/start.sh61
2 files changed, 50 insertions, 13 deletions
diff --git a/nlnet/task5/date-range/Dockerfile b/nlnet/task5/date-range/Dockerfile
index e3ebca5..8d1224f 100644
--- a/nlnet/task5/date-range/Dockerfile
+++ b/nlnet/task5/date-range/Dockerfile
@@ -6,7 +6,7 @@ RUN apt-get install -y openjdk-17-jre git python3-pip curl jq sqlite3 postgresql
# Installation
RUN git clone git://git.taler.net/libeufin
WORKDIR /libeufin
-RUN git fetch && git checkout 934a73b09b9e9abba348e15ddc058df5bb9cd6a3
+RUN git fetch && git checkout a614d433a8307468f1074114086ae0a47b848472
RUN ./bootstrap
RUN ./configure --prefix=/usr/local
RUN make install
diff --git a/nlnet/task5/date-range/start.sh b/nlnet/task5/date-range/start.sh
index 2d41c8a..226084c 100755
--- a/nlnet/task5/date-range/start.sh
+++ b/nlnet/task5/date-range/start.sh
@@ -1,6 +1,15 @@
#!/bin/bash
-# Draft.
+# This script shows how Nexus can request histories from
+# a particular time frame. Such request must succeed via
+# two connection types: EBICS and x-libeufin-bank. EBICS
+# ensures the fetching of fiat payments made to the regional
+# currency authority, whereas x-libeufin-bank does it for
+# the regional currency circuit. Note: the time-framed
+# request is exceptional: it's used only after a complaint
+# from a user where they didn't get their funds as expected.
+
+set -eux
service postgresql start
sudo -u postgres createuser -s root
@@ -77,22 +86,50 @@ libeufin-cli connections import-bank-account \
--nexus-bank-account-id bar-at-nexus ebicsconn
echo OK
-exit
+FIRST_JAN_2020="1577833200000" # in milliseconds
+END_DEC_2019="2019-12-30" # "1577660400000"
+MID_JAN_2020="2020-01-15" #"1579042800000"
+
# 0, setup and start services.
libeufin-sandbox make-transaction \
--credit-account=admin \
--debit-account=sandbox-user MANA:2 \
+ "task5" # subject.
# 1, set artificial time for the transaction at $PAST.
-# 2, retrieve the $PAST transaction via Nexus.
+echo "UPDATE bankaccounttransactions SET date='$FIRST_JAN_2020' WHERE subject='task5'" | psql -q -d libeufincheck
+
+# 2, retrieve the transaction via Nexus, for both connections.
+# This should get only ONE transaction.
+libeufin-cli \
+ accounts \
+ fetch-transactions \
+ --level=report \
+ --range-type=time-range \
+ --start=$END_DEC_2019 \
+ --end=$MID_JAN_2020 \
+ bar-at-nexus > /dev/null # EBICS
+
libeufin-cli \
- connections \
+ accounts \
+ transactions \
+ bar-at-nexus
+
+echo "DELETE FROM nexusbanktransactions" | psql -d libeufincheck
+echo "DELETE FROM nexusbankmessages" | psql -d libeufincheck
+
+libeufin-cli \
+ accounts \
fetch-transactions \
- --range-type=time-frame \
- --start $START \
- --end $END
-# 3, show ingested transactions, where only $PATH appears.
-libeufin-cli
- accounts
- list-payments
- $OTHER_ARGS
+ --level=statement \
+ --range-type=time-range \
+ --start=$END_DEC_2019 \
+ --end=$MID_JAN_2020 \
+ foo-at-nexus # x-libeufin-bank
+
+libeufin-cli \
+ accounts \
+ transactions \
+ foo-at-nexus
+
+bash