gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] 01/04: Prepare env for CLI.


From: gnunet
Subject: [libeufin] 01/04: Prepare env for CLI.
Date: Thu, 14 Jan 2021 17:03:45 +0100

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

ms pushed a commit to branch master
in repository libeufin.

commit 57588f74945f34d72633d4ac6429d0e81c24e9d0
Author: ms <ms@taler.net>
AuthorDate: Thu Jan 14 16:53:21 2021 +0100

    Prepare env for CLI.
---
 cli/setup-template.sh | 63 +++++++++++++++++++++++++++++++--------------------
 1 file changed, 38 insertions(+), 25 deletions(-)

diff --git a/cli/setup-template.sh b/cli/setup-template.sh
index 3088a88..a893e9b 100755
--- a/cli/setup-template.sh
+++ b/cli/setup-template.sh
@@ -5,6 +5,10 @@
 
 set -eu
 
+SQLITE_FILE="/tmp/libeufin-cli-env.sqlite3"
+DATABASE_CONN="jdbc:sqlite:$SQLITE_FILE"
+CURRENCY="EUR"
+
 # EBICS details.
 SANDBOX_URL="http://localhost:5000";
 EBICS_HOST_ID=ebicshost
@@ -29,33 +33,43 @@ export NEXUS_BASE_URL="http://localhost:5001/";
 export NEXUS_USERNAME=$NEXUS_USER
 export NEXUS_PASSWORD=$NEXUS_PASSWORD
 
+echo Remove old database.
+rm -f $SQLITE_FILE
+
+echo Start services.
+libeufin-nexus serve --db-conn-string=$DATABASE_CONN &> nexus.log &
+nexus_pid=$!
+libeufin-sandbox serve --db-conn-string=$DATABASE_CONN &> sandbox.log &
+sandbox_pid=$!
+
+trap "echo Terminating services.; kill $nexus_pid; kill $sandbox_pid" EXIT
+
+curl -s --retry 5 --retry-connrefused $SANDBOX_URL > /dev/null
+curl -s --retry 5 --retry-connrefused $NEXUS_BASE_URL > /dev/null
+
 ########## setup sandbox #############
 
 # make ebics host at sandbox
 echo Making a ebics host at the sandbox
-sleep 2
-./libeufin-cli \
-  sandbox \
-    make-ebics-host \
-      --host-id=$EBICS_HOST_ID \
-      $SANDBOX_URL
+./bin/libeufin-cli \
+  sandbox --sandbox-url=$SANDBOX_URL \
+    ebicshost create \
+      --host-id=$EBICS_HOST_ID
 
 # activate a ebics subscriber on that host
 echo Activating the ebics subscriber at the sandbox
-sleep 2
-./libeufin-cli \
-  sandbox \
-    activate-ebics-subscriber \
+./bin/libeufin-cli \
+  sandbox --sandbox-url=$SANDBOX_URL \
+    ebicssubscriber create \
       --host-id=$EBICS_HOST_ID \
       --partner-id=$EBICS_PARTNER_ID \
-      --user-id=$EBICS_USER_ID \
-      $SANDBOX_URL
+      --user-id=$EBICS_USER_ID
 
 # give a bank account to such user
 echo Giving a bank account to such subscriber
-./libeufin-cli \
-  sandbox \
-    associate-bank-account \
+./bin/libeufin-cli \
+  sandbox --sandbox-url=$SANDBOX_URL \
+    ebicsbankaccount create \
       --iban=$IBAN \
       --bic=$BIC \
       --person-name=$PERSON_NAME \
@@ -63,20 +77,20 @@ echo Giving a bank account to such subscriber
       --ebics-user-id=$EBICS_USER_ID \
       --ebics-host-id=$EBICS_HOST_ID \
       --ebics-partner-id=$EBICS_PARTNER_ID \
-      $SANDBOX_URL
-sleep 2
+      --currency=$CURRENCY
 
 ########## setup nexus #############
 
 # create a user
-NEXUS_DATABASE=$(curl -s $NEXUS_BASE_URL/service-config | jq .dbConn | tr -d 
\" | awk -F: '{print $2}')
 echo "Creating a nexus superuser"
-libeufin-nexus superuser --db-name $NEXUS_DATABASE --password $NEXUS_PASSWORD 
$NEXUS_USER &> /dev/null
-sleep 2
+libeufin-nexus \
+  superuser \
+    --db-conn-string=$DATABASE_CONN \
+    --password $NEXUS_PASSWORD $NEXUS_USER &> /dev/null
 
 # create a bank connection
 echo Creating a bank connection for such user
-./libeufin-cli \
+./bin/libeufin-cli \
   connections \
     new-ebics-connection \
       --ebics-url $EBICS_BASE_URL \
@@ -84,21 +98,20 @@ echo Creating a bank connection for such user
       --partner-id $EBICS_PARTNER_ID \
       --ebics-user-id $EBICS_USER_ID \
       $NEXUS_BANK_CONNECTION_NAME > /dev/null
-sleep 2
 
 # Bootstrapping such connection.
 echo Bootstrapping the bank connection
-./libeufin-cli \
+./bin/libeufin-cli \
   connections sync $NEXUS_BANK_CONNECTION_NAME > /dev/null
 
 # Download bank accounts.
 echo Download bank accounts
-./libeufin-cli \
+./bin/libeufin-cli \
   connections download-bank-accounts \
     $NEXUS_BANK_CONNECTION_NAME > /dev/null
 
 # Import bank account for user.
-./libeufin-cli \
+./bin/libeufin-cli \
   connections import-bank-account \
     --offered-account-id=$ACCOUNT_NAME \
     --nexus-bank-account-id=$ACCOUNT_NAME_AT_NEXUS \

-- 
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]