2016-12-21 13:08:44 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-13 14:31:58 +00:00
|
|
|
#include "libp2p/utils/vector.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Make an IPFS directory at the passed in path
|
|
|
|
* @param path the path
|
|
|
|
* @param swarm_port the port that the swarm will run on
|
|
|
|
* @param bootstrap_peers a Vector of MultiAddress of fellow peers
|
|
|
|
* @param peer_id the peer id generated
|
|
|
|
* @returns true(1) on success, false(0) on failure
|
2016-12-21 13:08:44 +00:00
|
|
|
*/
|
2017-04-13 14:31:58 +00:00
|
|
|
int make_ipfs_repository(const char* path, int swarm_port, struct Libp2pVector* bootstrap_peers, char **peer_id);
|
2016-12-21 13:08:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize a repository, called from the command line
|
|
|
|
* @param argc number of arguments
|
|
|
|
* @param argv arguments
|
|
|
|
* @returns true(1) on success
|
|
|
|
*/
|
|
|
|
int ipfs_repo_init(int argc, char** argv);
|
2017-04-06 22:46:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the correct repo directory. Looks in all the appropriate places
|
|
|
|
* for the ipfs directory.
|
|
|
|
* @param argc number of command line arguments
|
|
|
|
* @param argv command line arguments
|
|
|
|
* @param repo_dir the results. This will point to the [IPFS_PATH]/.ipfs directory
|
|
|
|
* @returns true(1) if the directory is there, false(0) if it is not.
|
|
|
|
*/
|
|
|
|
int ipfs_repo_get_directory(int argc, char** argv, char** repo_dir);
|
|
|
|
|