gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 02/02: convenience scripts


From: gnunet
Subject: [libeufin] 02/02: convenience scripts
Date: Wed, 07 Jun 2023 12:13:27 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit a05943bd4c442ede649de793e8f87a6768520dec
Author: MS <ms@taler.net>
AuthorDate: Wed Jun 7 12:05:39 2023 +0200

    convenience scripts
---
 cli/tests/add-incoming-client.sh                   |   7 ++
 cli/tests/launch_services_with_ebics.sh            | 106 +++++++++++++++++++++
 ...es.sh => launch_services_with_xlibeufinbank.sh} |   0
 3 files changed, 113 insertions(+)

diff --git a/cli/tests/add-incoming-client.sh b/cli/tests/add-incoming-client.sh
new file mode 100755
index 00000000..36314b74
--- /dev/null
+++ b/cli/tests/add-incoming-client.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+curl -v -s \
+  -XPOST \
+  -H "Content-Type: application/json" \
+  -d'{"amount": "MANA:3.00", "reservePub": "re:publica"}' \
+  
http://localhost:5001/facades/test-facade/taler-wire-gateway/admin/add-incoming
diff --git a/cli/tests/launch_services_with_ebics.sh 
b/cli/tests/launch_services_with_ebics.sh
new file mode 100755
index 00000000..fdd5a74d
--- /dev/null
+++ b/cli/tests/launch_services_with_ebics.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# Convenience script to setup and run a Sandbox + Nexus
+# EBICS pair, in order to try CLI commands.
+set -eu
+
+function exit_cleanup()
+{
+  echo "Running exit-cleanup"
+  for n in `jobs -p`
+    do
+      kill $n 2> /dev/null || true
+    done
+    wait || true
+    echo "DONE"
+}
+
+trap "exit_cleanup" EXIT
+echo RUNNING SANDBOX-NEXUS EBICS PAIR
+jq --version &> /dev/null || (echo "'jq' command not found"; exit 77)
+curl --version &> /dev/null || (echo "'curl' command not found"; exit 77)
+
+DB_PATH=/tmp/libeufin-cli-test.sqlite3
+export LIBEUFIN_SANDBOX_DB_CONNECTION=jdbc:sqlite:$DB_PATH
+
+echo -n Delete previous data...
+rm -f $DB_PATH
+echo DONE
+echo -n Configure the default demobank with MANA...
+libeufin-sandbox config --with-signup-bonus --currency MANA default
+echo DONE
+echo -n Start the bank...
+export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=foo
+libeufin-sandbox serve &> sandbox.log &
+SANDBOX_PID=$!
+echo DONE
+echo -n Wait for the bank...
+curl --max-time 2 --retry-connrefused --retry-delay 1 --retry 10 
http://localhost:5000/ &> /dev/null
+echo DONE
+echo -n Make one superuser at Nexus...
+export LIBEUFIN_NEXUS_DB_CONNECTION=jdbc:sqlite:$DB_PATH
+libeufin-nexus superuser test-user --password x
+echo DONE
+echo -n Launching Nexus...
+libeufin-nexus serve &> nexus.log &
+NEXUS_PID=$!
+echo DONE
+echo -n Waiting for Nexus...
+curl --max-time 2 --retry-connrefused --retry-delay 1 --retry 10 
http://localhost:5001/ &> /dev/null
+echo DONE
+
+echo -n "Register the 'www' Sandbox account..."
+export LIBEUFIN_SANDBOX_USERNAME=www
+export LIBEUFIN_SANDBOX_PASSWORD=foo
+libeufin-cli \
+  sandbox --sandbox-url http://localhost:5000/ \
+  demobank \
+  register
+echo DONE
+export LIBEUFIN_SANDBOX_USERNAME=admin
+export LIBEUFIN_SANDBOX_PASSWORD=foo
+echo -n "Create EBICS host at Sandbox..."
+libeufin-cli sandbox \
+  --sandbox-url http://localhost:5000 \
+  ebicshost create --host-id wwwebics
+echo OK
+echo -n "Create 'www' EBICS subscriber at Sandbox..."
+libeufin-cli sandbox \
+  --sandbox-url http://localhost:5000 \
+  demobank new-ebicssubscriber --host-id wwwebics \
+  --user-id wwwebics --partner-id wwwpartner \
+  --bank-account www # that's a username _and_ a bank account name
+echo OK
+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...
+libeufin-cli connections new-ebics-connection \
+  --ebics-url "http://localhost:5000/ebicsweb"; \
+  --host-id wwwebics \
+  --partner-id wwwpartner \
+  --ebics-user-id wwwebics \
+  wwwconn
+echo DONE
+echo -n Setup EBICS keying...
+libeufin-cli connections connect wwwconn > /dev/null
+echo OK
+echo -n Download bank account name from Sandbox...
+libeufin-cli connections download-bank-accounts wwwconn
+echo OK
+echo -n Importing bank account info into Nexus...
+libeufin-cli connections import-bank-account \
+  --offered-account-id www \
+  --nexus-bank-account-id www-nexus \
+  wwwconn
+echo OK
+echo -n Create the Taler facade at Nexus...
+libeufin-cli facades \
+  new-taler-wire-gateway-facade \
+  --currency TESTKUDOS --facade-name test-facade \
+  wwwconn www-nexus
+echo OK
+echo -n "Ticking, to let statements be generated..."
+libeufin-sandbox camt053tick
+echo OK
+read -p "Press Enter to terminate..."
diff --git a/cli/tests/launch_services.sh 
b/cli/tests/launch_services_with_xlibeufinbank.sh
similarity index 100%
rename from cli/tests/launch_services.sh
rename to cli/tests/launch_services_with_xlibeufinbank.sh

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]