Skip to content

Commit

Permalink
Merge pull request #9 from textileio/andrew/grpc-ipfs-v0.1.4
Browse files Browse the repository at this point in the history
api: add lowmem option
  • Loading branch information
andrewxhill authored Apr 10, 2020
2 parents ea9cc38 + 85e5d48 commit ac910b7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Example/IpfsLiteApi/XAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
// }
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Example/Tests/Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
2 changes: 1 addition & 1 deletion IpfsLiteApi/Classes/IpfsLiteApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions IpfsLiteApi/Classes/IpfsLiteApi.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ac910b7

Please sign in to comment.