static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { static struct GNUNET_PeerIdentity pid; static struct GNUNET_HashCode sid; GNUNET_CONSENSUS_create (cfg, 1, &pid, &sid, &cb, NULL); }
/** * Adapter function called to establish a connection to * a service. * * @param cls closure * @param cfg configuration of the peer to connect to; will be available until * GNUNET_TESTBED_operation_done() is called on the operation returned * from GNUNET_TESTBED_service_connect() * @return service handle to return in 'op_result', NULL on error */ static void * connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) { struct GNUNET_CONSENSUS_Handle **chp = cls; struct GNUNET_CONSENSUS_Handle *consensus; chp = (struct GNUNET_CONSENSUS_Handle **) cls; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "connect adapter, %d peers\n", num_peers); consensus = GNUNET_CONSENSUS_create (cfg, num_peers, peer_ids, &session_id, start, deadline, &new_element_cb, chp); *chp = (struct GNUNET_CONSENSUS_Handle *) consensus; return consensus; }