paul-freeman / elm-ipfs / Ipfs

Writing to IPFS

add : String -> String -> Task Http.Error File

Store a string as a content-addressable file on IPFS.

Ipfs files and hashes


type File

Represents a content-addressable (immutable) file, stored on IPFS.


type Hash

A hash value representing the address of a file on IPFS.

hash : String -> Maybe Hash

Turn an IPFS hash string into the suitable type for retrieving a file.

getHash : File -> Hash

Get the hash value from a File data structure.

Reading from IPFS

cat : String -> Hash -> Task Http.Error String

Retrieve a string from a content-addressable file on IPFS.

version : String -> Task Http.Error String

Retrieve the version information for the IPFS node.

Helpers

postGeneric : { url : String, body : Http.Body, resolver : String -> Result String a } -> Task Http.Error a

A general method for posting information to IPFS.

getGeneric : { url : String, resolver : String -> Result String a } -> Task Http.Error a

A general method for getting information from IPFS.

generic : { method : String, url : String, body : Http.Body, resolver : String -> Result String a } -> Task Http.Error a

If you want to implement your own custom IPFS calls, this might get you started.