{"id":13732137,"url":"https://github.com/textileio/ios-ipfs-lite","last_synced_at":"2025-07-26T11:32:16.423Z","repository":{"id":36169058,"uuid":"220370932","full_name":"textileio/ios-ipfs-lite","owner":"textileio","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-06T07:59:50.000Z","size":5415,"stargazers_count":61,"open_issues_count":6,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T06:01:10.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/textileio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-08T02:31:59.000Z","updated_at":"2024-02-20T12:09:46.000Z","dependencies_parsed_at":"2022-08-30T06:01:18.563Z","dependency_job_id":null,"html_url":"https://github.com/textileio/ios-ipfs-lite","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textileio%2Fios-ipfs-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textileio%2Fios-ipfs-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textileio%2Fios-ipfs-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textileio%2Fios-ipfs-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/textileio","download_url":"https://codeload.github.com/textileio/ios-ipfs-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227673973,"owners_count":17802303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:47.333Z","updated_at":"2024-12-02T05:15:40.464Z","avatar_url":"https://github.com/textileio.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"# ios-ipfs-lite\n\n[![Made by Textile](https://img.shields.io/badge/made%20by-Textile-informational.svg?style=flat-square)](https://textile.io)\n[![Chat on Slack](https://img.shields.io/badge/slack-slack.textile.io-informational.svg?style=flat-square)](https://slack.textile.io)\n[![GitHub license](https://img.shields.io/github/license/textileio/ios-ipfs-lite.svg?style=flat-square)](./LICENSE)\n[![Release](https://img.shields.io/github/release/textileio/ios-ipfs-lite.svg?style=flat-square)](https://github.com/textileio/ios-ipfs-lite/releases/latest)\n[![Version](https://img.shields.io/cocoapods/v/IpfsLiteApi.svg?style=flat)](https://cocoapods.org/pods/IpfsLiteApi)\n[![License](https://img.shields.io/cocoapods/l/IpfsLiteApi.svg?style=flat)](https://cocoapods.org/pods/IpfsLiteApi)\n[![Platform](https://img.shields.io/cocoapods/p/IpfsLiteApi.svg?style=flat)](https://cocoapods.org/pods/IpfsLiteApi)\n[![CircleCI branch](https://img.shields.io/circleci/project/github/textileio/ios-ipfs-lite/master.svg?style=flat-square)](https://circleci.com/gh/textileio/ios-ipfs-lite)\n[![docs](https://img.shields.io/badge/docs-master-success.svg?style=popout-square)](https://textileio.github.io/ios-ipfs-lite/)\n[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n\n\u003e A lightweight, extensible IPFS peer for iOS.\n\nIPFS 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](https://github.com/hsanjuan/ipfs-lite) library.\n\n## Table of Contents\n\n- [ios-ipfs-lite](#ios-ipfs-lite)\n  - [Table of Contents](#table-of-contents)\n  - [Background](#background)\n    - [IPFS-lite Libraries](#ipfs-lite-libraries)\n  - [Roadmap](#roadmap)\n  - [Install](#install)\n  - [Usage](#usage)\n    - [Initialize and start a Peer](#initialize-and-start-a-peer)\n    - [Add data](#add-data)\n    - [Add a file](#add-a-file)\n    - [Fetch a file by CID to a NSOutputStream](#fetch-a-file-by-cid-to-a-nsoutputstream)\n    - [Fetch a node by CID](#fetch-a-node-by-cid)\n  - [Maintainers](#maintainers)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Background\n\nIPFS Lite runs the minimal setup required to provide a DAG service. It is a port of the [Go IPFS Lite](https://github.com/hsanjuan/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.\n\n### IPFS-lite Libraries\n\n\u003e The following includes information about support for ipfs-lite.\n\n| Name | Build | Language | Description |\n|:---------|:---------|:---------|:---------|\n| [`ipfs-lite`](https://github.com/hsanjuan/ipfs-lite) | [![Build Status](https://img.shields.io/travis/hsanjuan/ipfs-lite.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/hsanjuan/ipfs-lite) | [![golang](https://img.shields.io/badge/golang-blueviolet.svg?style=popout-square)](https://github.com/hsanjuan/ipfs-lite) | The reference implementaiton of ipfs-lite, written in Go. |\n| [`js-ipfs-lite`](//github.com/textileio/js-ipfs-lite) | [![Build status](https://img.shields.io/github/workflow/status/textileio/js-ipfs-lite/Test/master.svg?style=popout-square)](https://github.com/textileio/js-ipfs-lite/actions?query=branch%3Amaster) | [![javascript](https://img.shields.io/badge/javascript-blueviolet.svg?style=popout-square)](https://github.com/textileio/js-ipfs-lite)| The Javascript version of ipfs-lite available for web, nodejs, and React Native applications. |\n| [`ios-ipfs-lite`](//github.com/textileio/ios-ipfs-lite) | [![Build status](https://img.shields.io/circleci/project/github/textileio/ios-ipfs-lite/master.svg?style=flat-square)](https://github.com/textileio/ios-ipfs-lite/actions?query=branch%3Amaster) | [![objc](https://img.shields.io/badge/objc-blueviolet.svg?style=popout-square)](https://github.com/textileio/ios-ipfs-lite)| The iOS ipfs-lite library for use in Objc and Swift apps |\n| [`android-ipfs-lite`](//github.com/textileio/android-ipfs-lite) | [![Build status](https://img.shields.io/circleci/project/github/textileio/android-ipfs-lite/master.svg?style=flat-square)](https://github.com/textileio/android-ipfs-lite/actions?query=branch%3Amaster) | [![java](https://img.shields.io/badge/java-blueviolet.svg?style=popout-square)](https://github.com/textileio/android-ipfs-lite)| The Java ipfs-lite library for us in Android apps |\n| [`grpc-ipfs-lite`](//github.com/textileio/grpc-ipfs-lite) | [![Build status](https://img.shields.io/circleci/project/github/textileio/grpc-ipfs-lite/master.svg?style=flat-square)](https://github.com/textileio/grpc-ipfs-lite/actions?query=branch%3Amaster) | [![java](https://img.shields.io/badge/grpc--api-blueviolet.svg?style=popout-square)](https://github.com/textileio/grpc-ipfs-lite)| A common gRPC API interface that runs on the Go ipfs-lite node. |\n\n## Roadmap\n\n- [x] Launch IPFS Lite\n- [x] Stop IPFS Lite\n- [x] `addFileFromInput:params:completion:` Add data via `NSInputStream`.\n- [x] `getFileWithCid:completion:` Asynchronously get file by content address.\n- [x] `getFileToOutput:cid:completion:` Asynchronously get file by content address and write it to a `NSOutputStream`\n- [x] `getNodeForCid:completion:` Asynchronously get an IPLD node from IPFS.\n- [x] `getNodesForCids:completion:` Get multiple IPLD nodes.\n- [x] `hasBlock:completion:` Query if the local peer has the specified block\n- [x] `removeNodeForCid:completion:` Remove an IPLD node.\n- [x] `removeNodesForCids:completion:` Remove multiple IPLD nodes.\n- [x] `resolveLinkInNodeWithCid:path:completion:` Resolve a link though a path in an IPLD node.\n- [x] `treeInNodeWithCid:fromPath:depth:completion:` List all data paths in an IPLD node.\n- [ ] `addNode` And an IPLD node.\n- [ ] `addNodes` And multiple IPLD nodes.\n\n\n## Install\n\nThe IPFS Lite library is published as a Cocoapod.\n\nFirst, you'll need to [configure your project to use Cocoapods](https://guides.cocoapods.org/using/getting-started.html#getting-started).\n\nThen, simple add `IpfsLiteApi` to your `Podfile`\n\n```cmd\n...\npod 'IpfsLiteApi'\n...\n```\n\nand run `pod install`\n\n## Usage\n\n### Initialize and start a Peer\n\n```objc\nNSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];\nNSString *repoPath = [documents stringByAppendingPathComponent:@\"ipfs-lite\"];\nNSError *error;\nBOOL success = [IpfsLiteApi launch:repoPath debug:false lowMem: true error:\u0026error];\n```\n\n### Add data\n\n```objc\nNSInputStream *input = [[NSInputStream alloc] initWithData:[@\"Hello there\\n\" dataUsingEncoding:NSUTF8StringEncoding]];\n[IpfsLiteApi.instance addFileFromInput:input parms:[[TTEAddParams alloc] init] completion:^(Node * _Nullable node, NSError * _Nullable error) {\n    // handle the node or error\n}];\n```\n\n### Add a file\n\n```objc\nNSString *path = [[NSBundle mainBundle] pathForResource:@\"test\" ofType:@\"jpeg\"];\nNSInputStream *input = [[NSInputStream alloc] initWithFileAtPath:path];\n[IpfsLiteApi.instance addFileFromInput:input params:[[TTEAddParams alloc] init] completion:^(Node * _Nullable node, NSError * _Nullable error) {\n    // handle the node or error\n}];\n```\n\n### Fetch a file by CID to a NSOutputStream\n\n```objc\nNSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];\nNSString *outputPath = [documents stringByAppendingPathComponent:@\"out.jpeg\"];\nNSOutputStream *output = [NSOutputStream outputStreamToFileAtPath:outputPath append:NO];\n[IpfsLiteApi.instance getFileToOutput:output cid:@\"\u003ca-file-cid\u003e\" completion:^(NSError * _Nullable error) {\n    // Handle error if it exists or interact with data written to disk\n}];\n```\n\n### Fetch a node by CID\n\n```objc\n[IpfsLiteApi.instance getNodeForCid:@\"QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D\" completion:^(Node * _Nullable node, NSError * _Nullable error) {\n    // handle the node or error\n}];\n```\n\n## Maintainers\n\n[Aaron Sutula](https://github.com/asutula)\n\n## Contributing\n\nSee [the contributing file](CONTRIBUTING.md)!\n\nPRs accepted.\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\n[MIT](LICENSE) (c) 2019 Textile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextileio%2Fios-ipfs-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftextileio%2Fios-ipfs-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextileio%2Fios-ipfs-lite/lists"}