Starting to handle get_value request

This commit is contained in:
John Jones 2017-02-27 12:27:40 -05:00
parent 7a6b138444
commit f1aac5d707
15 changed files with 281 additions and 31 deletions

View file

@ -25,5 +25,6 @@
void *ipfs_null_connection (void *ptr);
void *ipfs_null_listen (void *ptr);
int ipfs_daemon (int argc, char **argv);
int ipfs_daemon_start(char* repo_path);
int ipfs_ping (int argc, char **argv);
#endif // DAEMON_H

View file

@ -1,6 +1,7 @@
#pragma once
#include "ipfs/merkledag/node.h"
#include "ipfs/core/ipfs_node.h"
/**
* Interogate the path and the current node, looking
@ -9,4 +10,4 @@
* @param from the current node (or NULL if it is the first call)
* @returns what we are looking for, or NULL if it wasn't found
*/
struct Node* ipfs_resolver_get(const char* path, struct Node* from, const struct FSRepo* fs_repo);
struct Node* ipfs_resolver_get(const char* path, struct Node* from, const struct IpfsNode* ipfs_node);

View file

@ -2,12 +2,13 @@
#include "libp2p/crypto/rsa.h"
#include "libp2p/record/message.h"
#include "ipfs/core/ipfs_node.h"
// offlineRouting implements the IpfsRouting interface,
// but only provides the capability to Put and Get signed dht
// records to and from the local datastore.
struct s_ipfs_routing {
struct FSRepo* datastore;
struct IpfsNode* local_node;
size_t ds_len;
struct RsaPrivateKey* sk;
struct Stream* stream;
@ -49,7 +50,7 @@ struct s_ipfs_routing {
typedef struct s_ipfs_routing ipfs_routing;
// offline routing routines.
ipfs_routing* ipfs_routing_new_offline (struct FSRepo* ds, struct RsaPrivateKey *private_key);
ipfs_routing* ipfs_routing_new_online (struct FSRepo* ds, struct RsaPrivateKey* private_key, struct Stream* stream);
ipfs_routing* ipfs_routing_new_offline (struct IpfsNode* local_node, struct RsaPrivateKey *private_key);
ipfs_routing* ipfs_routing_new_online (struct IpfsNode* local_node, struct RsaPrivateKey* private_key, struct Stream* stream);
int ipfs_routing_generic_put_value (ipfs_routing* offlineRouting, char *key, size_t key_size, void *val, size_t vlen);int ipfs_routing_generic_get_value (ipfs_routing* offlineRouting, char *key, size_t key_size, void **val, size_t *vlen);