35 #ifndef GNUNET_CONSENSUS_SERVICE_H
36 #define GNUNET_CONSENSUS_SERVICE_H
58 #define GNUNET_CONSENSUS_ELEMENT_TYPE_USER_MAX 0xFFF0
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
static int start
Set if we are to start default services (including ARM).
static struct CadetPeer * peers
Operation to get peer ids.
static struct GNUNET_TIME_Absolute deadline
Deadline for all consensuses.
static void new_element_cb(void *cls, const struct GNUNET_SET_Element *element)
static struct GNUNET_HashCode session_id
static unsigned int num_peers
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Functions related to time.
void GNUNET_CONSENSUS_destroy(struct GNUNET_CONSENSUS_Handle *consensus)
Destroy a consensus handle (free all state associated with it, no longer call any of the callbacks).
void(* GNUNET_CONSENSUS_ElementCallback)(void *cls, const struct GNUNET_SET_Element *element)
Called when a new element was received from another peer, or an error occurred.
void GNUNET_CONSENSUS_insert(struct GNUNET_CONSENSUS_Handle *consensus, const struct GNUNET_SET_Element *element, GNUNET_CONSENSUS_InsertDoneCallback idc, void *idc_cls)
Insert an element in the set being reconsiled.
void(* GNUNET_CONSENSUS_InsertDoneCallback)(void *cls, int success)
Called when an insertion (transmission to consensus service, which does not imply fully consensus on ...
void(* GNUNET_CONSENSUS_ConcludeCallback)(void *cls)
Called when a conclusion was successful.
struct GNUNET_CONSENSUS_Handle * GNUNET_CONSENSUS_create(const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int num_peers, const struct GNUNET_PeerIdentity *peers, const struct GNUNET_HashCode *session_id, struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute deadline, GNUNET_CONSENSUS_ElementCallback new_element_cb, void *new_element_cls)
Create a consensus session.
void GNUNET_CONSENSUS_conclude(struct GNUNET_CONSENSUS_Handle *consensus, GNUNET_CONSENSUS_ConcludeCallback conclude, void *conclude_cls)
We are finished inserting new elements into the consensus; try to conclude the consensus within a giv...
void * conclude_cls
Closure for the conclude_cb callback.
void * new_element_cls
Closure for new_element_cb.
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.