Using config file for bootstrap of kademlia

This commit is contained in:
John Jones 2017-03-24 16:51:00 -05:00
parent 8feb946087
commit 59af1c0b9e
10 changed files with 36 additions and 48 deletions

View file

@ -1,25 +1,20 @@
#ifndef bootstrap_peer_h
#define bootstrap_peer_h
#include "ipfs/thirdparty/ipfsaddr/ipfs_addr.h"
struct BootstrapPeers {
int num_peers;
struct IPFSAddr** peers;
};
#include "libp2p/utils/vector.h"
/***
* get a list of peers to use to bootstrap the instance
* @param bootstrap_peers an array of IPFSAddr structs, will be allocated by this function
* @param bootstrap_peers A vector of MultiAddress structs will be allocated by this function
* @returns true(1) on success, otherwise false(0)
*/
int repo_config_bootstrap_peers_retrieve(struct BootstrapPeers* bootstrap_peers);
int repo_config_bootstrap_peers_retrieve(struct Libp2pVector** bootstrap_peers);
/***
* frees up memory caused by call to repo_config_bootstrap_peers_retrieve
* @param list the list to free
* @returns true(1)
*/
int repo_config_bootstrap_peers_free(struct BootstrapPeers* list);
int repo_config_bootstrap_peers_free(struct Libp2pVector* list);
#endif /* bootstrap_peer_h */

View file

@ -37,7 +37,7 @@ struct RepoConfig {
struct Mounts mounts;
struct Discovery discovery;
struct Ipns ipns;
struct BootstrapPeers peer_addresses;
struct Libp2pVector* bootstrap_peers; // MultiAddresses
//struct tour tour;
struct Gateway* gateway;
//struct supernode_routing supernode_client_config;