Skip to content

Latest commit

 

History

History
204 lines (147 loc) · 7 KB

File metadata and controls

204 lines (147 loc) · 7 KB

Table of Contents generated with DocToc

API Reference

We classify the API calls by 'core', 'extensions', 'tooling', and 'network', following the same API spec organization available at ipfs/specs.

The tests folder also contains great examples that can be used to understand how this client library interacts with the HTTP-API. You can find the tests here.

Core

version([callback])

id([callback])

block

block.put(buffer, [callback])
block.get(hash, [callback])
block.stat(hash, [callback])

object

object.put(buffer, encoding, [callback])
object.get(hash, [callback])
object.data(hash, [callback])
object.stat(hash, [callback])
object.links(hash, [callback])
object.new(hash, [callback])
object.patch
object.patch.addLink(hash, name, ref, [callback])
object.patch.rmLink(hash, name, [callback])
object.patch.setData(hash, data, [callback])
object.patch.appendData(hash, data, ref, [callback])

refs(hash, options, [callback])

refs.local(hash, [callback])

pin

pin.add(hash, options, [callback])
pin.remove(hash, options, [callback])
pin.list(hash, options, [callback])

log

log.tail([callback])

Extensions

add(arrayOrBufferOrStream, [callback])

name

name.publish(hash, [callback])
name.resolve(hash, [callback])

files

files.cp(src, target, [callback])
files.ls(folder, [callback])
files.mkdir(folder, [options, callback])
files.stat(fileOrFolder, [callback])
files.rm(fileOrFolder, [options, callback])
files.read(fileOrFolder, [callback])
files.write(file, bufferOrArray, [options, callback])
files.mv(src, target, [callback])

mount(ipfs, ipns, [callback])

Tooling

commands([callback])

update

update.apply([callback])
update.check([callback])
update.log([callback])

diag

diag.net([callback])
diag.sys([callback])
diag.cmds([callback])

Network

ping(id, [callback])

dht

dht.findprovs([callback])
dht.get(key, [options, callback])
dht.put(key, value, [options, callback])

swarm

swarm.peers([callback])
swarm.connect(address, [callback])