[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-deployment] branch master updated: date range demonstrator logs
From: |
gnunet |
Subject: |
[taler-deployment] branch master updated: date range demonstrator logs |
Date: |
Thu, 24 Aug 2023 14:31:34 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository deployment.
The following commit(s) were added to refs/heads/master by this push:
new d285479 date range demonstrator logs
d285479 is described below
commit d2854799b6712f2d1766188dc64bf844109e5d15
Author: MS <ms@taler.net>
AuthorDate: Thu Aug 24 14:31:23 2023 +0200
date range demonstrator logs
---
nlnet/task5/date-range/start.sh | 86 +++++++++++++++++++++++++----------------
1 file changed, 53 insertions(+), 33 deletions(-)
diff --git a/nlnet/task5/date-range/start.sh b/nlnet/task5/date-range/start.sh
index 226084c..c61cfee 100755
--- a/nlnet/task5/date-range/start.sh
+++ b/nlnet/task5/date-range/start.sh
@@ -9,98 +9,96 @@
# request is exceptional: it's used only after a complaint
# from a user where they didn't get their funds as expected.
-set -eux
+set -eu
service postgresql start
sudo -u postgres createuser -s root
createdb libeufincheck
-source /start-libeufin.sh
-echo -n "Register the Sandbox account..."
+echo -n Launching and confirguring LibEuFin..
+source /start-libeufin.sh &> /dev/null
+# Register the Sandbox account.
export LIBEUFIN_SANDBOX_USERNAME=sandbox-user
export LIBEUFIN_SANDBOX_PASSWORD=foo
libeufin-cli \
sandbox --sandbox-url http://localhost:5000/ \
demobank \
register
-echo DONE
-
# x-libeufin-bank connection.
-echo -n Creating the x-libeufin-bank connection at Nexus...
+# Creating the x-libeufin-bank connection at Nexus.
export LIBEUFIN_NEXUS_USERNAME=test-user
export LIBEUFIN_NEXUS_PASSWORD=x
export LIBEUFIN_NEXUS_URL=http://localhost:5001
-# echoing the password to STDIN, as that is a "prompt" option.
libeufin-cli connections new-xlibeufinbank-connection \
--bank-url "http://localhost:5000/demobanks/default/access-api" \
--username sandbox-user \
--password foo \
xlibeufinbankconn
-echo DONE
-echo -n Connecting the x-libeufin-bank connection...
+# Connecting the x-libeufin-bank connection...
libeufin-cli connections connect xlibeufinbankconn
-echo DONE
# Importing the bank account under a local name at Nexus.
-echo -n Importing the x-libeufin-bank account locally..
+# Importing the x-libeufin-bank account locally..
libeufin-cli connections import-bank-account \
--offered-account-id sandbox-user \
--nexus-bank-account-id foo-at-nexus xlibeufinbankconn
-echo DONE
# EBICS connection.
## Sandbox side.
export LIBEUFIN_SANDBOX_USERNAME=admin
-echo -n "Create EBICS host at Sandbox..."
+# "Create EBICS host at Sandbox..."
libeufin-cli sandbox \
--sandbox-url http://localhost:5000 \
ebicshost create --host-id wwwebics
-echo OK
-echo -n "Create nlnet EBICS subscriber at Sandbox..."
+# Create nlnet EBICS subscriber at Sandbox
libeufin-cli sandbox \
--sandbox-url http://localhost:5000 \
demobank new-ebicssubscriber --host-id wwwebics \
--user-id nlnet --partner-id nlnet \
--bank-account sandbox-user # that's a username _and_ a bank account name
-echo OK
## Nexus side.
export LIBEUFIN_NEXUS_USERNAME=test-user
export LIBEUFIN_NEXUS_PASSWORD=x
export LIBEUFIN_NEXUS_URL=http://localhost:5001
-echo -n Creating the EBICS connection at Nexus...
+# Creating the EBICS connection at Nexus...
libeufin-cli connections new-ebics-connection \
--ebics-url "http://localhost:5000/ebicsweb" \
--host-id wwwebics \
--partner-id nlnet \
--ebics-user-id nlnet \
ebicsconn
-echo DONE
-echo -n Setup EBICS keying...
+# Setup EBICS keying...
libeufin-cli connections connect ebicsconn > /dev/null
-echo OK
-echo -n Download bank account name from Sandbox...
+# Download bank account name from Sandbox...
libeufin-cli connections download-bank-accounts ebicsconn
-echo OK
-echo -n Importing bank account info into Nexus...
+# Importing bank account info into Nexus...
libeufin-cli connections import-bank-account \
--offered-account-id sandbox-user \
--nexus-bank-account-id bar-at-nexus ebicsconn
-echo OK
+echo DONE
FIRST_JAN_2020="1577833200000" # in milliseconds
-END_DEC_2019="2019-12-30" # "1577660400000"
-MID_JAN_2020="2020-01-15" #"1579042800000"
+END_DEC_2019="2019-12-30"
+MID_JAN_2020="2020-01-15"
+echo Make sample transaction..
# 0, setup and start services.
libeufin-sandbox make-transaction \
--credit-account=admin \
--debit-account=sandbox-user MANA:2 \
"task5" # subject.
+echo DONE
-# 1, set artificial time for the transaction at $PAST.
+echo -n Articifially set the transaction date to $FIRST_JAN_2020..
+# 1, set artificial time for the transaction at January, 1st 2020.
echo "UPDATE bankaccounttransactions SET date='$FIRST_JAN_2020' WHERE
subject='task5'" | psql -q -d libeufincheck
+echo DONE
-# 2, retrieve the transaction via Nexus, for both connections.
-# This should get only ONE transaction.
+# 2, retrieve the transaction via Nexus, for both
+# connections and by asking for a (narrow) time frame
+# that includes the 2020-01-01 payment.
+
+echo -n Nexus: syncing banking records for the time frame
$END_DEC_2019-$MID_JAN_2020 via EBICS..
+# Fetch time-framed payments via EBICS.
libeufin-cli \
accounts \
fetch-transactions \
@@ -109,15 +107,34 @@ libeufin-cli \
--start=$END_DEC_2019 \
--end=$MID_JAN_2020 \
bar-at-nexus > /dev/null # EBICS
+echo DONE
+echo Showing the synced data..
+# Now checks if Nexus ingested and shows the
+# expected payment.
libeufin-cli \
accounts \
transactions \
bar-at-nexus
+echo DONE
+echo Resetting the Nexus database..
+# Bring the database state so that Nexus does not hold any payment.
echo "DELETE FROM nexusbanktransactions" | psql -d libeufincheck
echo "DELETE FROM nexusbankmessages" | psql -d libeufincheck
+echo DONE
+
+echo Checking that no payment data appears after the reset..
+# Double-checking that the future steps start
+# without the previous transactions.
+libeufin-cli \
+ accounts \
+ transactions \
+ foo-at-nexus # FIXME: put a 204 No Content check?
+echo DONE
+# Fetch time-framed payments via x-libeufin-bank.
+echo Nexus: syncing banking records for the time frame
${END_DEC_2019}_${MID_JAN_2020} via x-libeufin-bank..
libeufin-cli \
accounts \
fetch-transactions \
@@ -125,11 +142,14 @@ libeufin-cli \
--range-type=time-range \
--start=$END_DEC_2019 \
--end=$MID_JAN_2020 \
- foo-at-nexus # x-libeufin-bank
+ foo-at-nexus
+echo DONE
+# As in the previous case, now Nexus should show
+# the 2020-01-01 the payment.
+echo Showing the synced data..
libeufin-cli \
accounts \
transactions \
- foo-at-nexus
-
-bash
+ foo-at-nexus # FIXME: put a 200 OK check?
+echo DONE
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-deployment] branch master updated: date range demonstrator logs,
gnunet <=