ipfsapi 0.4.0

Crate for interfacing with the IPFS api
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::IpfsApi;
use std::error::Error;

impl IpfsApi {
    /// Publish an IPFS hash in IPNS.
    pub fn name_publish(&self, hash: &str) -> Result<(), Box<dyn Error>> {
        let endpoint = "api/v0/name/publish";
        let url = format!("http://{}:{}/{}", self.server, self.port, endpoint);
        ureq::post(&url).query("arg", hash).call()?;

        Ok(())
    }
}