Skip to content
Rust crate for interfacing with the IPFS API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Added license and readme Oct 10, 2017 Release version 0.2.2 May 11, 2018

Rust IPFS API Client

A client library for the IPFS API.

This library allows you to use the local IPFS daemon from Rust.


ipfsapi = "0.2"


Reading a file from IPFS

Here's an example that gets the contents of a file from IPFS and displays it.

let api = IpfsApi::new("", 5001);

let bytes ="QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u").unwrap();
let data = String::from_utf8(bytes.collect()).unwrap();

println!("{}", data);

The code gets the content of the IPFS hash and displays "Hello World".

Subsribing to messages on IPFS Pubsub

let api = IpfsApi::new("", 5001);

let messages = api.pubsub_subscribe("chat").unwrap();

for message in messages {
    println!("{:?}", message);

Implemented Functionality

  • Getting file contents from IPFS (cat)
  • Pubsub
  • IPNS publish and resolve
  • Object/Hash stats (size, etc.)
  • Version information of the daemon
  • Pinning and unpinning files
  • Shut down IPFS daemon
  • Get and put blocks
You can’t perform that action at this time.