diff --git a/core/ipfs_node.c b/core/ipfs_node.c index 218fa3b..5847b8c 100644 --- a/core/ipfs_node.c +++ b/core/ipfs_node.c @@ -1,6 +1,7 @@ #include #include +#include "libp2p/conn/dialer.h" #include "libp2p/net/multistream.h" #include "libp2p/utils/vector.h" #include "libp2p/secio/secio.h" @@ -89,6 +90,7 @@ int ipfs_node_online_new(const char* repo_path, struct IpfsNode** node) { // fill in the node local_node->repo = fs_repo; local_node->identity = fs_repo->config->identity; + local_node->dialer = libp2p_conn_dialer_new(local_node->identity->peer, &local_node->identity->private_key); local_node->peerstore = libp2p_peerstore_new(local_node->identity->peer); local_node->providerstore = libp2p_providerstore_new(fs_repo->config->datastore, local_node->identity->peer); local_node->blockstore = ipfs_blockstore_new(fs_repo); @@ -134,6 +136,7 @@ int ipfs_node_offline_new(const char* repo_path, struct IpfsNode** node) { // fill in the node local_node->repo = fs_repo; local_node->identity = fs_repo->config->identity; + local_node->dialer = libp2p_conn_dialer_new(local_node->identity->peer, &local_node->identity->private_key); local_node->peerstore = libp2p_peerstore_new(local_node->identity->peer); local_node->providerstore = libp2p_providerstore_new(fs_repo->config->datastore, local_node->identity->peer); local_node->blockstore = ipfs_blockstore_new(fs_repo); diff --git a/test/core/test_ping.h b/test/core/test_ping.h index 930ef50..3179021 100644 --- a/test/core/test_ping.h +++ b/test/core/test_ping.h @@ -57,7 +57,7 @@ int test_ping() { remote_peer->addr_head->item = multiaddress_new_from_string("/ip4/192.168.43.234/tcp/4001/"); // connect using a dialer - dialer = libp2p_conn_dialer_new(fs_repo->config->identity->peer->id, libp2p_crypto_rsa_to_private_key(&fs_repo->config->identity->private_key)); + dialer = libp2p_conn_dialer_new(fs_repo->config->identity->peer, &fs_repo->config->identity->private_key); conn = libp2p_conn_dialer_get_connection(dialer, remote_peer->addr_head->item); //TODO: Dialer should know the protocol diff --git a/test/scripts/test_5.sh b/test/scripts/test_5.sh index 7a27d46..c513029 100755 --- a/test/scripts/test_5.sh +++ b/test/scripts/test_5.sh @@ -40,10 +40,12 @@ function body { #A client of server 2 wants the file at server 1 eval "$IPFS2" cat QmYAXgX8ARiriupMQsbGXtKdDyGzWry1YV3sycKw1qqmgH - check_failure "cat" $? + retVal=$? + check_failure "cat" $retVal kill -9 $daemon_id_1 kill -9 $daemon_id_2 + exit $retVal }