Config file is now closer to completion. Still need to figure out ASN.1 DER for private key, and add peer id to config file

This commit is contained in:
jmjatlanta 2016-11-02 13:09:38 -05:00
parent 772857312f
commit 0d8f599ac9
22 changed files with 606 additions and 102 deletions

View file

@ -9,6 +9,29 @@
#ifndef test_repo_config_h
#define test_repo_config_h
#include "ipfs/repo/config/config.h"
int test_repo_config_init() {
struct RepoConfig repoConfig;
int retVal = repo_config_init(&repoConfig, 2048, "/Users/JohnJones/.ipfs");
if (retVal == 0)
return 0;
// now tear it apart to check for anything broken
// addresses
retVal = strncmp(repoConfig.addresses.api, "/ip4/127.0.0.1/tcp/5001", 23);
if (retVal != 0)
return 0;
retVal = strncmp(repoConfig.addresses.gateway, "/ip4/127.0.0.1/tcp/8080", 23);
if (retVal != 0)
return 0;
// datastore
retVal = strncmp(repoConfig.datastore.path, "/Users/JohnJones/.ipfs/datastore", 32);
if (retVal != 0)
return 0;
return 1;
}
#endif /* test_repo_config_h */