在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:textileio/ios-ipfs-lite开源软件地址:https://github.com/textileio/ios-ipfs-lite开源编程语言:Objective-C 86.0%开源软件介绍:ios-ipfs-lite
IPFS Lite runs the minimal setup required to get and put IPLD DAGs on the IPFS network. It is a port of the Go IPFS Lite library. Table of ContentsBackgroundIPFS Lite runs the minimal setup required to provide a DAG service. It is a port of the Go IPFS Lite library, and as such, has the same requirements. The goal of IPFS Lite is to run the bare minimal functionality for any IPLD-based application to interact with the IPFS network (by getting and putting blocks). This saves having to deal with the complexities of using a full IPFS daemon, while maintaining the ability to share the underlying libp2p host and DHT with other components. IPFS-lite Libraries
Roadmap
InstallThe IPFS Lite library is published as a Cocoapod. First, you'll need to configure your project to use Cocoapods. Then, simple add ...
pod 'IpfsLiteApi'
... and run UsageInitialize and start a PeerNSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *repoPath = [documents stringByAppendingPathComponent:@"ipfs-lite"];
NSError *error;
BOOL success = [IpfsLiteApi launch:repoPath debug:false lowMem: true error:&error]; Add dataNSInputStream *input = [[NSInputStream alloc] initWithData:[@"Hello there\n" dataUsingEncoding:NSUTF8StringEncoding]];
[IpfsLiteApi.instance addFileFromInput:input parms:[[TTEAddParams alloc] init] completion:^(Node * _Nullable node, NSError * _Nullable error) {
// handle the node or error
}]; Add a fileNSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"jpeg"];
NSInputStream *input = [[NSInputStream alloc] initWithFileAtPath:path];
[IpfsLiteApi.instance addFileFromInput:input params:[[TTEAddParams alloc] init] completion:^(Node * _Nullable node, NSError * _Nullable error) {
// handle the node or error
}]; Fetch a file by CID to a NSOutputStreamNSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *outputPath = [documents stringByAppendingPathComponent:@"out.jpeg"];
NSOutputStream *output = [NSOutputStream outputStreamToFileAtPath:outputPath append:NO];
[IpfsLiteApi.instance getFileToOutput:output cid:@"<a-file-cid>" completion:^(NSError * _Nullable error) {
// Handle error if it exists or interact with data written to disk
}]; Fetch a node by CID[IpfsLiteApi.instance getNodeForCid:@"QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D" completion:^(Node * _Nullable node, NSError * _Nullable error) {
// handle the node or error
}]; MaintainersContributingPRs accepted. Small note: If editing the README, please conform to the standard-readme specification. LicenseMIT (c) 2019 Textile |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论