Compare commits
11 Commits
7837015692
...
3ce29a711b
Author | SHA1 | Date | |
---|---|---|---|
|
3ce29a711b | ||
|
ec03f262b6 | ||
|
942dd73794 | ||
|
cd5fafffe2 | ||
|
5b14fd547e | ||
|
cd45ba408a | ||
|
ea47fb40c0 | ||
|
22ad41a2b4 | ||
|
3976729af1 | ||
c86a169fb5 | |||
3bebbfc2da |
2
debian/libtalerexchange-dev.install
vendored
2
debian/libtalerexchange-dev.install
vendored
@ -4,6 +4,7 @@ usr/bin/taler-exchange-benchmark
|
||||
usr/bin/taler-fakebank-run
|
||||
usr/bin/taler-bank-benchmark
|
||||
usr/bin/taler-exchange-kyc-tester
|
||||
usr/bin/taler-unified-setup.sh
|
||||
|
||||
# Only used in test cases. Maybe these
|
||||
# shouldn't even be installed?
|
||||
@ -28,4 +29,5 @@ usr/lib/*/libtalerfakebank.so
|
||||
|
||||
# Documentation
|
||||
usr/share/man/man1/taler-exchange-benchmark*
|
||||
usr/share/man/man1/taler-unified-setup
|
||||
usr/share/info/taler-developer-manual*
|
||||
|
@ -39,7 +39,8 @@ man_MANS = \
|
||||
prebuilt/man/taler-helper-auditor-deposits.1\
|
||||
prebuilt/man/taler-helper-auditor-purses.1\
|
||||
prebuilt/man/taler-helper-auditor-reserves.1\
|
||||
prebuilt/man/taler-helper-auditor-wire.1
|
||||
prebuilt/man/taler-helper-auditor-wire.1 \
|
||||
prebuilt/man/taler-unified-setup.1
|
||||
|
||||
info_TEXINFOS = \
|
||||
prebuilt/texinfo/taler-auditor.texi \
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 66e99d09d4351bb6e6c5fd442f14ec7cf1363a81
|
||||
Subproject commit 02380e2e7318c7fd75fcfe7b03d1596b56c8d505
|
1
src/benchmark/.gitignore
vendored
1
src/benchmark/.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
taler-bank-benchmark
|
||||
taler-aggregator-benchmark
|
||||
*.edited
|
||||
|
@ -16,6 +16,12 @@ 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"
|
||||
|
||||
@ -26,6 +32,29 @@ LOOKAHEAD_SIGN="1 d"
|
||||
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/
|
||||
@ -35,9 +64,6 @@ MASTER_KEY=98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
|
||||
CURRENCY = EUR
|
||||
|
||||
|
||||
[exchangedb-postgres]
|
||||
CONFIG="postgres:///talercheck"
|
||||
|
||||
[merchantdb-postgres]
|
||||
CONFIG="postgres:///talercheck"
|
||||
|
||||
@ -47,26 +73,15 @@ CONFIG="postgres:///talercheck"
|
||||
[syncdb-postgres]
|
||||
CONFIG="postgres:///talercheck"
|
||||
|
||||
[exchange-offline]
|
||||
MASTER_PRIV_FILE=${TALER_DATA_HOME}/exchange/offline-keys/master.priv
|
||||
|
||||
[bank]
|
||||
HTTP_PORT=8082
|
||||
SERVE=http
|
||||
MAX_DEBT=EUR:100000000000.0
|
||||
MAX_DEBT_BANK=EUR:1000000000000000.0
|
||||
DATABASE=bank-db.sqlite3
|
||||
|
||||
[libeufin-nexus]
|
||||
DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432"
|
||||
#DB_CONNECTION="jdbc:sqlite:libeufin-nexus.sqlite3"
|
||||
|
||||
[libeufin-sandbox]
|
||||
DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432"
|
||||
#DB_CONNECTION="jdbc:sqlite:libeufin-sandbox.sqlite3"
|
||||
|
||||
[auditor]
|
||||
BASE_URL="http://localhost:8083/"
|
||||
|
||||
[benchmark]
|
||||
USER_PAYTO_URI="payto://x-taler-bank/localhost:8082/42?receiver-name=user42"
|
||||
|
@ -1 +0,0 @@
|
||||
p<EFBFBD>^<5E>-<2D>33<33><33>XX<>!<04>\0q<30><71><EFBFBD><EFBFBD><18>mU<6D>_<EFBFBD><5F>
|
@ -251,7 +251,7 @@ add_refund (const struct Merchant *m,
|
||||
r.details.rtransaction_id = 42;
|
||||
make_amount (0, 5000000, &r.details.refund_amount);
|
||||
make_amount (0, 5, &r.details.refund_fee);
|
||||
if (0 <=
|
||||
if (0 >=
|
||||
plugin->insert_refund (plugin->cls,
|
||||
&r))
|
||||
{
|
||||
@ -307,8 +307,13 @@ add_deposit (const struct Merchant *m)
|
||||
deposit.wire_salt = m->wire_salt;
|
||||
deposit.receiver_wire_account = m->payto_uri;
|
||||
deposit.timestamp = random_time ();
|
||||
do {
|
||||
deposit.refund_deadline = random_time ();
|
||||
deposit.wire_deadline = random_time ();
|
||||
} while (GNUNET_TIME_timestamp_cmp (deposit.wire_deadline,
|
||||
<,
|
||||
deposit.refund_deadline));
|
||||
|
||||
make_amount (1, 0, &deposit.amount_with_fee);
|
||||
make_amount (0, 5, &deposit.deposit_fee);
|
||||
if (0 >=
|
||||
@ -446,6 +451,9 @@ run (void *cls,
|
||||
}
|
||||
GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
|
||||
NULL);
|
||||
memset (&issue,
|
||||
0,
|
||||
sizeof (issue));
|
||||
RANDOMIZE (&issue.signature);
|
||||
issue.start
|
||||
= start;
|
||||
@ -478,6 +486,7 @@ run (void *cls,
|
||||
TALER_DENOMINATION_RSA,
|
||||
1024));
|
||||
alg_values.cipher = TALER_DENOMINATION_RSA;
|
||||
denom_pub.age_mask = issue.age_mask;
|
||||
TALER_denom_pub_hash (&denom_pub,
|
||||
&h_denom_pub);
|
||||
make_amount (2, 0, &issue.value);
|
||||
@ -497,7 +506,6 @@ run (void *cls,
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
TALER_planchet_blinding_secret_create (&ps,
|
||||
&alg_values,
|
||||
&bks);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of TALER
|
||||
(C) 2014-2021 Taler Systems SA
|
||||
(C) 2014-2023 Taler Systems SA
|
||||
|
||||
TALER is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Affero General Public License as
|
||||
@ -39,65 +39,16 @@
|
||||
#include "taler_error_codes.h"
|
||||
|
||||
|
||||
/* Error codes. */
|
||||
enum BenchmarkError
|
||||
{
|
||||
MISSING_BANK_URL,
|
||||
FAILED_TO_LAUNCH_BANK,
|
||||
BAD_CLI_ARG,
|
||||
BAD_CONFIG_FILE,
|
||||
NO_CONFIG_FILE_GIVEN
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* What mode should the benchmark run in?
|
||||
* Credentials to use for the benchmark.
|
||||
*/
|
||||
enum BenchmarkMode
|
||||
{
|
||||
/**
|
||||
* Run as client against the bank.
|
||||
*/
|
||||
MODE_CLIENT = 1,
|
||||
|
||||
/**
|
||||
* Run the bank.
|
||||
*/
|
||||
MODE_BANK = 2,
|
||||
|
||||
/**
|
||||
* Run both, for a local benchmark.
|
||||
*/
|
||||
MODE_BOTH = 3,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Hold information regarding which bank has the exchange account.
|
||||
*/
|
||||
static const struct TALER_EXCHANGEDB_AccountInfo *exchange_bank_account;
|
||||
|
||||
/**
|
||||
* Time snapshot taken right before executing the CMDs.
|
||||
*/
|
||||
static struct GNUNET_TIME_Absolute start_time;
|
||||
|
||||
/**
|
||||
* Benchmark duration time taken right after the CMD interpreter
|
||||
* returns.
|
||||
*/
|
||||
static struct GNUNET_TIME_Relative duration;
|
||||
static struct TALER_TESTING_Credentials cred;
|
||||
|
||||
/**
|
||||
* Array of all the commands the benchmark is running.
|
||||
*/
|
||||
static struct TALER_TESTING_Command *all_commands;
|
||||
|
||||
/**
|
||||
* Dummy keepalive task.
|
||||
*/
|
||||
static struct GNUNET_SCHEDULER_Task *keepalive;
|
||||
|
||||
/**
|
||||
* Name of our configuration file.
|
||||
*/
|
||||
@ -105,27 +56,14 @@ static char *cfg_filename;
|
||||
|
||||
/**
|
||||
* Use the fakebank instead of LibEuFin.
|
||||
* NOTE: LibEuFin not yet supported! Set
|
||||
* to 0 once we do support it!
|
||||
*/
|
||||
static int use_fakebank = 1;
|
||||
|
||||
/**
|
||||
* Number of taler-exchange-wirewatchers to launch.
|
||||
*/
|
||||
static unsigned int start_wirewatch;
|
||||
static int use_fakebank;
|
||||
|
||||
/**
|
||||
* Verbosity level.
|
||||
*/
|
||||
static unsigned int verbose;
|
||||
|
||||
/**
|
||||
* Size of the transaction history the fakebank
|
||||
* should keep in RAM.
|
||||
*/
|
||||
static unsigned long long history_size = 65536;
|
||||
|
||||
/**
|
||||
* How many reserves we want to create per client.
|
||||
*/
|
||||
@ -141,6 +79,11 @@ static unsigned int howmany_clients = 1;
|
||||
*/
|
||||
static unsigned int howmany_threads;
|
||||
|
||||
/**
|
||||
* How many wirewatch processes do we want to create.
|
||||
*/
|
||||
static unsigned int start_wirewatch;
|
||||
|
||||
/**
|
||||
* Log level used during the run.
|
||||
*/
|
||||
@ -151,32 +94,17 @@ static char *loglev;
|
||||
*/
|
||||
static char *logfile;
|
||||
|
||||
/**
|
||||
* Benchmarking mode (run as client, exchange, both) as string.
|
||||
*/
|
||||
static char *mode_str;
|
||||
|
||||
/**
|
||||
* Benchmarking mode (run as client, bank, both).
|
||||
*/
|
||||
static enum BenchmarkMode mode;
|
||||
|
||||
/**
|
||||
* Don't kill exchange/fakebank/wirewatch until
|
||||
* requested by the user explicitly.
|
||||
*/
|
||||
static int linger;
|
||||
|
||||
/**
|
||||
* Do not initialize or reset the database.
|
||||
*/
|
||||
static int incremental;
|
||||
|
||||
/**
|
||||
* Configuration.
|
||||
*/
|
||||
static struct GNUNET_CONFIGURATION_Handle *cfg;
|
||||
|
||||
/**
|
||||
* Section with the configuration data for the exchange
|
||||
* bank account.
|
||||
*/
|
||||
static char *exchange_bank_section;
|
||||
|
||||
/**
|
||||
* Currency used.
|
||||
*/
|
||||
@ -237,10 +165,10 @@ print_stats (void)
|
||||
|
||||
total = GNUNET_strdup (
|
||||
GNUNET_STRINGS_relative_time_to_string (timings[i].total_duration,
|
||||
GNUNET_YES));
|
||||
true));
|
||||
latency = GNUNET_strdup (
|
||||
GNUNET_STRINGS_relative_time_to_string (timings[i].success_latency,
|
||||
GNUNET_YES));
|
||||
true));
|
||||
fprintf (stderr,
|
||||
"%s-%d took %s in total with %s for latency for %u executions (%u repeats)\n",
|
||||
timings[i].prefix,
|
||||
@ -270,38 +198,39 @@ run (void *cls,
|
||||
|
||||
(void) cls;
|
||||
len = howmany_reserves + 2;
|
||||
all_commands = GNUNET_malloc_large (len
|
||||
all_commands = GNUNET_malloc_large ((1 + len)
|
||||
* sizeof (struct TALER_TESTING_Command));
|
||||
GNUNET_assert (NULL != all_commands);
|
||||
all_commands[0]
|
||||
= TALER_TESTING_cmd_get_exchange ("get-exchange",
|
||||
cred.cfg,
|
||||
NULL,
|
||||
true,
|
||||
true);
|
||||
|
||||
GNUNET_asprintf (&total_reserve_amount,
|
||||
"%s:5",
|
||||
currency);
|
||||
for (unsigned int j = 0; j < howmany_reserves; j++)
|
||||
{
|
||||
char *create_reserve_label;
|
||||
char *user_payto_uri;
|
||||
|
||||
// FIXME: vary user accounts more...
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
GNUNET_CONFIGURATION_get_value_string (cfg,
|
||||
"benchmark",
|
||||
"USER_PAYTO_URI",
|
||||
&user_payto_uri));
|
||||
GNUNET_asprintf (&create_reserve_label,
|
||||
"createreserve-%u",
|
||||
j);
|
||||
all_commands[j]
|
||||
// TODO: vary user accounts more...
|
||||
all_commands[1 + j]
|
||||
= TALER_TESTING_cmd_admin_add_incoming_retry (
|
||||
TALER_TESTING_cmd_admin_add_incoming (add_label (
|
||||
create_reserve_label),
|
||||
total_reserve_amount,
|
||||
exchange_bank_account->auth,
|
||||
add_label (user_payto_uri)));
|
||||
&cred.ba,
|
||||
cred.user42_payto));
|
||||
}
|
||||
GNUNET_free (total_reserve_amount);
|
||||
all_commands[howmany_reserves]
|
||||
all_commands[1 + howmany_reserves]
|
||||
= TALER_TESTING_cmd_stat (timings);
|
||||
all_commands[howmany_reserves + 1]
|
||||
all_commands[1 + howmany_reserves + 1]
|
||||
= TALER_TESTING_cmd_end ();
|
||||
TALER_TESTING_run2 (is,
|
||||
all_commands,
|
||||
@ -318,7 +247,6 @@ launch_clients (void)
|
||||
enum GNUNET_GenericReturnValue result = GNUNET_OK;
|
||||
pid_t cpids[howmany_clients];
|
||||
|
||||
start_time = GNUNET_TIME_absolute_get ();
|
||||
if (1 == howmany_clients)
|
||||
{
|
||||
/* do everything in this process */
|
||||
@ -387,78 +315,6 @@ again:
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Stop the fakebank.
|
||||
*
|
||||
* @param cls fakebank handle
|
||||
*/
|
||||
static void
|
||||
stop_fakebank (void *cls)
|
||||
{
|
||||
struct TALER_FAKEBANK_Handle *fakebank = cls;
|
||||
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||
"Stopping fakebank\n");
|
||||
TALER_FAKEBANK_stop (fakebank);
|
||||
GNUNET_SCHEDULER_cancel (keepalive);
|
||||
keepalive = NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Dummy task that is never run.
|
||||
*/
|
||||
static void
|
||||
never_task (void *cls)
|
||||
{
|
||||
(void) cls;
|
||||
GNUNET_assert (0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Start the fakebank.
|
||||
*
|
||||
* @param cls NULL
|
||||
*/
|
||||
static void
|
||||
launch_fakebank (void *cls)
|
||||
{
|
||||
struct TALER_FAKEBANK_Handle *fakebank;
|
||||
unsigned long long pnum;
|
||||
|
||||
(void) cls;
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_CONFIGURATION_get_value_number (cfg,
|
||||
"bank",
|
||||
"HTTP_PORT",
|
||||
&pnum))
|
||||
{
|
||||
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
|
||||
"bank",
|
||||
"HTTP_PORT",
|
||||
"must be valid port number");
|
||||
return;
|
||||
}
|
||||
fakebank
|
||||
= TALER_FAKEBANK_start2 ((uint16_t) pnum,
|
||||
currency,
|
||||
history_size,
|
||||
howmany_threads);
|
||||
if (NULL == fakebank)
|
||||
{
|
||||
GNUNET_break (0);
|
||||
return;
|
||||
}
|
||||
keepalive
|
||||
= GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
|
||||
&never_task,
|
||||
NULL);
|
||||
GNUNET_SCHEDULER_add_shutdown (&stop_fakebank,
|
||||
fakebank);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run the benchmark in parallel in many (client) processes
|
||||
* and summarize result.
|
||||
@ -469,114 +325,11 @@ static enum GNUNET_GenericReturnValue
|
||||
parallel_benchmark (void)
|
||||
{
|
||||
enum GNUNET_GenericReturnValue result = GNUNET_OK;
|
||||
pid_t fakebank = -1;
|
||||
struct GNUNET_OS_Process *bankd = NULL;
|
||||
struct GNUNET_OS_Process *wirewatch[GNUNET_NZL (start_wirewatch)];
|
||||
|
||||
memset (wirewatch,
|
||||
0,
|
||||
sizeof (wirewatch));
|
||||
if ( (MODE_BANK == mode) ||
|
||||
(MODE_BOTH == mode) )
|
||||
{
|
||||
if (use_fakebank)
|
||||
{
|
||||
unsigned long long pnum;
|
||||
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_CONFIGURATION_get_value_number (cfg,
|
||||
"bank",
|
||||
"HTTP_PORT",
|
||||
&pnum))
|
||||
{
|
||||
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
|
||||
"bank",
|
||||
"HTTP_PORT",
|
||||
"must be valid port number");
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
/* start fakebank */
|
||||
fakebank = fork ();
|
||||
if (0 == fakebank)
|
||||
{
|
||||
GNUNET_log_setup ("benchmark-fakebank",
|
||||
NULL == loglev ? "INFO" : loglev,
|
||||
logfile);
|
||||
GNUNET_SCHEDULER_run (&launch_fakebank,
|
||||
NULL);
|
||||
exit (0);
|
||||
}
|
||||
if (-1 == fakebank)
|
||||
{
|
||||
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
|
||||
"fork");
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
/* wait for fakebank to be ready */
|
||||
{
|
||||
char *bank_url;
|
||||
int ret;
|
||||
|
||||
GNUNET_asprintf (&bank_url,
|
||||
"http://localhost:%u/",
|
||||
(unsigned int) (uint16_t) pnum);
|
||||
ret = TALER_TESTING_wait_httpd_ready (bank_url);
|
||||
GNUNET_free (bank_url);
|
||||
if (0 != ret)
|
||||
{
|
||||
int wstatus;
|
||||
|
||||
kill (fakebank,
|
||||
SIGTERM);
|
||||
if (fakebank !=
|
||||
waitpid (fakebank,
|
||||
&wstatus,
|
||||
0))
|
||||
{
|
||||
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
|
||||
"waitpid");
|
||||
}
|
||||
fakebank = -1;
|
||||
exit (ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||
"FIXME #7273: launching LibEuFin not yet supported\n");
|
||||
bankd = NULL; // FIXME #7273
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
|
||||
if (0 == incremental)
|
||||
{
|
||||
struct GNUNET_OS_Process *dbinit;
|
||||
|
||||
dbinit = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL,
|
||||
NULL, NULL, NULL,
|
||||
"taler-exchange-dbinit",
|
||||
"taler-exchange-dbinit",
|
||||
"-c", cfg_filename,
|
||||
"-r",
|
||||
(NULL != loglev) ? "-L" : NULL,
|
||||
loglev,
|
||||
NULL);
|
||||
if (NULL == dbinit)
|
||||
{
|
||||
if (NULL != bankd)
|
||||
{
|
||||
GNUNET_OS_process_kill (bankd,
|
||||
SIGTERM);
|
||||
GNUNET_OS_process_destroy (bankd);
|
||||
bankd = NULL;
|
||||
}
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
GNUNET_break (GNUNET_OK ==
|
||||
GNUNET_OS_process_wait (dbinit));
|
||||
GNUNET_OS_process_destroy (dbinit);
|
||||
}
|
||||
/* start exchange wirewatch */
|
||||
for (unsigned int w = 0; w<start_wirewatch; w++)
|
||||
{
|
||||
@ -602,51 +355,10 @@ parallel_benchmark (void)
|
||||
GNUNET_OS_process_destroy (wirewatch[x]);
|
||||
wirewatch[x] = NULL;
|
||||
}
|
||||
if (-1 != fakebank)
|
||||
{
|
||||
int wstatus;
|
||||
|
||||
kill (fakebank,
|
||||
SIGTERM);
|
||||
if (fakebank !=
|
||||
waitpid (fakebank,
|
||||
&wstatus,
|
||||
0))
|
||||
{
|
||||
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
|
||||
"waitpid");
|
||||
}
|
||||
fakebank = -1;
|
||||
}
|
||||
if (NULL != bankd)
|
||||
{
|
||||
GNUNET_OS_process_kill (bankd,
|
||||
SIGTERM);
|
||||
GNUNET_OS_process_destroy (bankd);
|
||||
bankd = NULL;
|
||||
}
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( (MODE_CLIENT == mode) ||
|
||||
(MODE_BOTH == mode) )
|
||||
result = launch_clients ();
|
||||
if ( (GNUNET_YES == linger) ||
|
||||
(MODE_BANK == mode) )
|
||||
{
|
||||
printf ("Press ENTER to stop!\n");
|
||||
if (MODE_BANK != mode)
|
||||
duration = GNUNET_TIME_absolute_get_duration (start_time);
|
||||
(void) getchar ();
|
||||
if (MODE_BANK == mode)
|
||||
duration = GNUNET_TIME_absolute_get_duration (start_time);
|
||||
}
|
||||
|
||||
if ( (MODE_BANK == mode) ||
|
||||
(MODE_BOTH == mode) )
|
||||
{
|
||||
/* Ensure wirewatch runs to completion! */
|
||||
if (0 != start_wirewatch)
|
||||
{
|
||||
@ -701,46 +413,6 @@ parallel_benchmark (void)
|
||||
wirewatch[0] = NULL;
|
||||
}
|
||||
|
||||
/* Now stop the time, if this was the right mode */
|
||||
if ( (GNUNET_YES != linger) &&
|
||||
(MODE_BANK != mode) )
|
||||
duration = GNUNET_TIME_absolute_get_duration (start_time);
|
||||
|
||||
/* stop fakebank */
|
||||
if (-1 != fakebank)
|
||||
{
|
||||
int wstatus;
|
||||
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||
"Telling fakebank to shut down\n");
|
||||
kill (fakebank,
|
||||
SIGTERM);
|
||||
if (fakebank !=
|
||||
waitpid (fakebank,
|
||||
&wstatus,
|
||||
0))
|
||||
{
|
||||
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
|
||||
"waitpid");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (! WIFEXITED (wstatus)) ||
|
||||
(0 != WEXITSTATUS (wstatus)) )
|
||||
{
|
||||
GNUNET_break (0);
|
||||
result = GNUNET_SYSERR;
|
||||
}
|
||||
}
|
||||
fakebank = -1;
|
||||
}
|
||||
if (NULL != bankd)
|
||||
{
|
||||
GNUNET_OS_process_kill (bankd,
|
||||
SIGTERM);
|
||||
GNUNET_OS_process_destroy (bankd);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -760,32 +432,17 @@ main (int argc,
|
||||
struct GNUNET_GETOPT_CommandLineOption options[] = {
|
||||
GNUNET_GETOPT_option_mandatory (
|
||||
GNUNET_GETOPT_option_cfgfile (&cfg_filename)),
|
||||
#if FIXME_SUPPORT_LIBEUFIN
|
||||
GNUNET_GETOPT_option_flag ('f',
|
||||
"fakebank",
|
||||
"start a fakebank instead of the Python bank",
|
||||
"we are using fakebank",
|
||||
&use_fakebank),
|
||||
#endif
|
||||
GNUNET_GETOPT_option_help ("taler-bank benchmark"),
|
||||
GNUNET_GETOPT_option_flag ('K',
|
||||
"linger",
|
||||
"linger around until key press",
|
||||
&linger),
|
||||
GNUNET_GETOPT_option_flag ('i',
|
||||
"incremental",
|
||||
"skip initializing and resetting the database",
|
||||
&incremental),
|
||||
GNUNET_GETOPT_option_string ('l',
|
||||
"logfile",
|
||||
"LF",
|
||||
"will log to file LF",
|
||||
&logfile),
|
||||
GNUNET_GETOPT_option_loglevel (&loglev),
|
||||
GNUNET_GETOPT_option_string ('m',
|
||||
"mode",
|
||||
"MODE",
|
||||
"run as bank, client or both",
|
||||
&mode_str),
|
||||
GNUNET_GETOPT_option_uint ('p',
|
||||
"worker-parallelism",
|
||||
"NPROCS",
|
||||
@ -801,11 +458,12 @@ main (int argc,
|
||||
"NRESERVES",
|
||||
"How many reserves per client we should create",
|
||||
&howmany_reserves),
|
||||
GNUNET_GETOPT_option_ulong ('s',
|
||||
"size",
|
||||
"HISTORY_SIZE",
|
||||
"Maximum history size kept in memory by the fakebank",
|
||||
&history_size),
|
||||
GNUNET_GETOPT_option_string (
|
||||
'u',
|
||||
"exchange-account-section",
|
||||
"SECTION",
|
||||
"use exchange bank account configuration from the given SECTION",
|
||||
&exchange_bank_section),
|
||||
GNUNET_GETOPT_option_version (PACKAGE_VERSION " " VCS_VERSION),
|
||||
GNUNET_GETOPT_option_verbose (&verbose),
|
||||
GNUNET_GETOPT_option_uint ('w',
|
||||
@ -815,6 +473,7 @@ main (int argc,
|
||||
&start_wirewatch),
|
||||
GNUNET_GETOPT_OPTION_END
|
||||
};
|
||||
struct GNUNET_TIME_Relative duration;
|
||||
|
||||
unsetenv ("XDG_DATA_HOME");
|
||||
unsetenv ("XDG_CONFIG_HOME");
|
||||
@ -827,35 +486,15 @@ main (int argc,
|
||||
GNUNET_free (cfg_filename);
|
||||
if (GNUNET_NO == result)
|
||||
return 0;
|
||||
return BAD_CLI_ARG;
|
||||
return EXIT_INVALIDARGUMENT;
|
||||
}
|
||||
if (NULL == exchange_bank_section)
|
||||
exchange_bank_section = "exchange-account-1";
|
||||
if (NULL == loglev)
|
||||
loglev = "INFO";
|
||||
GNUNET_log_setup ("taler-bank-benchmark",
|
||||
NULL == loglev ? "INFO" : loglev,
|
||||
loglev,
|
||||
logfile);
|
||||
if (history_size < 10)
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||
"History size too small, this can hardly work\n");
|
||||
return BAD_CLI_ARG;
|
||||
}
|
||||
if (NULL == mode_str)
|
||||
mode = MODE_BOTH;
|
||||
else if (0 == strcasecmp (mode_str,
|
||||
"bank"))
|
||||
mode = MODE_BANK;
|
||||
else if (0 == strcasecmp (mode_str,
|
||||
"client"))
|
||||
mode = MODE_CLIENT;
|
||||
else if (0 == strcasecmp (mode_str,
|
||||
"both"))
|
||||
mode = MODE_BOTH;
|
||||
else
|
||||
{
|
||||
TALER_LOG_ERROR ("Unknown mode given: '%s'\n",
|
||||
mode_str);
|
||||
GNUNET_free (cfg_filename);
|
||||
return BAD_CONFIG_FILE;
|
||||
}
|
||||
if (NULL == cfg_filename)
|
||||
cfg_filename = GNUNET_CONFIGURATION_default_filename ();
|
||||
if (NULL == cfg_filename)
|
||||
@ -871,7 +510,7 @@ main (int argc,
|
||||
{
|
||||
TALER_LOG_ERROR ("Could not parse configuration\n");
|
||||
GNUNET_free (cfg_filename);
|
||||
return BAD_CONFIG_FILE;
|
||||
return EXIT_NOTCONFIGURED;
|
||||
}
|
||||
if (GNUNET_OK !=
|
||||
TALER_config_get_currency (cfg,
|
||||
@ -879,52 +518,30 @@ main (int argc,
|
||||
{
|
||||
GNUNET_CONFIGURATION_destroy (cfg);
|
||||
GNUNET_free (cfg_filename);
|
||||
return BAD_CONFIG_FILE;
|
||||
}
|
||||
if (MODE_BANK != mode)
|
||||
{
|
||||
if (howmany_clients > 10240)
|
||||
{
|
||||
TALER_LOG_ERROR ("-p option value given is too large\n");
|
||||
return BAD_CLI_ARG;
|
||||
}
|
||||
if (0 == howmany_clients)
|
||||
{
|
||||
TALER_LOG_ERROR ("-p option value must not be zero\n");
|
||||
GNUNET_free (cfg_filename);
|
||||
return BAD_CLI_ARG;
|
||||
}
|
||||
return EXIT_NOTCONFIGURED;
|
||||
}
|
||||
|
||||
if (GNUNET_OK !=
|
||||
TALER_EXCHANGEDB_load_accounts (cfg,
|
||||
TALER_EXCHANGEDB_ALO_AUTHDATA
|
||||
| TALER_EXCHANGEDB_ALO_CREDIT))
|
||||
TALER_TESTING_get_credentials (
|
||||
cfg_filename,
|
||||
exchange_bank_section,
|
||||
use_fakebank
|
||||
? TALER_TESTING_BS_FAKEBANK
|
||||
: TALER_TESTING_BS_IBAN,
|
||||
&cred))
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||
"Configuration fails to provide exchange bank details\n");
|
||||
"Required bank credentials not given in configuration\n");
|
||||
GNUNET_free (cfg_filename);
|
||||
return BAD_CONFIG_FILE;
|
||||
return EXIT_NOTCONFIGURED;
|
||||
}
|
||||
|
||||
exchange_bank_account
|
||||
= TALER_EXCHANGEDB_find_account_by_method ("x-taler-bank");
|
||||
if (NULL == exchange_bank_account)
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||
"No bank account for `x-taler-bank` given in configuration\n");
|
||||
GNUNET_free (cfg_filename);
|
||||
return BAD_CONFIG_FILE;
|
||||
}
|
||||
struct GNUNET_TIME_Absolute start_time;
|
||||
|
||||
start_time = GNUNET_TIME_absolute_get ();
|
||||
result = parallel_benchmark ();
|
||||
TALER_EXCHANGEDB_unload_accounts ();
|
||||
GNUNET_CONFIGURATION_destroy (cfg);
|
||||
GNUNET_free (cfg_filename);
|
||||
|
||||
if (MODE_BANK == mode)
|
||||
{
|
||||
/* If we're the bank, we're done now. No need to print results. */
|
||||
return (GNUNET_OK == result) ? 0 : result;
|
||||
duration = GNUNET_TIME_absolute_get_duration (start_time);
|
||||
}
|
||||
|
||||
if (GNUNET_OK == result)
|
||||
@ -952,7 +569,7 @@ main (int argc,
|
||||
tps);
|
||||
}
|
||||
fprintf (stdout,
|
||||
"CPU time: sys %llu user %llu\n", \
|
||||
"CPU time: sys %llu user %llu\n",
|
||||
(unsigned long long) (usage.ru_stime.tv_sec * 1000 * 1000
|
||||
+ usage.ru_stime.tv_usec),
|
||||
(unsigned long long) (usage.ru_utime.tv_sec * 1000 * 1000
|
||||
@ -963,5 +580,7 @@ main (int argc,
|
||||
GNUNET_array_grow (labels,
|
||||
label_len,
|
||||
0);
|
||||
GNUNET_CONFIGURATION_destroy (cfg);
|
||||
GNUNET_free (cfg_filename);
|
||||
return (GNUNET_OK == result) ? 0 : result;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ static int use_fakebank;
|
||||
* Section with the configuration data for the exchange
|
||||
* bank account.
|
||||
*/
|
||||
static char *exchange_bank_section = "exchange-account-1";
|
||||
static char *exchange_bank_section;
|
||||
|
||||
/**
|
||||
* Currency used.
|
||||
@ -210,12 +210,20 @@ run (void *cls,
|
||||
char *amount_1;
|
||||
|
||||
(void) cls;
|
||||
all_commands = GNUNET_new_array (
|
||||
howmany_reserves * (1 /* Withdraw block */
|
||||
all_commands = GNUNET_malloc_large (
|
||||
(1 /* exchange CMD */
|
||||
+ howmany_reserves
|
||||
* (1 /* Withdraw block */
|
||||
+ howmany_coins) /* All units */
|
||||
+ 1 /* stat CMD */
|
||||
+ 1 /* End CMD */,
|
||||
struct TALER_TESTING_Command);
|
||||
+ 1 /* End CMD */) * sizeof (struct TALER_TESTING_Command));
|
||||
GNUNET_assert (NULL != all_commands);
|
||||
all_commands[0]
|
||||
= TALER_TESTING_cmd_get_exchange ("get-exchange",
|
||||
cred.cfg,
|
||||
NULL,
|
||||
true,
|
||||
true);
|
||||
GNUNET_asprintf (&amount_5, "%s:5", currency);
|
||||
GNUNET_asprintf (&amount_4, "%s:4", currency);
|
||||
GNUNET_asprintf (&amount_1, "%s:1", currency);
|
||||
@ -252,9 +260,9 @@ run (void *cls,
|
||||
GNUNET_asprintf (&batch_label,
|
||||
"batch-start-%u",
|
||||
j);
|
||||
all_commands[reserves_first
|
||||
all_commands[1 + (reserves_first
|
||||
? j
|
||||
: j * (howmany_coins + 1)]
|
||||
: j * (howmany_coins + 1))]
|
||||
= TALER_TESTING_cmd_batch (add_label (batch_label),
|
||||
make_reserve);
|
||||
}
|
||||
@ -334,16 +342,16 @@ run (void *cls,
|
||||
"unit-%u-%u",
|
||||
i,
|
||||
j);
|
||||
all_commands[reserves_first
|
||||
all_commands[1 + (reserves_first
|
||||
? howmany_reserves + j * howmany_coins + i
|
||||
: j * (howmany_coins + 1) + (1 + i)]
|
||||
: j * (howmany_coins + 1) + (1 + i))]
|
||||
= TALER_TESTING_cmd_batch (add_label (unit_label),
|
||||
unit);
|
||||
}
|
||||
}
|
||||
all_commands[howmany_reserves * (1 + howmany_coins)]
|
||||
all_commands[1 + howmany_reserves * (1 + howmany_coins)]
|
||||
= TALER_TESTING_cmd_stat (timings);
|
||||
all_commands[howmany_reserves * (1 + howmany_coins) + 1]
|
||||
all_commands[1 + howmany_reserves * (1 + howmany_coins) + 1]
|
||||
= TALER_TESTING_cmd_end ();
|
||||
TALER_TESTING_run2 (is,
|
||||
all_commands,
|
||||
@ -417,7 +425,7 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
|
||||
{
|
||||
/* I am the child, do the work! */
|
||||
GNUNET_log_setup ("benchmark-worker",
|
||||
NULL == loglev ? "INFO" : loglev,
|
||||
loglev,
|
||||
logfile);
|
||||
result = TALER_TESTING_loop (main_cb,
|
||||
main_cb_cls);
|
||||
@ -556,10 +564,12 @@ main (int argc,
|
||||
return 0;
|
||||
return EXIT_INVALIDARGUMENT;
|
||||
}
|
||||
if (NULL == exchange_bank_section)
|
||||
exchange_bank_section = "exchange-account-1";
|
||||
if (NULL == loglev)
|
||||
loglev = "INFO";
|
||||
GNUNET_log_setup ("taler-exchange-benchmark",
|
||||
NULL == loglev
|
||||
? "INFO"
|
||||
: loglev,
|
||||
loglev,
|
||||
logfile);
|
||||
if (NULL == cfg_filename)
|
||||
cfg_filename = GNUNET_CONFIGURATION_default_filename ();
|
||||
|
@ -849,6 +849,9 @@ build_wire_state (void)
|
||||
wire_method = TALER_payto_get_method (payto_uri);
|
||||
if (NULL == wire_method)
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||
"No wire method in `%s'\n",
|
||||
payto_uri);
|
||||
wsh->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR;
|
||||
wsh->wire_reply
|
||||
= TALER_MHD_make_error (
|
||||
@ -888,26 +891,21 @@ build_wire_state (void)
|
||||
GNUNET_CRYPTO_hash_context_abort (hc);
|
||||
return wsh;
|
||||
}
|
||||
if (0 == json_array_size (ac.a))
|
||||
if (0 != json_array_size (ac.a))
|
||||
{
|
||||
json_decref (ac.a);
|
||||
json_decref (wire_accounts_array);
|
||||
json_decref (wire_fee_object);
|
||||
wsh->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR;
|
||||
wsh->wire_reply
|
||||
= TALER_MHD_make_error (TALER_EC_EXCHANGE_WIRE_FEES_NOT_CONFIGURED,
|
||||
wire_method);
|
||||
GNUNET_free (wire_method);
|
||||
GNUNET_CRYPTO_hash_context_abort (hc);
|
||||
return wsh;
|
||||
}
|
||||
wsh->cache_expiration = GNUNET_TIME_absolute_min (ac.max_seen,
|
||||
wsh->cache_expiration
|
||||
= GNUNET_TIME_absolute_min (ac.max_seen,
|
||||
wsh->cache_expiration);
|
||||
GNUNET_assert (0 ==
|
||||
json_object_set_new (wire_fee_object,
|
||||
wire_method,
|
||||
ac.a));
|
||||
}
|
||||
else
|
||||
{
|
||||
json_decref (ac.a);
|
||||
}
|
||||
}
|
||||
GNUNET_free (wire_method);
|
||||
}
|
||||
}
|
||||
@ -2438,6 +2436,11 @@ create_krd (struct TEH_KeyStateHandle *ksh,
|
||||
json_t *keys;
|
||||
|
||||
wsh = get_wire_state ();
|
||||
if (MHD_HTTP_OK != wsh->http_status)
|
||||
{
|
||||
GNUNET_break (0);
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
GNUNET_assert (! GNUNET_TIME_absolute_is_zero (
|
||||
last_cherry_pick_date.abs_time));
|
||||
GNUNET_assert (NULL != signkeys);
|
||||
|
@ -296,7 +296,7 @@ add_account_cb (void *cls,
|
||||
if (! in_ai->credit_enabled)
|
||||
return; /* not enabled for us, skip */
|
||||
if ( (NULL != account_section) &&
|
||||
(0 != strcasecmp (ai->section_name,
|
||||
(0 != strcasecmp (in_ai->section_name,
|
||||
account_section)) )
|
||||
return; /* not enabled for us, skip */
|
||||
if (NULL != ai)
|
||||
|
@ -97,8 +97,6 @@ TEH_PG_insert_deposit (void *cls,
|
||||
" FROM known_coins"
|
||||
" WHERE coin_pub=$1"
|
||||
" ON CONFLICT DO NOTHING;");
|
||||
|
||||
|
||||
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||
"insert_deposit",
|
||||
params);
|
||||
|
@ -45,16 +45,15 @@ TEH_PG_insert_refund (void *cls,
|
||||
TALER_amount_cmp_currency (&refund->details.refund_amount,
|
||||
&refund->details.refund_fee));
|
||||
|
||||
/* Used in #postgres_insert_refund() to store refund information */
|
||||
PREPARE (pg,
|
||||
"insert_refund",
|
||||
"INSERT INTO refunds "
|
||||
"(coin_pub "
|
||||
"(coin_pub"
|
||||
",deposit_serial_id"
|
||||
",merchant_sig "
|
||||
",rtransaction_id "
|
||||
",amount_with_fee_val "
|
||||
",amount_with_fee_frac "
|
||||
",merchant_sig"
|
||||
",rtransaction_id"
|
||||
",amount_with_fee_val"
|
||||
",amount_with_fee_frac"
|
||||
") SELECT $1, deposit_serial_id, $3, $5, $6, $7"
|
||||
" FROM deposits"
|
||||
" WHERE coin_pub=$1"
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "pg_helper.h"
|
||||
#include "pg_get_wire_fee.h"
|
||||
|
||||
|
||||
enum GNUNET_DB_QueryStatus
|
||||
TEH_PG_insert_wire_fee (void *cls,
|
||||
const char *type,
|
||||
|
@ -2882,7 +2882,7 @@ typedef void
|
||||
* Used internally by the `struct TALER_EXCHANGE_BatchWithdrawHandle`
|
||||
* implementation as well as for the reward logic of merchants.
|
||||
*/
|
||||
struct TALER_EXCHANGE_BatchWithdraw2Handle;
|
||||
struct TALER_EXCHANGE_AgeWithdrawBlindedHandle;
|
||||
|
||||
/**
|
||||
* Withdraw age-restricted coins from the exchange using a
|
||||
|
@ -2668,7 +2668,7 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits,
|
||||
op (order_id, const char) \
|
||||
op (amount, const struct TALER_Amount) \
|
||||
op (amount_with_fee, const struct TALER_Amount) \
|
||||
op (batch_cmds, struct TALER_TESTING_Command *) \
|
||||
op (batch_cmds, struct TALER_TESTING_Command) \
|
||||
op (uuid, const struct GNUNET_Uuid) \
|
||||
op (fresh_coins, const struct TALER_TESTING_FreshCoinData *) \
|
||||
op (claim_token, const struct TALER_ClaimTokenP) \
|
||||
|
@ -74,7 +74,7 @@ LOGLEVEL="DEBUG"
|
||||
DEFAULT_SLEEP="0.2"
|
||||
|
||||
# Parse command-line options
|
||||
while getopts ':abc:d:efghl:mnr:stu:vwW' OPTION; do
|
||||
while getopts ':abc:d:efghL:mnr:stu:vwW' OPTION; do
|
||||
case "$OPTION" in
|
||||
a)
|
||||
START_AUDITOR="1"
|
||||
@ -102,8 +102,9 @@ while getopts ':abc:d:efghl:mnr:stu:vwW' OPTION; do
|
||||
echo ' -d $METHOD -- use wire method (default: x-taler-bank)'
|
||||
echo ' -e -- start exchange'
|
||||
echo ' -f -- start fakebank'
|
||||
echo ' -g -- start aggregator'
|
||||
echo ' -h -- print this help'
|
||||
echo ' -l $LOGLEVEL -- set log level'
|
||||
echo ' -L $LOGLEVEL -- set log level'
|
||||
echo ' -m -- start merchant'
|
||||
echo ' -n -- start nexus'
|
||||
echo ' -r $MEX -- which exchange to use at the merchant (optional)'
|
||||
@ -117,7 +118,7 @@ while getopts ':abc:d:efghl:mnr:stu:vwW' OPTION; do
|
||||
g)
|
||||
START_AGGREGATOR="1"
|
||||
;;
|
||||
l)
|
||||
L)
|
||||
LOGLEVEL="$OPTARG"
|
||||
;;
|
||||
m)
|
||||
@ -249,7 +250,11 @@ then
|
||||
|
||||
# Create the default demobank.
|
||||
echo -n "Configuring sandbox "
|
||||
libeufin-sandbox config --currency "$CURRENCY" default &> libeufin-sandbox-config.log
|
||||
libeufin-sandbox config \
|
||||
--currency "$CURRENCY" \
|
||||
--users-debt-limit 99999999 \
|
||||
--bank-debt-limit 99999999 \
|
||||
default &> libeufin-sandbox-config.log
|
||||
echo "DONE"
|
||||
echo -n "Launching sandbox ... "
|
||||
export LIBEUFIN_SANDBOX_ADMIN_PASSWORD="secret"
|
||||
@ -456,7 +461,11 @@ fi
|
||||
if [ "1" = "$START_WIREWATCH" ]
|
||||
then
|
||||
echo -n "Starting wirewatch ..."
|
||||
$USE_VALGRIND taler-exchange-wirewatch -c "$CONF" 2> taler-exchange-wirewatch.log &
|
||||
$USE_VALGRIND taler-exchange-wirewatch \
|
||||
--account="$USE_ACCOUNT" \
|
||||
-c "$CONF" \
|
||||
--longpoll-timeout="1 s" \
|
||||
2> taler-exchange-wirewatch.log &
|
||||
WIREWATCH_PID=$!
|
||||
echo " DONE"
|
||||
fi
|
||||
|
@ -28,21 +28,21 @@ PORT = 8081
|
||||
MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
|
||||
DB = postgres
|
||||
BASE_URL = "http://localhost:8081/"
|
||||
EXPIRE_SHARD_SIZE = 300 ms
|
||||
EXPIRE_IDLE_SLEEP_INTERVAL = 1 s
|
||||
EXPIRE_SHARD_SIZE ="300 ms"
|
||||
EXPIRE_IDLE_SLEEP_INTERVAL ="1 s"
|
||||
|
||||
[exchangedb-postgres]
|
||||
CONFIG = "postgres:///talercheck"
|
||||
|
||||
[taler-exchange-secmod-cs]
|
||||
LOOKAHEAD_SIGN = 24 days
|
||||
LOOKAHEAD_SIGN = "24 days"
|
||||
|
||||
[taler-exchange-secmod-rsa]
|
||||
LOOKAHEAD_SIGN = 24 days
|
||||
LOOKAHEAD_SIGN = "24 days"
|
||||
|
||||
[taler-exchange-secmod-eddsa]
|
||||
LOOKAHEAD_SIGN = 24 days
|
||||
DURATION = 14 days
|
||||
LOOKAHEAD_SIGN = "24 days"
|
||||
DURATION = "14 days"
|
||||
|
||||
|
||||
[exchange-account-1]
|
||||
@ -51,6 +51,7 @@ ENABLE_DEBIT = YES
|
||||
ENABLE_CREDIT = YES
|
||||
|
||||
[exchange-accountcredentials-1]
|
||||
WIRE_GATEWAY_AUTH_METHOD = none
|
||||
WIRE_GATEWAY_URL = "http://localhost:8082/42/"
|
||||
|
||||
[exchange-account-2]
|
||||
|
@ -225,8 +225,9 @@ confirmation_cb (void *cls,
|
||||
}
|
||||
if (air->http_status != fts->expected_http_status)
|
||||
{
|
||||
GNUNET_break (0);
|
||||
TALER_TESTING_interpreter_fail (is);
|
||||
TALER_TESTING_unexpected_status (is,
|
||||
air->http_status,
|
||||
fts->expected_http_status);
|
||||
return;
|
||||
}
|
||||
switch (air->http_status)
|
||||
|
@ -128,7 +128,7 @@ batch_traits (void *cls,
|
||||
{
|
||||
struct BatchState *bs = cls;
|
||||
struct TALER_TESTING_Trait traits[] = {
|
||||
TALER_TESTING_make_trait_batch_cmds (&bs->batch),
|
||||
TALER_TESTING_make_trait_batch_cmds (bs->batch),
|
||||
TALER_TESTING_trait_end ()
|
||||
};
|
||||
|
||||
|
@ -131,7 +131,7 @@ analyze_command (void *cls,
|
||||
if (TALER_TESTING_cmd_is_batch (cmd))
|
||||
{
|
||||
struct TALER_TESTING_Command *cur;
|
||||
struct TALER_TESTING_Command **bcmd;
|
||||
struct TALER_TESTING_Command *bcmd;
|
||||
|
||||
cur = TALER_TESTING_cmd_batch_get_current (cmd);
|
||||
if (GNUNET_OK !=
|
||||
@ -142,9 +142,9 @@ analyze_command (void *cls,
|
||||
ac->failure = true;
|
||||
return;
|
||||
}
|
||||
for (unsigned int i = 0; NULL != (*bcmd)[i].label; i++)
|
||||
for (unsigned int i = 0; NULL != bcmd[i].label; i++)
|
||||
{
|
||||
struct TALER_TESTING_Command *step = &(*bcmd)[i];
|
||||
struct TALER_TESTING_Command *step = &bcmd[i];
|
||||
|
||||
analyze_command (ac,
|
||||
step);
|
||||
|
@ -122,7 +122,7 @@ analyze_command (void *cls,
|
||||
if (TALER_TESTING_cmd_is_batch (cmd))
|
||||
{
|
||||
struct TALER_TESTING_Command *cur;
|
||||
struct TALER_TESTING_Command **bcmd;
|
||||
struct TALER_TESTING_Command *bcmd;
|
||||
|
||||
cur = TALER_TESTING_cmd_batch_get_current (cmd);
|
||||
if (GNUNET_OK !=
|
||||
@ -133,9 +133,9 @@ analyze_command (void *cls,
|
||||
ac->failure = true;
|
||||
return;
|
||||
}
|
||||
for (unsigned int i = 0; NULL != (*bcmd)[i].label; i++)
|
||||
for (unsigned int i = 0; NULL != bcmd[i].label; i++)
|
||||
{
|
||||
struct TALER_TESTING_Command *step = &(*bcmd)[i];
|
||||
struct TALER_TESTING_Command *step = &bcmd[i];
|
||||
|
||||
if (step == cur)
|
||||
break; /* if *we* are in a batch, make sure not to analyze commands past 'now' */
|
||||
|
@ -27,6 +27,19 @@
|
||||
#include "taler_testing_lib.h"
|
||||
|
||||
|
||||
/**
|
||||
* Run a "stat" CMD.
|
||||
*
|
||||
* @param cls closure.
|
||||
* @param cmd the command being run.
|
||||
* @param is the interpreter state.
|
||||
*/
|
||||
static void
|
||||
stat_run (void *cls,
|
||||
const struct TALER_TESTING_Command *cmd,
|
||||
struct TALER_TESTING_Interpreter *is);
|
||||
|
||||
|
||||
/**
|
||||
* Add the time @a cmd took to the respective duration in @a timings.
|
||||
*
|
||||
@ -40,9 +53,20 @@ stat_cmd (struct TALER_TESTING_Timer *timings,
|
||||
struct GNUNET_TIME_Relative duration;
|
||||
struct GNUNET_TIME_Relative lat;
|
||||
|
||||
if (cmd->start_time.abs_value_us > cmd->finish_time.abs_value_us)
|
||||
if (GNUNET_TIME_absolute_cmp (cmd->start_time,
|
||||
>,
|
||||
cmd->finish_time))
|
||||
{
|
||||
/* This is a problem, except of course for
|
||||
this command itself, as we clearly did not yet
|
||||
finish... */
|
||||
if (cmd->run != &stat_run)
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||
"Bad timings for `%s'\n",
|
||||
cmd->label);
|
||||
GNUNET_break (0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
duration = GNUNET_TIME_absolute_get_difference (cmd->start_time,
|
||||
@ -85,7 +109,7 @@ do_stat (void *cls,
|
||||
|
||||
if (TALER_TESTING_cmd_is_batch (cmd))
|
||||
{
|
||||
struct TALER_TESTING_Command **bcmd;
|
||||
struct TALER_TESTING_Command *bcmd;
|
||||
|
||||
if (GNUNET_OK !=
|
||||
TALER_TESTING_get_trait_batch_cmds (cmd,
|
||||
@ -94,18 +118,15 @@ do_stat (void *cls,
|
||||
GNUNET_break (0);
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned int j = 0;
|
||||
NULL != (*bcmd)[j].label;
|
||||
NULL != bcmd[j].label;
|
||||
j++)
|
||||
do_stat (timings,
|
||||
&(*bcmd)[j]);
|
||||
&bcmd[j]);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
stat_cmd (timings,
|
||||
cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +157,7 @@ TALER_TESTING_cmd_stat (struct TALER_TESTING_Timer *timers)
|
||||
{
|
||||
struct TALER_TESTING_Command cmd = {
|
||||
.label = "stat",
|
||||
.run = stat_run,
|
||||
.run = &stat_run,
|
||||
.cls = (void *) timers
|
||||
};
|
||||
|
||||
@ -144,4 +165,4 @@ TALER_TESTING_cmd_stat (struct TALER_TESTING_Timer *timers)
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_sleep.c */
|
||||
/* end of testing_api_cmd_stat.c */
|
||||
|
@ -349,6 +349,7 @@ withdraw_run (void *cls,
|
||||
const struct TALER_TESTING_Command *create_reserve;
|
||||
const struct TALER_EXCHANGE_DenomPublicKey *dpk;
|
||||
|
||||
if (NULL != cmd)
|
||||
ws->cmd = cmd;
|
||||
ws->is = is;
|
||||
create_reserve
|
||||
|
@ -107,7 +107,7 @@ TALER_TESTING_interpreter_lookup_command (struct TALER_TESTING_Interpreter *is,
|
||||
|
||||
if (TALER_TESTING_cmd_is_batch (cmd))
|
||||
{
|
||||
struct TALER_TESTING_Command **batch;
|
||||
struct TALER_TESTING_Command *batch;
|
||||
struct TALER_TESTING_Command *current;
|
||||
struct TALER_TESTING_Command *icmd;
|
||||
const struct TALER_TESTING_Command *match;
|
||||
@ -119,7 +119,7 @@ TALER_TESTING_interpreter_lookup_command (struct TALER_TESTING_Interpreter *is,
|
||||
/* We must do the loop forward, but we can find the last match */
|
||||
match = NULL;
|
||||
for (unsigned int j = 0;
|
||||
NULL != (icmd = &(*batch)[j])->label;
|
||||
NULL != (icmd = &batch[j])->label;
|
||||
j++)
|
||||
{
|
||||
if (current == icmd)
|
||||
@ -205,8 +205,9 @@ TALER_TESTING_interpreter_next (struct TALER_TESTING_Interpreter *is)
|
||||
if (TALER_TESTING_cmd_batch_next (is,
|
||||
cmd->cls))
|
||||
{
|
||||
/* batch is done */
|
||||
cmd->finish_time = GNUNET_TIME_absolute_get ();
|
||||
is->ip++; /* batch is done */
|
||||
is->ip++;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -221,7 +222,7 @@ TALER_TESTING_interpreter_next (struct TALER_TESTING_Interpreter *is)
|
||||
"Interpreter executed 1000 instructions in %s\n",
|
||||
GNUNET_STRINGS_relative_time_to_string (
|
||||
GNUNET_TIME_absolute_get_duration (last_report),
|
||||
GNUNET_YES));
|
||||
true));
|
||||
last_report = GNUNET_TIME_absolute_get ();
|
||||
}
|
||||
ipc++;
|
||||
@ -733,7 +734,7 @@ seek_batch (struct TALER_TESTING_Interpreter *is,
|
||||
const struct TALER_TESTING_Command *target)
|
||||
{
|
||||
unsigned int new_ip;
|
||||
struct TALER_TESTING_Command **batch;
|
||||
struct TALER_TESTING_Command *batch;
|
||||
struct TALER_TESTING_Command *current;
|
||||
struct TALER_TESTING_Command *icmd;
|
||||
struct TALER_TESTING_Command *match;
|
||||
@ -744,7 +745,7 @@ seek_batch (struct TALER_TESTING_Interpreter *is,
|
||||
&batch));
|
||||
match = NULL;
|
||||
for (new_ip = 0;
|
||||
NULL != (icmd = &(*batch)[new_ip]);
|
||||
NULL != (icmd = &batch[new_ip]);
|
||||
new_ip++)
|
||||
{
|
||||
if (current == target)
|
||||
|
Loading…
Reference in New Issue
Block a user