2 This file is part of GNUnet
3 (C) 2012 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file consensus/gnunet-consensus.c
24 * @author Florian Dold
27 #include "gnunet_util_lib.h"
28 #include "gnunet_consensus_service.h"
34 * Called when a new element was received from another peer, or an error occured.
36 * May deliver duplicate values.
38 * Elements given to a consensus operation by the local peer are NOT given
42 * @param element new element, NULL on error
43 * @return GNUNET_OK if the valid is well-formed and should be added to the consensus,
44 * GNUNET_SYSERR if the element should be ignored and not be propagated
48 struct GNUNET_CONSENSUS_Element *element)
56 run (void *cls, char *const *args, const char *cfgfile,
57 const struct GNUNET_CONFIGURATION_Handle *cfg)
59 static struct GNUNET_PeerIdentity pid;
60 static struct GNUNET_HashCode sid;
62 GNUNET_CONSENSUS_create (cfg,
71 main (int argc, char **argv)
73 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
74 GNUNET_GETOPT_OPTION_END
76 GNUNET_PROGRAM_run (argc, argv, "gnunet-consensus",