Implemented find providers from remote peers

Now, you can ask a known node for a key, and it can pass a list of peers
that are perhaps unknownn to the calling peer.
This commit is contained in:
John Jones 2017-04-16 23:47:53 -05:00
parent 62096ffc1c
commit 2b0a29a06b
9 changed files with 263 additions and 19 deletions

View file

@ -35,13 +35,13 @@ struct IpfsRouting {
int (*GetValue) (struct IpfsRouting*, char*, size_t, void**, size_t*);
/**
* Find a provider
* @param 1 the context
* @param 2 the information that is being looked for
* @param 3 the size of param 2
* @param 4 the information found
* @param 5 the size of the information found
* @param routing the context
* @param key the information that is being looked for
* @param key_size the size of param 2
* @param peers a vector of peers found that can provide the value for the key
* @returns true(1) on success, otherwise false(0)
*/
int (*FindProviders) (struct IpfsRouting*, char*, size_t, struct Libp2pVector** multiaddresses);
int (*FindProviders) (struct IpfsRouting* routing, unsigned char* key, size_t key_size, struct Libp2pVector** peers);
/**
* Find a peer
* @param 1 the context