aboutsummaryrefslogtreecommitdiff
path: root/src/merchant-tools
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-16 14:38:55 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-16 14:38:55 +0200
commitfd22e4c75dd2cad7f2ff0a55660e9af057419e5b (patch)
tree91ffaeb3e8bcba657f6c26f6f8bf4df5bc95587a /src/merchant-tools
parentf27bd7ccf260e90fb86461fbfa07a09f555756c9 (diff)
work on getting taler-merchant-benchmark to function
Diffstat (limited to 'src/merchant-tools')
-rw-r--r--src/merchant-tools/Makefile.am7
-rw-r--r--src/merchant-tools/benchmark-common.conf90
-rw-r--r--src/merchant-tools/benchmark-cs.conf16
-rw-r--r--src/merchant-tools/benchmark-rsa.conf16
-rw-r--r--src/merchant-tools/coins-cs.conf58
-rw-r--r--src/merchant-tools/coins-rsa.conf63
-rw-r--r--src/merchant-tools/taler-merchant-benchmark.c161
7 files changed, 340 insertions, 71 deletions
diff --git a/src/merchant-tools/Makefile.am b/src/merchant-tools/Makefile.am
index ea448bb4..e08bd1e3 100644
--- a/src/merchant-tools/Makefile.am
+++ b/src/merchant-tools/Makefile.am
@@ -11,6 +11,13 @@ bin_PROGRAMS = \
taler-merchant-setup-reserve \
taler-merchant-benchmark
+EXTRA_DIST = \
+ benchmark-common.conf \
+ benchmark-cs.conf \
+ benchmark-rsa.conf \
+ coins-cs.conf \
+ coins-rsa.conf
+
taler_merchant_benchmark_SOURCES = \
taler-merchant-benchmark.c
taler_merchant_benchmark_LDADD = \
diff --git a/src/merchant-tools/benchmark-common.conf b/src/merchant-tools/benchmark-common.conf
new file mode 100644
index 00000000..dded382a
--- /dev/null
+++ b/src/merchant-tools/benchmark-common.conf
@@ -0,0 +1,90 @@
+# This file is in the public domain.
+[paths]
+TALER_TEST_HOME=exchange_benchmark_home/
+
+[taler]
+CURRENCY=EUR
+CURRENCY_ROUND_UNIT=EUR:0.01
+
+[merchant-benchmark]
+MERCHANT_URL = "http://localhost:9966/"
+
+[exchange]
+AML_THRESHOLD=EUR:99999999
+SIGNKEY_LEGAL_DURATION=2 years
+PORT=8081
+MASTER_PUBLIC_KEY=98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+DB=postgres
+BASE_URL="http://localhost:8081/"
+AGGREGATOR_SHARD_SIZE=67108864
+WIREWATCH_IDLE_SLEEP_INTERVAL=5 ms
+
+[exchangedb-postgres]
+CONFIG="postgres:///talercheck"
+
+[exchange-offline]
+MASTER_PRIV_FILE=${TALER_DATA_HOME}/exchange/offline-keys/master.priv
+
+[taler-exchange-secmod-rsa]
+LOOKAHEAD_SIGN="1 d"
+
+[taler-exchange-secmod-cs]
+LOOKAHEAD_SIGN="1 d"
+
+[taler-exchange-secmod-eddsa]
+DURATION="2 d"
+LOOKAHEAD_SIGN="1 d"
+
+# account-2 is suitable for fakebank
+[exchange-account-1]
+PAYTO_URI = "payto://x-taler-bank/localhost/42?receiver-name=42"
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-1]
+WIRE_GATEWAY_AUTH_METHOD = none
+WIRE_GATEWAY_URL = "http://localhost:8082/42/"
+
+# account-2 is suitable for libeufin
+[exchange-account-2]
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+PAYTO_URI = payto://iban/SANDBOXX/DE033310?receiver-name=Exchange+Company
+
+[exchange-accountcredentials-2]
+WIRE_GATEWAY_AUTH_METHOD = basic
+USERNAME = exchange
+PASSWORD = x
+WIRE_GATEWAY_URL = "http://localhost:8082/facades/test-facade/taler-wire-gateway/"
+
+
+# Trust local exchange for "EUR" currency
+[merchant-exchange-benchmark]
+EXCHANGE_BASE_URL = http://localhost:8081/
+MASTER_KEY=98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+# If currency does not match [TALER] section, the exchange
+# will be ignored!
+CURRENCY = EUR
+
+
+[merchantdb-postgres]
+CONFIG="postgres:///talercheck"
+
+[auditordb-postgres]
+CONFIG="postgres:///talercheck"
+
+[syncdb-postgres]
+CONFIG="postgres:///talercheck"
+
+[bank]
+HTTP_PORT=8082
+SERVE=http
+
+[libeufin-nexus]
+DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432"
+
+[libeufin-sandbox]
+DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432"
+
+[auditor]
+BASE_URL="http://localhost:8083/"
diff --git a/src/merchant-tools/benchmark-cs.conf b/src/merchant-tools/benchmark-cs.conf
new file mode 100644
index 00000000..db44e4d1
--- /dev/null
+++ b/src/merchant-tools/benchmark-cs.conf
@@ -0,0 +1,16 @@
+# This file is in the public domain.
+@INLINE@ benchmark-common.conf
+@INLINE@ coins-cs.conf
+
+[exchange-account-test]
+# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
+PAYTO_URI = "payto://x-taler-bank/localhost/Exchange"
+# Authentication information for basic authentication
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-test]
+WIRE_GATEWAY_URL = http://localhost:8082/Exchange/
+WIRE_GATEWAY_AUTH_METHOD = "basic"
+USERNAME = Exchange
+PASSWORD = x
diff --git a/src/merchant-tools/benchmark-rsa.conf b/src/merchant-tools/benchmark-rsa.conf
new file mode 100644
index 00000000..bd4a90cf
--- /dev/null
+++ b/src/merchant-tools/benchmark-rsa.conf
@@ -0,0 +1,16 @@
+# This file is in the public domain.
+@INLINE@ benchmark-common.conf
+@INLINE@ coins-rsa.conf
+
+[exchange-account-test]
+# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
+PAYTO_URI = "payto://x-taler-bank/localhost/Exchange"
+# Authentication information for basic authentication
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-test]
+WIRE_GATEWAY_URL = http://localhost:8082/Exchange/
+WIRE_GATEWAY_AUTH_METHOD = "basic"
+USERNAME = Exchange
+PASSWORD = x
diff --git a/src/merchant-tools/coins-cs.conf b/src/merchant-tools/coins-cs.conf
new file mode 100644
index 00000000..c4b5a45c
--- /dev/null
+++ b/src/merchant-tools/coins-cs.conf
@@ -0,0 +1,58 @@
+# This file is in the public domain.
+#
+# Sections starting with "coin_" specify which denominations
+# the exchange should support (and their respective fee structure)
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+fee_refund = EUR:0.01
+CIPHER = CS
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+CIPHER = CS
+
+[coin_eur_1]
+value = EUR:1
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+CIPHER = CS
+
+[coin_eur_5]
+value = EUR:5
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+CIPHER = CS
+
+[coin_eur_10]
+value = EUR:10
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+CIPHER = CS
diff --git a/src/merchant-tools/coins-rsa.conf b/src/merchant-tools/coins-rsa.conf
new file mode 100644
index 00000000..42eb8acf
--- /dev/null
+++ b/src/merchant-tools/coins-rsa.conf
@@ -0,0 +1,63 @@
+# This file is in the public domain.
+#
+# Sections starting with "coin_" specify which denominations
+# the exchange should support (and their respective fee structure)
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+fee_refund = EUR:0.01
+CIPHER = RSA
+rsa_keysize = 2048
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+CIPHER = RSA
+rsa_keysize = 2048
+
+[coin_eur_1]
+value = EUR:1
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+CIPHER = RSA
+rsa_keysize = 2048
+
+[coin_eur_5]
+value = EUR:5
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+CIPHER = RSA
+rsa_keysize = 2048
+
+[coin_eur_10]
+value = EUR:10
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+CIPHER = RSA
+rsa_keysize = 2048
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c
index 17764eb1..09c2ba6a 100644
--- a/src/merchant-tools/taler-merchant-benchmark.c
+++ b/src/merchant-tools/taler-merchant-benchmark.c
@@ -203,9 +203,10 @@ run (void *cls,
CURRENCY_10_02,
&cred.ba,
cred.user43_payto),
- TALER_TESTING_cmd_exec_wirewatch (
+ TALER_TESTING_cmd_exec_wirewatch2 (
"wirewatch-1",
- cfg_filename),
+ cfg_filename,
+ exchange_bank_section),
TALER_TESTING_cmd_withdraw_amount (
"withdraw-coin-1",
"create-reserve-1",
@@ -328,9 +329,10 @@ run (void *cls,
CURRENCY_5_01,
&cred.ba,
cred.user43_payto),
- TALER_TESTING_cmd_exec_wirewatch (
+ TALER_TESTING_cmd_exec_wirewatch2 (
"wirewatch-1",
- cfg_filename),
+ cfg_filename,
+ exchange_bank_section),
TALER_TESTING_cmd_withdraw_amount (
"withdraw-coin-1",
"create-reserve-1",
@@ -364,9 +366,10 @@ run (void *cls,
CURRENCY_10_02,
&cred.ba,
cred.user43_payto),
- TALER_TESTING_cmd_exec_wirewatch (
+ TALER_TESTING_cmd_exec_wirewatch2 (
"wirewatch-2",
- cfg_filename),
+ cfg_filename,
+ exchange_bank_section),
TALER_TESTING_cmd_withdraw_amount (
"withdraw-coin-2",
"create-reserve-2",
@@ -446,85 +449,101 @@ main (int argc,
"use fakebank for the banking system",
&use_fakebank),
GNUNET_GETOPT_option_version (PACKAGE_VERSION " " VCS_VERSION),
- GNUNET_GETOPT_option_help ("Runs benchmark logic against merchant backend. "
- "Must be used with either 'ordinary' or 'corner' sub-commands."),
- GNUNET_GETOPT_option_string ('l',
- "logfile",
- "LF",
- "will log to file LF",
- &logfile),
+ GNUNET_GETOPT_option_help (
+ "Runs benchmark logic against merchant backend. "
+ "Must be used with either 'ordinary' or 'corner' sub-commands."),
+ GNUNET_GETOPT_option_string (
+ 'l',
+ "logfile",
+ "LF",
+ "will log to file LF",
+ &logfile),
GNUNET_GETOPT_option_loglevel (&loglev),
GNUNET_GETOPT_OPTION_END
};
struct GNUNET_GETOPT_CommandLineOption corner_options[] = {
- GNUNET_GETOPT_option_string ('l',
- "logfile",
- "LF",
- "will log to file LF",
- &logfile),
- GNUNET_GETOPT_option_loglevel (&loglev),
+ GNUNET_GETOPT_option_string (
+ 'a',
+ "apikey",
+ "APIKEY",
+ "HTTP 'Authorization' header to send to the merchant",
+ &apikey),
GNUNET_GETOPT_option_cfgfile (&cfg_filename),
+ GNUNET_GETOPT_option_flag (
+ 'f',
+ "fakebank",
+ "use fakebank for the banking system",
+ &use_fakebank),
GNUNET_GETOPT_option_help ("Populate databases with corner case payments"),
- GNUNET_GETOPT_option_uint ('u',
- "unaggregated-number",
- "UN",
- "will generate UN unaggregated payments, defaults to 1",
- &unaggregated_number),
- GNUNET_GETOPT_option_uint ('t',
- "two-coins",
- "TC",
- "will perform TC 2-coins payments, defaults to 1",
- &twocoins_number),
+ GNUNET_GETOPT_option_string (
+ 'l',
+ "logfile",
+ "LF",
+ "will log to file LF",
+ &logfile),
+ GNUNET_GETOPT_option_loglevel (&loglev),
+ GNUNET_GETOPT_option_uint (
+ 't',
+ "two-coins",
+ "TC",
+ "will perform TC 2-coins payments, defaults to 1",
+ &twocoins_number),
+ GNUNET_GETOPT_option_uint (
+ 'U',
+ "unaggregated-number",
+ "UN",
+ "will generate UN unaggregated payments, defaults to 1",
+ &unaggregated_number),
GNUNET_GETOPT_option_string (
'u',
"exchange-account-section",
"SECTION",
"use exchange bank account configuration from the given SECTION",
&exchange_bank_section),
+ GNUNET_GETOPT_OPTION_END
+ };
+ struct GNUNET_GETOPT_CommandLineOption ordinary_options[] = {
+ GNUNET_GETOPT_option_string (
+ 'a',
+ "apikey",
+ "APIKEY",
+ "HTTP 'Authorization' header to send to the merchant",
+ &apikey),
+ GNUNET_GETOPT_option_cfgfile (&cfg_filename),
+ GNUNET_GETOPT_option_mandatory (
+ GNUNET_GETOPT_option_string (
+ 'e',
+ "exchange-account",
+ "SECTION",
+ "configuration section specifying the exchange account to use, mandatory",
+ &exchange_account)),
GNUNET_GETOPT_option_flag (
'f',
"fakebank",
"use fakebank for the banking system",
&use_fakebank),
- GNUNET_GETOPT_option_string ('a',
- "apikey",
- "APIKEY",
- "HTTP 'Authorization' header to send to the merchant",
- &apikey),
- GNUNET_GETOPT_OPTION_END
- };
- struct GNUNET_GETOPT_CommandLineOption ordinary_options[] = {
- GNUNET_GETOPT_option_string ('l',
- "logfile",
- "LF",
- "will log to file LF",
- &logfile),
+ GNUNET_GETOPT_option_help (
+ "Generate Taler ordinary payments"
+ " to populate the databases"),
+ GNUNET_GETOPT_option_string (
+ 'l',
+ "logfile",
+ "LF",
+ "will log to file LF",
+ &logfile),
GNUNET_GETOPT_option_loglevel (&loglev),
- GNUNET_GETOPT_option_cfgfile (&cfg_filename),
- GNUNET_GETOPT_option_version (PACKAGE_VERSION " " VCS_VERSION),
- GNUNET_GETOPT_option_help ("Generate Taler ordinary payments"
- " to populate the databases"),
- GNUNET_GETOPT_option_mandatory (
- GNUNET_GETOPT_option_string ('e',
- "exchange-account",
- "SECTION",
- "configuration section specifying the exchange account to use, mandatory",
- &exchange_account)),
- GNUNET_GETOPT_option_uint ('p',
- "payments-number",
- "PN",
- "will generate PN payments, defaults to 1",
- &payments_number),
- GNUNET_GETOPT_option_string ('a',
- "apikey",
- "APIKEY",
- "HTTP 'Authorization' header to send to the merchant",
- &apikey),
- GNUNET_GETOPT_option_uint ('t',
- "tracks-number",
- "TN",
- "will perform TN /track operations, defaults to 1",
- &tracks_number),
+ GNUNET_GETOPT_option_uint (
+ 'p',
+ "payments-number",
+ "PN",
+ "will generate PN payments, defaults to 1",
+ &payments_number),
+ GNUNET_GETOPT_option_uint (
+ 't',
+ "tracks-number",
+ "TN",
+ "will perform TN /track operations, defaults to 1",
+ &tracks_number),
GNUNET_GETOPT_option_version (PACKAGE_VERSION "-" VCS_VERSION),
GNUNET_GETOPT_OPTION_END
};
@@ -638,10 +657,10 @@ main (int argc,
GNUNET_CONFIGURATION_destroy (cfg);
}
- GNUNET_assert (0 < GNUNET_asprintf (&alt_instance_url,
- "%sinstances/%s/",
- merchant_url,
- alt_instance_id));
+ GNUNET_asprintf (&alt_instance_url,
+ "%sinstances/%s/",
+ merchant_url,
+ alt_instance_id);
{
enum GNUNET_GenericReturnValue result;