[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] 01/07: work on reducer
From: |
gnunet |
Subject: |
[taler-anastasis] 01/07: work on reducer |
Date: |
Sat, 12 Sep 2020 11:01:48 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
commit b002a8eea1a51da34a62e65e47b763cb0af2808a
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Thu Sep 10 20:03:10 2020 +0200
work on reducer
---
src/cli/anastasis-cli-redux.c | 124 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 124 insertions(+)
diff --git a/src/cli/anastasis-cli-redux.c b/src/cli/anastasis-cli-redux.c
new file mode 100644
index 0000000..c48b77d
--- /dev/null
+++ b/src/cli/anastasis-cli-redux.c
@@ -0,0 +1,124 @@
+/*
+ This file is part of Anastasis
+ Copyright (C) 2020 Taler Systems SA
+
+ Anastasis 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
+ Foundation; either version 3, or (at your option) any later version.
+
+ Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ Anastasis; see the file COPYING.GPL. If not, see
<http://www.gnu.org/licenses/>
+*/
+/**
+ * @file cli/anastasis-cli-redux.c
+ * @brief command line tool for our reducer
+ * @author Christian Grothoff
+ * @author Dennis Neufeld
+ * @author Dominik Meister
+ */
+
+#include "platform.h"
+#include <gnunet/gnunet_util_lib.h>
+#include <gnunet/gnunet_curl_lib.h>
+#include "anastasis_redux.h"
+
+
+/**
+ * Closure for #GNUNET_CURL_gnunet_scheduler_reschedule().
+ */
+static struct GNUNET_CURL_RescheduleContext *rc;
+
+/**
+ * Curl context for communication with anastasis backend
+ */
+static struct GNUNET_CURL_Context *ctx;
+
+
+/**
+ * @brief Shutdown the application.
+ *
+ * @param cls closure
+ */
+static void
+shutdown_task (void *cls)
+{
+ (void) cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Shutdown initiated\n");
+
+ // FIXME shutdown routine here
+ if (NULL != rc)
+ {
+ GNUNET_CURL_gnunet_rc_destroy (rc);
+ rc = NULL;
+ }
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Shutdown complete\n");
+}
+
+
+/**
+ * @brief Start the application
+ *
+ * @param cls closure
+ * @param args arguments left
+ * @param cfgfile config file name
+ * @param cfg handle for the configuration file
+ */
+static void
+run (void *cls,
+ char *const *args,
+ const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+ (void) cls;
+ (void) args;
+ (void) cfgfile;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Starting anastasis-reducer\n");
+
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
+
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_log_setup ("anastasis-reducer",
+ "WARNING",
+ NULL));
+
+ /* initialize HTTP client FIXME: Do we need http client?*/
+ ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
+ &rc);
+ rc = GNUNET_CURL_gnunet_rc_create (ctx);
+}
+
+
+int
+main (int argc,
+ char *const *argv)
+{
+ int ret;
+
+ /* the available command line options */
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_END
+ };
+
+ ret = GNUNET_PROGRAM_run (argc,
+ argv,
+ "anastasis-reducer",
+ "This is an application for using Anastasis to
handle the states.\n",
+ options,
+ &run,
+ NULL);
+
+ return (GNUNET_OK == ret) ? 0 : 1;
+}
+
+/* end of anastasis-cli-redux.c */
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-anastasis] branch master updated (3e1fd2b -> a7d37bf), gnunet, 2020/09/12
- [taler-anastasis] 01/07: work on reducer,
gnunet <=
- [taler-anastasis] 02/07: options for reducer cli, gnunet, 2020/09/12
- [taler-anastasis] 04/07: work on backup redux, gnunet, 2020/09/12
- [taler-anastasis] 03/07: work on reducer cli, gnunet, 2020/09/12
- [taler-anastasis] 06/07: fixed anastasis-reducer to return init state, gnunet, 2020/09/12
- [taler-anastasis] 05/07: work on backup redux, gnunet, 2020/09/12
- [taler-anastasis] 07/07: merge, gnunet, 2020/09/12