Testing ipns

This commit is contained in:
John Jones 2017-09-14 16:49:50 -05:00
parent e922c7ef14
commit 96ed7bc511
2 changed files with 25 additions and 2 deletions

View file

@ -1,10 +1,10 @@
#pragma once #pragma once
#include "libp2p/conn/session.h" #include "libp2p/conn/session.h"
#include "libp2p/net/protocol.h"
#include "libp2p/peer/peerstore.h" #include "libp2p/peer/peerstore.h"
#include "libp2p/peer/providerstore.h" #include "libp2p/peer/providerstore.h"
#include "libp2p/net/protocol.h" #include "libp2p/record/message.h"
/*** /***
* This is where kademlia and dht talk to the outside world * This is where kademlia and dht talk to the outside world
@ -35,3 +35,14 @@ int libp2p_routing_dht_handshake(struct SessionContext* context);
* @returns true(1) on success, otherwise false(0) * @returns true(1) on success, otherwise false(0)
*/ */
int libp2p_routing_dht_handle_message(struct SessionContext* session, struct Peerstore* peerstore, struct ProviderStore* providerstore); int libp2p_routing_dht_handle_message(struct SessionContext* session, struct Peerstore* peerstore, struct ProviderStore* providerstore);
/**
* Used to send a message to the nearest x peers
*
* @param local_peer the local peer
* @param providerstore the collection of providers
* @param msg the message to send
* @returns true(1) on success, false(0) otherwise
*/
int libp2p_routing_dht_send_message(struct Libp2pPeer* local_peer, struct ProviderStore* providerstore, struct KademliaMessage* msg);

View file

@ -483,3 +483,15 @@ int libp2p_routing_dht_handle_message(struct SessionContext* session, struct Pee
libp2p_message_free(message); libp2p_message_free(message);
return retVal; return retVal;
} }
/**
* Used to send a message to the nearest x peers
*
* @param local_peer the local peer
* @param providerstore the collection of providers
* @param msg the message to send
* @returns true(1) on success, false(0) otherwise
*/
int libp2p_routing_dht_send_message(struct Libp2pPeer* local_peer, struct ProviderStore* providerstore, struct KademliaMessage* msg) {
return 0;
}