commit ff25eb64c171c37201dcf3d52d8c2d711afe68c1
parent fba64a564e04aa4897120c9444e8cb4f8f54ab68
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Mon, 25 Dec 2023 10:59:21 +0800
towards getting benchmarks to work with libeufin
Diffstat:
6 files changed, 28 insertions(+), 35 deletions(-)
diff --git a/src/benchmark/bank-benchmark-cs.conf b/src/benchmark/bank-benchmark-cs.conf
@@ -2,16 +2,4 @@
@INLINE@ benchmark-common.conf
@INLINE@ coins-cs.conf
-[exchange-account-2]
-# What is the payto://-URL of the exchange (to generate wire response)
-PAYTO_URI = "payto://x-taler-bank/localhost:8082/Exchange?receiver-name=Exchange"
-ENABLE_DEBIT = YES
-ENABLE_CREDIT = YES
-[exchange-accountcredentials-2]
-# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
-WIRE_GATEWAY_URL = http://localhost:8082/accounts/Exchange/taler-wire-gateway/
-# Authentication information for basic authentication
-WIRE_GATEWAY_AUTH_METHOD = "basic"
-USERNAME = Exchange
-PASSWORD = x
diff --git a/src/benchmark/bank-benchmark-rsa.conf b/src/benchmark/bank-benchmark-rsa.conf
@@ -1,17 +1,5 @@
# This file is in the public domain.
@INLINE@ benchmark-common.conf
-@INLINE@ coins-cs.conf
+@INLINE@ coins-rsa.conf
-[exchange-account-2]
-# What is the payto://-URL of the exchange (to generate wire response)
-PAYTO_URI = "payto://x-taler-bank/localhost:8082/Exchange?receiver-name=Exchange"
-ENABLE_DEBIT = YES
-ENABLE_CREDIT = YES
-[exchange-accountcredentials-2]
-# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
-WIRE_GATEWAY_URL = http://localhost:8082/accounts/Exchange/taler-wire-gateway/
-# Authentication information for basic authentication
-WIRE_GATEWAY_AUTH_METHOD = "basic"
-USERNAME = Exchange
-PASSWORD = x
diff --git a/src/benchmark/benchmark-common.conf b/src/benchmark/benchmark-common.conf
@@ -42,7 +42,7 @@ ENABLE_CREDIT = YES
[exchange-accountcredentials-1]
WIRE_GATEWAY_AUTH_METHOD = none
-WIRE_GATEWAY_URL = "http://localhost:8082/accounts/42/taler-wire-gateway/"
+WIRE_GATEWAY_URL = "http://localhost:8080/accounts/42/taler-wire-gateway/"
# account-2 is suitable for libeufin
[exchange-account-2]
@@ -54,7 +54,13 @@ PAYTO_URI = payto://iban/SANDBOXX/DE033310?receiver-name=Exchange+Company
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = exchange
PASSWORD = x
-WIRE_GATEWAY_URL = "http://localhost:8082/accounts/exchange/taler-wire-gateway/"
+WIRE_GATEWAY_URL = "http://localhost:8080/accounts/exchange/taler-wire-gateway/"
+
+[admin-accountcredentials-2]
+WIRE_GATEWAY_AUTH_METHOD = basic
+USERNAME = admin
+PASSWORD = secret
+WIRE_GATEWAY_URL = "http://localhost:8080/accounts/exchange/taler-wire-gateway/"
# Trust local exchange for "EUR" currency
@@ -79,10 +85,13 @@ CONFIG="postgres:///talercheck"
WIREWATCH_IDLE_SLEEP_INTERVAL = 5000 ms
[bank]
-HTTP_PORT=8082
+HTTP_PORT=8080
SERVE=http
RAM_LIMIT=10000000
+[libeufin-bank]
+CURRENCY = EUR
+
[libeufin-nexus]
DB_CONNECTION="postgresql:///talercheck"
diff --git a/src/benchmark/taler-bank-benchmark.c b/src/benchmark/taler-bank-benchmark.c
@@ -220,7 +220,7 @@ run (void *cls,
TALER_TESTING_cmd_admin_add_incoming (add_label (
create_reserve_label),
total_reserve_amount,
- &cred.ba,
+ &cred.ba_admin,
cred.user42_payto));
}
GNUNET_free (total_reserve_amount);
diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c
@@ -163,7 +163,7 @@ cmd_transfer_to_exchange (const char *label,
return TALER_TESTING_cmd_admin_add_incoming_retry (
TALER_TESTING_cmd_admin_add_incoming (label,
amount,
- &cred.ba,
+ &cred.ba_admin,
cred.user42_payto));
}
@@ -171,6 +171,7 @@ cmd_transfer_to_exchange (const char *label,
/**
* Throw a weighted coin with @a probability.
*
+ * @param probability weight of the coin flip
* @return #GNUNET_OK with @a probability,
* #GNUNET_NO with 1 - @a probability
*/
diff --git a/src/testing/taler-unified-setup.sh b/src/testing/taler-unified-setup.sh
@@ -252,10 +252,9 @@ register_bank_account() {
--method=POST \
--header='Content-type: application/json' \
--body-data="${BODY}" \
- --content-on-error \
- -a wget-register-account.log \
-o /dev/null \
-O /dev/null \
+ -a wget-register-account.log \
"http://localhost:${BANK_PORT}/accounts"
}
@@ -281,7 +280,13 @@ register_fakebank_account() {
}
-if [[ "1" = "$START_BANK" || "1" = "$START_FAKEBANK" ]]
+if [[ "1" = "$START_BANK" ]]
+then
+ BANK_PORT=$(taler-config -c "$CONF" -s "libeufin-bank" -o "PORT")
+ BANK_URL="http://localhost:${BANK_PORT}/"
+fi
+
+if [[ "1" = "$START_FAKEBANK" ]]
then
BANK_PORT=$(taler-config -c "$CONF" -s "BANK" -o "HTTP_PORT")
BANK_URL="http://localhost:${BANK_PORT}/"
@@ -310,6 +315,7 @@ then
wget --timeout=1 \
--tries=3 \
--waitretry=0 \
+ -a wget-bank-check.log \
-o /dev/null \
-O /dev/null \
"$BANK_URL/config" || continue
@@ -369,9 +375,10 @@ then
--timeout=1 \
--user admin \
--password secret \
- "http://localhost:${BANK_PORT}/" \
+ -a wget-bank-check.log \
-o /dev/null \
- -O /dev/null >/dev/null || continue
+ -O /dev/null \
+ "http://localhost:${BANK_PORT}/" || continue
OK="1"
break
done