Latest 0.2.0
License MIT
Platforms ios 8.0
Dependencies Moya


A wrapper of the IPFS Client HTTP-API for iOS.

CI Status

Check out the client API reference for the full command reference.


To run the example project, clone the repo, and run pod install from the Example directory first.

    import Ipfs


    //Default base address: ""

    //Do nothing...
    Ipfs.shared().setBase(address: "http://your.ipfs.address")
    Ipfs.shared().setBase(address: "http://your.ipfs.address", port: 5001)
    Ipfs.shared().setBase(address: "http://your.ipfs.address", port: 5001, apiVersionPath: "/api/v0")



  • iOS 8.0+
  • Xcode 9.3+
  • Swift 4.1+


IpfsApi is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'IpfsApi'

Test environment setup

Docker usage(

An IPFS docker image is hosted at
To make files visible inside the container you need to mount a host directory
with the -v option to docker. Choose a directory that you want to use to
import/export files from IPFS. You should also choose a directory to store
IPFS files that will persist when you restart the container.

export ipfs_staging=</absolute/path/to/somewhere/>
export ipfs_data=</absolute/path/to/somewhere_else/>

Start a container running ipfs and expose ports 4001, 5001 and 8080:

docker run -d --name ipfs_host -v $ipfs_staging:/export -v 
    $ipfs_data:/data/ipfs -p 4001:4001 -p 
    -p ipfs/go-ipfs:latest

Watch the ipfs log:

docker logs -f ipfs_host

Wait for ipfs to start. ipfs is running when you see:

Gateway (readonly) server
listening on /ip4/

You can now stop watching the log.

Run ipfs commands:

docker exec ipfs_host ipfs <args...>

For example: connect to peers

docker exec ipfs_host ipfs swarm peers

Add files:

cp -r <something> $ipfs_staging
docker exec ipfs_host ipfs add -r /export/<something>

Stop the running container:

docker stop ipfs_host


kjaylee, [email protected]


IpfsApi is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "IpfsApi",
    "version": "0.2.0",
    "summary": "A wrapper of the IPFS Client HTTP-API for iOS.",
    "module_name": "Ipfs",
    "description": "A client library for the IPFS HTTP API, implemented in Swift. Check out IPFS Docs( for the full command reference.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "kjaylee": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.2.0"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "swift_version": "4.1",
    "source_files": "IpfsApi/Classes/*.swift",
    "dependencies": {
        "Moya": [
            "~> 11.0"

Pin It on Pinterest

Share This