diff --git a/Example/IpfsLiteApi/XAppDelegate.m b/Example/IpfsLiteApi/XAppDelegate.m index 5c19e1a..2b5ee2e 100644 --- a/Example/IpfsLiteApi/XAppDelegate.m +++ b/Example/IpfsLiteApi/XAppDelegate.m @@ -18,7 +18,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // NSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; // NSString *repoPath = [documents stringByAppendingPathComponent:@"ipfs-lite"]; // NSError *error; -// [IpfsLiteApi launch:repoPath debug:false error:&error]; +// [IpfsLiteApi launch:repoPath debug:false lowMem: true error:&error]; // if (error) { // NSLog(@"error launching: %@", error.localizedDescription); // } diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 9251cd8..f84fc3b 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -13,7 +13,7 @@ PODS: - BoringSSL-GRPC (= 0.0.5) - gRPC-Core/Interface (= 1.26.0) - gRPC-Core/Interface (1.26.0) - - grpc-ipfs-lite (0.1.2) + - grpc-ipfs-lite (0.1.4) - gRPC-ProtoRPC (1.26.0): - gRPC-ProtoRPC/Legacy (= 1.26.0) - gRPC-ProtoRPC/Legacy-Header (= 1.26.0) @@ -45,7 +45,7 @@ PODS: - gRPC/Interface-Legacy (1.26.0): - gRPC-RxLibrary/Interface (= 1.26.0) - IpfsLiteApi (0.0.1-dev): - - grpc-ipfs-lite (= 0.1.2) + - grpc-ipfs-lite (= 0.1.4) - gRPC-ProtoRPC - Protobuf - Protobuf (3.11.2) diff --git a/Example/Tests/Tests.m b/Example/Tests/Tests.m index dbc617f..77c6ebf 100644 --- a/Example/Tests/Tests.m +++ b/Example/Tests/Tests.m @@ -14,7 +14,7 @@ NSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *repoPath = [documents stringByAppendingPathComponent:@"ipfs-lite"]; NSError *error; - BOOL success = [IpfsLiteApi launch:repoPath debug: false error:&error]; + BOOL success = [IpfsLiteApi launch:repoPath debug:false lowMem:true error:&error]; expect(success).beTruthy(); expect(error).beNil(); }); diff --git a/IpfsLiteApi/Classes/IpfsLiteApi.h b/IpfsLiteApi/Classes/IpfsLiteApi.h index d5b1078..776d735 100644 --- a/IpfsLiteApi/Classes/IpfsLiteApi.h +++ b/IpfsLiteApi/Classes/IpfsLiteApi.h @@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) TTEIpfsLite *client; -+ (BOOL)launch:(NSString *)datastorePath debug:(BOOL)debug error:(NSError **)error; ++ (BOOL)launch:(NSString *)datastorePath debug:(BOOL)debug lowMem:(BOOL)lowMem error:(NSError **)error; + (IpfsLiteApi *)instance; - (void)addFileFromInput:(NSInputStream *)input params:(TTEAddParams *)params completion:(void (^)(TTENode * _Nullable node, NSError * _Nullable error))completion; diff --git a/IpfsLiteApi/Classes/IpfsLiteApi.m b/IpfsLiteApi/Classes/IpfsLiteApi.m index 652273b..1bbfa0f 100644 --- a/IpfsLiteApi/Classes/IpfsLiteApi.m +++ b/IpfsLiteApi/Classes/IpfsLiteApi.m @@ -20,9 +20,9 @@ + (IpfsLiteApi *)instance { return instnace; } -+ (BOOL)launch:(NSString *)datastorePath debug:(BOOL)debug error:(NSError **)error { ++ (BOOL)launch:(NSString *)datastorePath debug:(BOOL)debug lowMem:(BOOL)lowMem error:(NSError **)error { long port; - BOOL started = MobileStart(datastorePath, debug, &port, error); + BOOL started = MobileStart(datastorePath, debug, lowMem, &port, error); if (!started) { return started; } diff --git a/README.md b/README.md index cc00ae1..4a72368 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,15 @@ IPFS Lite runs the minimal setup required to get and put IPLD DAGs on the IPFS n - [ios-ipfs-lite](#ios-ipfs-lite) - [Table of Contents](#table-of-contents) - [Background](#background) + - [IPFS-lite Libraries](#ipfs-lite-libraries) - [Roadmap](#roadmap) - [Install](#install) - [Usage](#usage) - [Initialize and start a Peer](#initialize-and-start-a-peer) - [Add data](#add-data) - [Add a file](#add-a-file) - - [Fetch a file by CID](#fetch-a-file-by-cid) + - [Fetch a file by CID to a NSOutputStream](#fetch-a-file-by-cid-to-a-nsoutputstream) + - [Fetch a node by CID](#fetch-a-node-by-cid) - [Maintainers](#maintainers) - [Contributing](#contributing) - [License](#license) @@ -89,7 +91,7 @@ and run `pod install` NSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *repoPath = [documents stringByAppendingPathComponent:@"ipfs-lite"]; NSError *error; -BOOL success = [IpfsLiteApi launch:repoPath debug: false error:&error]; +BOOL success = [IpfsLiteApi launch:repoPath debug:false lowMem: true error:&error]; ``` ### Add data