gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated (2a0a13a -> 9d79c8c)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (2a0a13a -> 9d79c8c)
Date: Wed, 13 Dec 2017 21:52:12 +0100

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

grothoff pushed a change to branch master
in repository merchant.

    from 2a0a13a  simplified tipping
     new a6a6868  towards using new AAI in generate-payments
     new 9d79c8c  adaptations to taler-merchant-generate-payments to use 
(fakebank) admin/add/incoming instead of exchange; not quite there yet. Also 
fixes #5174

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/merchant-tools/Makefile.am                     |   1 +
 .../taler-merchant-generate-payments.c             | 422 ++++++++++++++-------
 2 files changed, 281 insertions(+), 142 deletions(-)

diff --git a/src/merchant-tools/Makefile.am b/src/merchant-tools/Makefile.am
index df271a2..7811d04 100644
--- a/src/merchant-tools/Makefile.am
+++ b/src/merchant-tools/Makefile.am
@@ -33,6 +33,7 @@ taler_merchant_generate_payments_LDADD = \
   $(top_srcdir)/src/backenddb/libtalermerchantdb.la \
   $(top_srcdir)/src/lib/libtalermerchant.la \
   $(LIBGCRYPT_LIBS) \
+  -ltalerbank \
   -ltalerfakebank \
   -ltalerexchange \
   -ltalerjson \
diff --git a/src/merchant-tools/taler-merchant-generate-payments.c 
b/src/merchant-tools/taler-merchant-generate-payments.c
index 3e19943..66b011f 100644
--- a/src/merchant-tools/taler-merchant-generate-payments.c
+++ b/src/merchant-tools/taler-merchant-generate-payments.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2014, 2015, 2016 GNUnet e.V. and INRIA
+  Copyright (C) 2014-2017 Taler Systems SA
 
   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU Lesser General Public License as published by the Free 
Software
@@ -13,9 +13,18 @@
   You should have received a copy of the GNU Lesser General Public License 
along with
   TALER; see the file COPYING.LGPL.  If not, see <http://www.gnu.org/licenses/>
 */
-
+/**
+ * @file taler-merchant-generate-payments.c
+ * @brief tool to use (or test) the taler backend by running some transactions
+ * @author Christian Grothoff
+ * @author Marcello Stanisci
+ *
+ * TODO:
+ * - trigger wirewatch after /admin/add/incoming!
+ */ 
 #include "platform.h"
 #include <taler/taler_exchange_service.h>
+#include <taler/taler_bank_service.h>
 #include <taler/taler_fakebank_lib.h>
 #include <taler/taler_json_lib.h>
 #include <taler/taler_util.h>
@@ -27,6 +36,11 @@
 #include <microhttpd.h>
 
 /**
+ * Number of the account the exchange has at the bank.
+ */
+#define EXCHANGE_ACCOUNT_NO 2
+
+/**
  * The exchange process launched by the generator
  */
 static struct GNUNET_OS_Process *exchanged;
@@ -50,6 +64,12 @@ static unsigned int j = 0;
  * Indicates whether we use an external exchange.
  * By default, the generator forks a local exchange.
  */
+static int remote_bank = 0;
+
+/**
+ * Indicates whether we use an external exchange.
+ * By default, the generator forks a local exchange.
+ */
 static int remote_exchange = 0;
 
 /**
@@ -60,25 +80,25 @@ static int remote_exchange = 0;
 static int remote_merchant = 0;
 
 /**
- * Exchange URI to withdraw from and deposit to.
+ * Exchange URL to withdraw from and deposit to.
  */
-static char *exchange_uri;
+static char *exchange_url;
 
 /**
  * Base URL of exchange's admin interface.
  */
-static char *exchange_uri_admin;
+static char *exchange_url_admin;
 
 /**
  * Merchant backend to get proposals from and pay.
  */
-static char *merchant_uri;
+static char *merchant_url;
 
 /**
- * Customer's bank URI, communicated at withdrawal time
+ * Customer's bank URL, communicated at withdrawal time
  * to the exchange; must be the same as the exchange's bank.
  */
-static char *bank_uri;
+static char *bank_url;
 
 /**
  * Which merchant instance we use.
@@ -91,6 +111,11 @@ static char *instance;
 static char *currency;
 
 /**
+ * Handle to our fakebank.
+ */
+static struct TALER_FAKEBANK_Handle *fakebank;
+
+/**
  * Task run on timeout.
  */
 static struct GNUNET_SCHEDULER_Task *timeout_task;
@@ -121,6 +146,12 @@ static int result;
 static struct GNUNET_DISK_PipeHandle *sigpipe;
 
 /**
+ * Name of the configuration file we are using.
+ */
+static char *cfgfilename;
+
+
+/**
  * State of the interpreter loop.
  */
 struct InterpreterState
@@ -169,6 +200,11 @@ enum OpCode
   OC_ADMIN_ADD_INCOMING,
 
   /**
+   * Run the wirewatcher to check for incoming transactions.
+   */
+  OC_RUN_WIREWATCH,
+
+  /**
    * Check status of a reserve.
    */
   OC_WITHDRAW_STATUS,
@@ -281,14 +317,14 @@ struct Command
       char *amount;
 
       /**
-       * Sender's bank account details (JSON).
+       * Sender's bank account number.
        */
-      const char *sender_details;
+      uint64_t debit_account_no;
 
       /**
-       * Transfer details (JSON)
+       * Receiver's bank account number.
        */
-       const char *transfer_details;
+      uint64_t credit_account_no;
 
       /**
        * Set (by the interpreter) to the reserve's private key
@@ -299,10 +335,29 @@ struct Command
       /**
        * Set to the API's handle during the operation.
        */
-      struct TALER_EXCHANGE_AdminAddIncomingHandle *aih;
+      struct TALER_BANK_AdminAddIncomingHandle *aih;
 
+      /**
+       * Set to bank's identifier for the wire transfer.
+       */
+      uint64_t serial_id;
+      
     } admin_add_incoming;
 
+    struct {
+
+      /**
+       * Process for the wirewatcher.
+       */
+      struct GNUNET_OS_Process *wirewatch_proc;
+
+      /**
+       * ID of task called whenever we get a SIGCHILD.
+       */
+      struct GNUNET_SCHEDULER_Task *child_death_task;
+
+    } run_wirewatch;
+
     /**
      * Information for an #OC_PROPOSAL command.
      */
@@ -593,24 +648,28 @@ pay_cb (void *cls,
  * @param http_status HTTP response code, #MHD_HTTP_OK (200) for successful 
status request
  *                    0 if the exchange's reply is bogus (fails to follow the 
protocol)
  * @param ec taler-specific error code, #TALER_EC_NONE on success
+ * @param serial_id unique ID of for the transfer at the bank
  * @param full_response full response from the exchange (for logging, in case 
of errors)
  */
 static void
 add_incoming_cb (void *cls,
                  unsigned int http_status,
                 enum TALER_ErrorCode ec,
+                uint64_t serial_id,
                  const json_t *full_response)
 {
   struct InterpreterState *is = cls;
   struct Command *cmd = &is->commands[is->ip];
 
   cmd->details.admin_add_incoming.aih = NULL;
+  cmd->details.admin_add_incoming.serial_id = serial_id;
   if (MHD_HTTP_OK != http_status)
   {
     GNUNET_break (0);
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "%s",
-                json_dumps (full_response, JSON_INDENT (2)));
+                json_dumps (full_response,
+                           JSON_INDENT (2)));
     fail (is);
     return;
   }
@@ -823,7 +882,7 @@ make_order (const char *maxfee,
 
 
 /**
- * Free amount stringsin interpreter state.
+ * Free amount strings in interpreter state.
  *
  * @param is state to reset
  */
@@ -852,6 +911,8 @@ free_interpreter_amounts (struct InterpreterState *is)
     case OC_ADMIN_ADD_INCOMING:
       GNUNET_free (cmd->details.admin_add_incoming.amount);
       break;
+    case OC_RUN_WIREWATCH:
+      break;
     default:
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   "Shutdown: unknown instruction %d at %u (%s)\n",
@@ -933,10 +994,26 @@ reset_interpreter (struct InterpreterState *is)
                     "Command %u (%s) did not complete\n",
                     i,
                     cmd->label);
-        TALER_EXCHANGE_admin_add_incoming_cancel 
(cmd->details.admin_add_incoming.aih);
+        TALER_BANK_admin_add_incoming_cancel 
(cmd->details.admin_add_incoming.aih);
         cmd->details.admin_add_incoming.aih = NULL;
       }
       break;
+    case OC_RUN_WIREWATCH:
+      if (NULL != cmd->details.run_wirewatch.wirewatch_proc)
+      {
+        GNUNET_break (0 ==
+                      GNUNET_OS_process_kill 
(cmd->details.run_wirewatch.wirewatch_proc,
+                                              SIGKILL));
+        GNUNET_OS_process_wait (cmd->details.run_wirewatch.wirewatch_proc);
+        GNUNET_OS_process_destroy (cmd->details.run_wirewatch.wirewatch_proc);
+        cmd->details.run_wirewatch.wirewatch_proc = NULL;
+      }
+      if (NULL != cmd->details.run_wirewatch.child_death_task)
+      {
+        GNUNET_SCHEDULER_cancel (cmd->details.run_wirewatch.child_death_task);
+        cmd->details.run_wirewatch.child_death_task = NULL;
+      }
+      break;
     default:
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   "Shutdown: unknown instruction %d at %u (%s)\n",
@@ -949,6 +1026,30 @@ reset_interpreter (struct InterpreterState *is)
 
 
 /**
+ * Task triggered whenever we receive a SIGCHLD (child
+ * process died).
+ *
+ * @param cls closure, NULL if we need to self-restart
+ */
+static void
+maint_child_death (void *cls)
+{
+  struct InterpreterState *is = cls;
+  struct Command *cmd = &is->commands[is->ip];
+  const struct GNUNET_DISK_FileHandle *pr;
+  char c[16];
+
+  cmd->details.run_wirewatch.child_death_task = NULL;
+  pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
+  GNUNET_break (0 < GNUNET_DISK_file_read (pr, &c, sizeof (c)));
+  GNUNET_OS_process_wait (cmd->details.run_wirewatch.wirewatch_proc);
+  GNUNET_OS_process_destroy (cmd->details.run_wirewatch.wirewatch_proc);
+  cmd->details.run_wirewatch.wirewatch_proc = NULL;
+  next_command (is);
+}
+
+
+/**
  * Run the main interpreter loop that performs exchange operations.
  *
  * @param cls contains the `struct InterpreterState`
@@ -960,11 +1061,7 @@ interpreter_run (void *cls)
   struct InterpreterState *is = cls;
   struct Command *cmd = &is->commands[is->ip];
   const struct Command *ref;
-  struct TALER_ReservePublicKeyP reserve_pub;
   struct TALER_Amount amount;
-  struct GNUNET_TIME_Absolute execution_date;
-  json_t *sender_details;
-  json_t *transfer_details;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Interpreter runs command %u/%s(%u)\n",
@@ -1101,7 +1198,7 @@ interpreter_run (void *cls)
         }
         cmd->details.pay.ph
           = TALER_MERCHANT_pay_wallet (ctx,
-                                       merchant_uri,
+                                       merchant_url,
                                        instance,
                                        &ref->details.proposal.hash,
                                        &total_amount,
@@ -1112,7 +1209,7 @@ interpreter_run (void *cls)
                                        refund_deadline,
                                        pay_deadline,
                                        &h_wire,
-                                       exchange_uri,
+                                       exchange_url,
                                        order_id,
                                        1 /* num_coins */,
                                        &pc /* coins */,
@@ -1155,7 +1252,7 @@ interpreter_run (void *cls)
         json_decref (merchant_obj);
         cmd->details.proposal.po
           = TALER_MERCHANT_order_put (ctx,
-                                      merchant_uri,
+                                      merchant_url,
                                       order,
                                       &proposal_cb,
                                       is);
@@ -1170,92 +1267,101 @@ interpreter_run (void *cls)
       }
 
     case OC_ADMIN_ADD_INCOMING:
-      if (NULL !=
-          cmd->details.admin_add_incoming.reserve_reference)
-      {
-        ref = find_command (is,
-                            cmd->details.admin_add_incoming.reserve_reference);
-        GNUNET_assert (NULL != ref);
-        GNUNET_assert (OC_ADMIN_ADD_INCOMING == ref->oc);
-        cmd->details.admin_add_incoming.reserve_priv
-          = ref->details.admin_add_incoming.reserve_priv;
-      }
-      else
-      {
-        struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
-
-        priv = GNUNET_CRYPTO_eddsa_key_create ();
-        cmd->details.admin_add_incoming.reserve_priv.eddsa_priv = *priv;
-        GNUNET_free (priv);
-      }
-      GNUNET_CRYPTO_eddsa_key_get_public 
(&cmd->details.admin_add_incoming.reserve_priv.eddsa_priv,
-                                          &reserve_pub.eddsa_pub);
-      if (GNUNET_OK !=
-          TALER_string_to_amount (cmd->details.admin_add_incoming.amount,
-                                  &amount))
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Failed to parse amount `%s' at %u\n",
-                    cmd->details.admin_add_incoming.amount,
-                    is->ip);
-        fail (is);
-        return;
-      }
-
-      execution_date = GNUNET_TIME_absolute_get ();
-      GNUNET_TIME_round_abs (&execution_date);
-      sender_details = json_loads 
(cmd->details.admin_add_incoming.sender_details,
-                                   JSON_REJECT_DUPLICATES,
-                                   NULL);
-      if (NULL == sender_details)
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Failed to parse sender details `%s' at %u\n",
-                    cmd->details.admin_add_incoming.sender_details,
-                    is->ip);
-        fail (is);
-        return;
-      }
-      json_object_set_new (sender_details,
-                           "bank_uri",
-                           json_string (bank_uri));
-
-      transfer_details = json_loads 
(cmd->details.admin_add_incoming.transfer_details,
-                                     JSON_REJECT_DUPLICATES,
-                                     NULL);
-
-      if (NULL == transfer_details)
       {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Failed to parse transfer details `%s' at %u\n",
-                    cmd->details.admin_add_incoming.transfer_details,
-                    is->ip);
-        fail (is);
-        return;
+       char *subject;
+       struct TALER_BANK_AuthenticationData auth;
+       struct TALER_ReservePublicKeyP reserve_pub;
+         
+       if (NULL !=
+           cmd->details.admin_add_incoming.reserve_reference)
+       {
+         ref = find_command (is,
+                             
cmd->details.admin_add_incoming.reserve_reference);
+         GNUNET_assert (NULL != ref);
+         GNUNET_assert (OC_ADMIN_ADD_INCOMING == ref->oc);
+         cmd->details.admin_add_incoming.reserve_priv
+           = ref->details.admin_add_incoming.reserve_priv;
+       }
+       else
+       {
+         struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
+         
+         priv = GNUNET_CRYPTO_eddsa_key_create ();
+         cmd->details.admin_add_incoming.reserve_priv.eddsa_priv = *priv;
+         GNUNET_free (priv);
+       }
+       GNUNET_CRYPTO_eddsa_key_get_public 
(&cmd->details.admin_add_incoming.reserve_priv.eddsa_priv,
+                                           &reserve_pub.eddsa_pub);
+       if (GNUNET_OK !=
+           TALER_string_to_amount (cmd->details.admin_add_incoming.amount,
+                                   &amount))
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                     "Failed to parse amount `%s' at %u\n",
+                     cmd->details.admin_add_incoming.amount,
+                     is->ip);
+         fail (is);
+         return;
+       }
+
+       subject
+         = GNUNET_STRINGS_data_to_string_alloc (&reserve_pub,
+                                                sizeof (reserve_pub));
+       auth.method = TALER_BANK_AUTH_BASIC;
+       /* TODO: obtain authentication details from configuration */
+       auth.details.basic.username = "admin";
+       auth.details.basic.password = "x";
+       cmd->details.admin_add_incoming.aih
+         = TALER_BANK_admin_add_incoming (ctx,
+                                          bank_url,
+                                          &auth,
+                                          exchange_url,
+                                          subject,
+                                          &amount,
+                                          
cmd->details.admin_add_incoming.debit_account_no,
+                                          
cmd->details.admin_add_incoming.credit_account_no,
+                                          &add_incoming_cb,
+                                          is);
+       GNUNET_free (subject);
+       if (NULL == cmd->details.admin_add_incoming.aih)
+       {
+         GNUNET_break (0);
+         fail (is);
+         return;
+       }
+       return;
       }
-      cmd->details.admin_add_incoming.aih
-        = TALER_EXCHANGE_admin_add_incoming (exchange,
-                                             exchange_uri_admin,
-                                             &reserve_pub,
-                                             &amount,
-                                             execution_date,
-                                             sender_details,
-                                             transfer_details,
-                                             &add_incoming_cb,
-                                             is);
-      json_decref (sender_details);
-      json_decref (transfer_details);
-      if (NULL == cmd->details.admin_add_incoming.aih)
+    case OC_RUN_WIREWATCH:
       {
-        GNUNET_break (0);
-        fail (is);
-        return;
+       const struct GNUNET_DISK_FileHandle *pr;
+       
+       cmd->details.run_wirewatch.wirewatch_proc
+         = GNUNET_OS_start_process (GNUNET_NO,
+                                    GNUNET_OS_INHERIT_STD_ALL,
+                                    NULL, NULL, NULL,
+                                    "taler-exchange-wirewatch",
+                                    "taler-exchange-wirewatch",
+                                    "-c", cfgfilename,
+                                    "-t", "test", /* use Taler's bank/fakebank 
*/
+                                    "-T", /* exit when done */
+                                    NULL);
+       if (NULL == cmd->details.run_wirewatch.wirewatch_proc)
+       {
+         GNUNET_break (0);
+         fail (is);
+         return;
+       }
+       pr = GNUNET_DISK_pipe_handle (sigpipe,
+                                     GNUNET_DISK_PIPE_END_READ);
+       cmd->details.run_wirewatch.child_death_task
+         = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+                                           pr,
+                                           &maint_child_death, is);
+       return;
       }
-      return;
-
     case OC_WITHDRAW_SIGN:
       GNUNET_assert (NULL !=
-                     cmd->details.reserve_withdraw.reserve_reference);
+                    cmd->details.reserve_withdraw.reserve_reference);
       ref = find_command (is,
                           cmd->details.reserve_withdraw.reserve_reference);
       GNUNET_assert (NULL != ref);
@@ -1408,6 +1514,11 @@ do_shutdown (void *cls)
     GNUNET_CURL_gnunet_rc_destroy (rc);
     rc = NULL;
   }
+  if (NULL != fakebank)
+  {
+    TALER_FAKEBANK_stop (fakebank);
+    fakebank = NULL;
+  }
 }
 
 
@@ -1422,12 +1533,15 @@ do_shutdown (void *cls)
  * formatted string.
  */
 static char *
-concat_amount (char *currency, char *rpart)
+concat_amount (const char *currency,
+              const char *rpart)
 {
   char *str;
 
-  GNUNET_asprintf (&str, "%s:%s",
-                   currency, rpart);
+  GNUNET_asprintf (&str,
+                  "%s:%s",
+                   currency,
+                  rpart);
   return str;
 }
 
@@ -1445,25 +1559,27 @@ run_test ()
     { .oc = OC_ADMIN_ADD_INCOMING,
       .label = "create-reserve-1",
       .expected_response_code = MHD_HTTP_OK,
-      .details.admin_add_incoming.sender_details = "{ \"type\":\"test\", 
\"account_number\":62, \"uuid\":1 }",
-      .details.admin_add_incoming.transfer_details = "{ \"uuid\": 1}",
+      .details.admin_add_incoming.debit_account_no = 62,
+      .details.admin_add_incoming.credit_account_no = EXCHANGE_ACCOUNT_NO,
       .details.admin_add_incoming.amount = concat_amount (currency, "5.01") },
 
     /* Fill reserve with EUR:5.01, as withdraw fee is 1 ct per config */
     { .oc = OC_ADMIN_ADD_INCOMING,
       .label = "create-reserve-2",
       .expected_response_code = MHD_HTTP_OK,
-      .details.admin_add_incoming.sender_details = "{ \"type\":\"test\", 
\"account_number\":62, \"uuid\":1 }",
-      .details.admin_add_incoming.transfer_details = "{ \"uuid\": 1}",
+      .details.admin_add_incoming.debit_account_no = 62,
+      .details.admin_add_incoming.credit_account_no = EXCHANGE_ACCOUNT_NO,
       .details.admin_add_incoming.amount = concat_amount (currency, "5.01") },
     /* Fill reserve with EUR:5.01, as withdraw fee is 1 ct per config */
     { .oc = OC_ADMIN_ADD_INCOMING,
       .label = "create-reserve-3",
       .expected_response_code = MHD_HTTP_OK,
-      .details.admin_add_incoming.sender_details = "{ \"type\":\"test\", 
\"account_number\":62, \"uuid\":1 }",
-      .details.admin_add_incoming.transfer_details = "{ \"uuid\": 1}",
+      .details.admin_add_incoming.debit_account_no = 62,
+      .details.admin_add_incoming.credit_account_no = EXCHANGE_ACCOUNT_NO,
       .details.admin_add_incoming.amount = concat_amount (currency, "5.01") },
-
+    { .oc = OC_RUN_WIREWATCH,
+      .label = "run-wirewatch-1"
+    },
     /* Withdraw a 5 EUR coin, at fee of 1 ct */
     { .oc = OC_WITHDRAW_SIGN,
       .label = "withdraw-coin-1",
@@ -1544,7 +1660,7 @@ run_test ()
   GNUNET_assert (NULL != ctx);
   rc = GNUNET_CURL_gnunet_rc_create (ctx);
   exchange = TALER_EXCHANGE_connect (ctx,
-                                     exchange_uri,
+                                     exchange_url,
                                      &cert_cb,
                                      is,
                                      TALER_EXCHANGE_OPTION_END);
@@ -1572,10 +1688,23 @@ run (void *cls,
   unsigned int cnt;
   char *wget_cmd;
 
-  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (config,
-                                                              
"payments-generator",
-                                                              "exchange",
-                                                              &exchange_uri))
+  cfgfilename = GNUNET_strdup (cfgfile);
+  if (! remote_bank)
+  {
+    /* TODO: do not hard-code port, find in cfg */
+    fakebank = TALER_FAKEBANK_start (8082);
+    if (NULL == fakebank)
+    {
+      fprintf (stderr,        
+              "Failed to launch fakebank\n");
+      GNUNET_SCHEDULER_shutdown ();
+    }
+  }
+  if (GNUNET_SYSERR == 
+      GNUNET_CONFIGURATION_get_value_string (config,
+                                            "payments-generator",
+                                            "exchange",
+                                            &exchange_url))
   {
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                "payments-generator",
@@ -1583,10 +1712,11 @@ run (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (config,
-                                                              
"payments-generator",
-                                                              "exchange_admin",
-                                                              
&exchange_uri_admin))
+  if (GNUNET_SYSERR ==
+      GNUNET_CONFIGURATION_get_value_string (config,
+                                            "payments-generator",
+                                            "exchange_admin",
+                                            &exchange_url_admin))
   {
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                "payments-generator",
@@ -1595,10 +1725,11 @@ run (void *cls,
     return;
   }
 
-  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (config,
-                                                              
"payments-generator",
-                                                              "merchant",
-                                                              &merchant_uri))
+  if (GNUNET_SYSERR ==
+      GNUNET_CONFIGURATION_get_value_string (config,
+                                            "payments-generator",
+                                            "merchant",
+                                            &merchant_url))
   {
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                "payments-generator",
@@ -1607,12 +1738,12 @@ run (void *cls,
     return;
   }
 
-  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (config,
-                                                              
"payments-generator",
-                                                              "bank",
-                                                              &bank_uri))
+  if (GNUNET_SYSERR ==
+      GNUNET_CONFIGURATION_get_value_string (config,
+                                            "payments-generator",
+                                            "bank",
+                                            &bank_url))
   {
-
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                "payments-generator",
                                "bank");
@@ -1620,10 +1751,11 @@ run (void *cls,
     return;
   }
 
-  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (config,
-                                                              
"payments-generator",
-                                                              "instance",
-                                                              &instance))
+  if (GNUNET_SYSERR ==
+      GNUNET_CONFIGURATION_get_value_string (config,
+                                            "payments-generator",
+                                            "instance",
+                                            &instance))
   {
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                "payments-generator",
@@ -1632,12 +1764,12 @@ run (void *cls,
     return;
   }
 
-  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (config,
-                                                              
"payments-generator",
-                                                              "currency",
-                                                              &currency))
+  if (GNUNET_SYSERR ==
+      GNUNET_CONFIGURATION_get_value_string (config,
+                                            "payments-generator",
+                                            "currency",
+                                            &currency))
   {
-
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                "payments-generator",
                                "currency");
@@ -1665,7 +1797,9 @@ run (void *cls,
              "Waiting for taler-exchange-httpd to be ready\n");
     cnt = 0;
 
-    GNUNET_asprintf (&wget_cmd, "wget -q -t 1 -T 1 %skeys -o /dev/null -O 
/dev/null", exchange_uri);
+    GNUNET_asprintf (&wget_cmd,
+                    "wget -q -t 1 -T 1 %skeys -o /dev/null -O /dev/null",
+                    exchange_url);
 
     do
       {
@@ -1715,7 +1849,7 @@ run (void *cls,
     fprintf (stderr,
              "Waiting for taler-merchant-httpd to be ready\n");
     cnt = 0;
-    GNUNET_asprintf (&wget_cmd, "wget -q -t 1 -T 1 %s -o /dev/null -O 
/dev/null", merchant_uri);
+    GNUNET_asprintf (&wget_cmd, "wget -q -t 1 -T 1 %s -o /dev/null -O 
/dev/null", merchant_url);
 
     do
       {
@@ -1767,6 +1901,10 @@ main (int argc,
                                "TIMES",
                                "How many times the commands should be run.",
                                &times),
+    GNUNET_GETOPT_option_flag ('b',
+                               "remote-bank",
+                               "Do not start fakebank",
+                               &remote_bank),
     GNUNET_GETOPT_option_flag ('e',
                                "remote-exchange",
                                "Do not fork any exchange",

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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