Asynchronous IPFS API client
maddr (str) – The multiaddr for the IPFS daemon’s RPC API (this is the preferred method of specifying the node’s address)
host (str) – Hostname/IP of the IPFS daemon to connect to
port (int) – The API port of the IPFS deamon
conns_max (int) – Maximum HTTP connections for this client (default: 0)
conns_max_per_host (int) – Maximum per-host HTTP connections (default: 0)
read_timeout (int) – Socket read timeout
api_version' (str) – IPFS protocol version (‘v0’ by default)
debug (bool) – Enable client debugging traces
loop – force a specific asyncio event loop
Returns True if the node’s agent version is superior or equal to version
version (str) – a kubo (formerly called go-ipfs) version number e.g “0.14.0”
Show the current ledger for a peer.
peer (str) – peer id
Trigger reprovider.
Show some diagnostic information on the bitswap agent.
Remove a given block from your wantlist.
(this command has been deprecated it seems).
block (str) – Key(s) to remove from your wantlist
Show blocks currently on the wantlist.
peer (str) – Specify which peer to show wantlist for
Get a raw IPFS block.
cid (str) – The cid of an existing block to get
bytes
Store input as an IPFS block.
cid_codec (str) – Multicodec to use in returned CID
allow_big_block (bool) – Disable block size check and allow creation of blocks bigger than 1MiB
filepath (str) – The path to a file containing the data for the block
mhtype (str) – multihash hash function
mhlen (int) – multihash hash length
pin (bool) – pin block
Remove IPFS block(s).
cid (str) – The cid of an existing block to remove
force (bool) – Ignore nonexistent blocks
quiet (bool) – Write minimal output
Print information of a raw IPFS block.
cid (str) – The cid of an existing block to stat
Bootstrap API
Shows peers in the bootstrap list
Removes all peers in the bootstrap list
CID API
Format and convert a CID in various useful ways.
cid (str) – CID to convert
format (str) – Printf style format string
version (int) – CID version to convert to
multibase (str) – Multibase to display CID in
Configuration management API
Get or set IPFS config values
key (str) – The key of the config entry (e.g. “Addresses.API”)
value (str) – The value to set the config entry to
boolean (bool) – Set a boolean value
json (bool) – Parse stringified JSON
Apply profile to config
profile (str) – The profile to apply to the config
dry_run (bool) – print difference between the current config and the config that would be generated
Replaces the IPFS configuration with new config file
configpath (str) – new configuration’s file path
Outputs IPFS config file contents
Add a file or directory to ipfs.
This is an async generator yielding an IPFS entry for every file added.
The add_json, add_bytes and add_str coroutines support the same options
files – A list of files/directories to be added to the IPFS repository
recursive (bool) – Add directory paths recursively.
quiet (bool) – Write minimal output.
quieter (bool) – Write only final hash.
silent (bool) – Write no output.
progress (bool) – Stream progress data.
trickle (bool) – Use trickle-dag format for dag generation.
only_hash (bool) – Only chunk and hash - do not write to disk.
wrap_with_directory (bool) – Wrap files with a directory object.
pin (bool) – Pin this object when adding. Default: true.
raw_leaves (bool) – Use raw blocks for leaf nodes.
nocopy (bool) – Add the file using filestore.
fscache (bool) – Check the filestore for preexisting blocks.
offline (bool) – Offline mode (do not announce)
hidden (bool) – Include files that are hidden. Only takes effect on recursive add.
inline (bool) – Inline small blocks into CIDs
hash (str) – Hash function to use
inline_limit (int) – Maximum block size to inline
cid_version (int) – CID version
Add a file using given bytes as data.
data (bytes) – file data
Add a multiple-entry multipart, and yield the JSON message for every entry added. We use mjson_decode with the post method.
Add a JSON object
data (str) – json object
Add a single-entry multipart (used by add_{bytes,str,json})
Add a file using given string as data
data (str) – string data
codec (str) – input codec, default utf-8
Show IPFS object data.
path (str) – The path of the IPFS object to retrieve
offset (int) – byte offset to begin reading from
length (int) – maximum number of bytes to read
List all available commands.
Resolve DNS links
name (str) – domain name to resolve
recursive (bool) – Resolve until the result is not a DNS link.
Download IPFS objects.
path (str) – The path of the IPFS object to retrieve
dstdir (str) – destination directory, current directory by default
compress (bool) – Compress the output with GZIP compression
compression_level (str) – The level of compression (1-9)
archive (bool) – Output a TAR archive
Download IPFS objects (async generator)
objpath (str) – The base58 objpath of the object to retrieve
dstdir (str) – destination directory, current directory by default
compress (bool) – Compress the output with GZIP compression
compression_level (str) – The level of compression (1-9)
archive (bool) – Output a TAR archive
Show IPFS node id info.
peer (str) – peer id to look up, otherwise shows local node info
List directory contents for Unix filesystem objects.
path (str) – The path to the IPFS object(s) to list links from
headers (bool) – Print table headers (Hash, Size, Name)
resolve_type (bool) – Resolve linked objects to get their types
List directory contents for Unix filesystem objects (streamed)
path (str) – The path to the IPFS object(s) to list links from
headers (bool) – Print table headers (Hash, Size, Name)
resolve_type (bool) – Resolve linked objects to get their types
Send echo request packets to IPFS hosts.
peerid (str) – ID of peer to be pinged
count (int) – Number of ping messages to send
Resolve the value of names to IPFS
name (str) – The name to resolve
recursive (bool) – Resolve until the result is an IPFS name
dht_record_count (int) – Number of records to request for DHT resolution
dht_timeout (int) – Max time to collect values during DHT resolution eg “30s”. Pass 0 for no timeout
Shut down the ipfs daemon
Show ipfs version information
Shows information about dependencies used for build
DEPRECATED: This command is deprecated
DEPRECATED: This command is deprecated
DEPRECATED: This command is deprecated
DEPRECATED: This command is deprecated
DEPRECATED: This command is deprecated
List commands run on this IPFS node.
Set how long to keep inactive requests in the log.
Collect a performance profile for debugging.
TODO: support passing collectors as an array
Add references to IPFS files and directories in MFS (or copy within MFS).
Flush a given path’s data to disk.
Write to a mutable file in a given filesystem.
mfspath (str) – Path to write to
data – Data to write, can be a filepath or bytes data
offset (int) – Byte offset to begin writing at
create (bool) – Create the file if it does not exist
truncate (bol) – Truncate the file to size zero before writing
count (int) – Maximum number of bytes to read
cid_version (int) – CID version to use
hashfn (str) – Hash function to use. Will set Cid version to 1 if used. (experimental).
Export a keypair
name (str) – name of the key to export
output (str) – The path where the output should be stored
format (str) – The format of the private key to import, libp2p-protobuf-cleartext or pem-pkcs8-cleartext
Import a key and prints imported key id
keypath (str) – filepath of the key to import
name (str) – name to associate with key in keychain
ipns_base (str) – Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash
format (str) – The format of the private key to import, libp2p-protobuf-cleartext or pem-pkcs8-cleartext
allow_any_keytype (bool) – Allow importing any key type
Change logging level
subsystem (str) – The subsystem logging identifier. Use ‘all’ for all subsystems.
level (str) – The log level, with ‘debug’ the most verbose and ‘critical’ the least verbose. One of: debug, info, warning, error, critical. Required: yes.
List the logging subsystems
Read the event log.
…
Publish IPNS names
path (str) – ipfs path of the object to be published
resolve (bool) – Check if the given path can be resolved before publishing
lifetime (str) – Time duration that the record will be valid for. This accepts durations such as “300s”, “1.5h” or “2h45m”. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”.
key (str) – Name of the key to be used or a valid PeerID, as listed by ‘ipfs key list -l’.
allow_offline (bool) – When offline, save the IPNS record to the the local datastore without broadcasting to the network instead of simply failing
ttl (str) – Time duration this record should be cached for. Uses the same syntax as the lifetime option
quieter (bool) – Write only final hash
ipns_base (str) – Encoding used for keys: Can either be a multibase encoded CID or a base58btc encoded multihash
Resolve IPNS names.
name (str) – The IPNS name to resolve. Defaults to your node’s peerID
recursive (bool) – Resolve until the result is not an IPNS name
nocache (bool) – Do not use cached entries
dht_record_count (int) – Number of records to request for DHT resolution
dht_timeout (int) – Max time to collect values during DHT resolution eg “30s”. Pass 0 for no timeout
stream (bool) – Stream entries as they are found
Resolve IPNS names, streaming entries as they’re received (async generator)
Display the diff between two ipfs objects.
Add a link to a given object.
Append data to the data segment of a dag node.
Untested
Remove a link from an object.
Set the data field of an IPFS object.
Untested
P2P API.
Note: go-ipfs v0.4.18 introduced some changes in the P2P subsystem and some endpoints were renamed. Agent version detection is done in the affected API calls to maintain compatibility.
Dial to a P2P listener.
peer (str) – Remote Peer ID
protocol (str) – protocol identifier
address (str) – multiaddr to listen for connection/s (default: /ip4/127.0.0.1/tcp/0)
Dial to a P2P listener.
peer (str) – Remote Peer ID
protocol (str) – protocol identifier
address (str) – multiaddr to listen for connection/s (default: /ip4/127.0.0.1/tcp/0)
Open a P2P listener
protocol (str) – protocol name associated with the listener
address (str) – address for the listener, in multiaddr format
Close a previously opened P2P listener
protocol (str) – protocol name associated with the listener
all (bool) – if True, closes all listeners on the node
List P2P listeners
headers (bool) – print all headers (HandlerID, Protocol, …)
Open a P2P listener
protocol (str) – protocol name associated with the listener
address (str) – address for the listener, in multiaddr format
List P2P listeners
headers (bool) – print all headers (HandlerID, Protocol, …)
Close active P2P stream.
Dial to a P2P listener.
peer (str) – Remote Peer ID
protocol (str) – protocol identifier
address (str) – multiaddr to listen for connection/s (default: /ip4/127.0.0.1/tcp/0)
List active P2P streams.
List links (references) from an object.
Find the multiaddresses associated with a Peer ID.
peerid (str) – The ID of the peer to search for
verbose (bool) – Print extra information
Find peers that can provide a specific value, given a key.
key (str) – The key to find providers for
verbose (bool) – Print extra information
numproviders (int) – The number of providers to find. Default: 20
Given a key, query the routing system for its best value.
key (str) – The key to find providers for
verbose (bool) – Print extra information
Announce to the network that you are providing given values.
key (str) – The key[s] to send provide records for
verbose (bool) – Print extra information
recursive (bool) – Recursively provide entire graph
Write a key/value pair to the routing system.
key (str) – The key to store the value at
verbose (bool) – Print extra information
Streams the selected DAG as a .car stream on stdout.
cid (str) – CID of a root to recursively export
Import the contents of .car files
car – path to a .car archive or bytes object
silent (bool) – No output
pin_roots (bool) – Pin optional roots listed in the .car headers after importing
Get a DAG node from IPFS
objpath (str) – path of the object to fetch
output_codec (str) – Format that the object will be encoded as
Add a DAG node to IPFS
filename (str) – a path to the object to import
format (str) – format to use for the object inside IPFS
input_enc (str) – object input encoding
pin (bool) – pin the object after adding (default is False)
offline (bool) – Offline mode (no announce)
Resolve an IPLD block
path (str) – path to resolve
Gets stats for a DAG
cid (str) – CID of a DAG root to get statistics for
Decode multibase string
filepath (str) – Path to the file containing the data to encode
Encode data into multibase string
filepath (str) – Path to the file containing the data to encode
base (str) – multibase encoding. Default: base64url
List available multibase encodings
Transcode multibase string between bases
filepath (str) – Path to the file containing the data to transcode
base (str) – multibase encoding. Default: base64url
Pin objects to local storage.
path (str) – Path to object(s) to be pinned
recursive (bool) – Recursively pin the object linked to by the specified object(s)
progress (bool) – Show progress
List objects pinned to local storage.
path (str) – Path of object(s) to be listed
pintype (str) – The type of pinned keys to list. Can be “direct”, “indirect”, “recursive”, or “all”
quiet (bool) – Write just hashes of objects
stream (bool) – Enable streaming of pins as they are discovered
Remove pinned objects from local storage.
path (str) – Path of object(s) to be removed
recursive (bool) – Recursively unpin the object linked to by the specified object(s)
Update a recursive pin
old (str) – Path to old object
new (str) – Path to new object to be pinned
unpin (bool) – Remove the old pin
Verify that recursive pins are complete.
verbose (bool) – Also write the hashes of non-broken pins
quiet (bool) – Write just hashes of broken pins
Pin object to remote pinning service.
service (str) – Service name
objPath (str) – Path to object(s) to be pinned
name (str) – An optional name for the pin
background (bool) – Add to the queue on the remote service and return immediately (does not wait for pinned status) Default: false
List objects pinned to remote pinning service.
service (str) – Name of the remote pinning service to use
name (str) – Return pins with names that contain the value provided (case-sensitive, exact match)
cid (list) – Return pins for the specified CIDs
status (list) – Return pins with the specified statuses (queued,pinning,pinned,failed). Default: [pinned]
Remove pins from remote pinning service.
service (str) – Name of the remote pinning service to use
name (str) – Return pins with names that contain the value provided (case-sensitive, exact match)
cid (list) – Return pins for the specified CIDs
status (list) – Return pins with the specified statuses (queued,pinning,pinned,failed). Default: [pinned]
force (bool) – Allow removal of multiple pins matching the query without additional confirmation. Default: false
Add remote pinning service.
service (str) – Service name
endpoint (str) – Service endpoint
key (str) – Service key
List remote pinning services.
stat (bool) – Try to fetch and display current pin count on remote service (queued/pinning/pinned/failed)
Remove remote pinning service.
service (str) – Service name
List known addresses. Useful for debugging.
List interface listening addresses.
List local addresses.
Open connection to a given address.
peer (str) – address of peer to connect to
Close connection to a given address.
peer (str) – address of peer to disconnect from
Add an address filter.
filter (str) – Multiaddr to filter
Remove an address filter.
filter (str) – Multiaddr filter to remove
Get or set resource limits for a scope
filepath (str) – path to the (JSON) file containing the limits
scope (str) – scope of the limit
List peers with open connections.
verbose (bool) – display all extra information
streams (bool) – Also list information about open streams for each peer
latency (bool) – Also list information about latency to each peer
direction (bool) – Also list information about the direction of connection
Report resource usage for a scope
scope (str) – scope of the stat report
Add peers into the peering subsystem.
peer (str) – address of peer to add into the peering subsystem
List peers registered in the peering subsystem.
Remove a peer from the peering subsystem.
peer (str) – ID of peer to remove from the peering subsystem
Bases: Exception
IPFS API error
code (int) – IPFS error code
message (str) – Error message
http_status (int) – HTTP status code
message (str) – Error message string returned by kubo
bool
Bases: APIError
Exception for when a RPC endpoint is not found (HTTP 404)
Bases: Exception
Bases: APIError
Invalid CID or selected encoding not supported
message (str) – Error message string returned by kubo
bool
Bases: Exception
Bases: Exception
Invalid pubsub message encoding error
Bases: APIError
IPNS key errors
message (str) – Error message string returned by kubo
bool
Bases: APIError
No link by that name
message (str) – Error message string returned by kubo
bool
Bases: APIError
Content not pinned or pinned indirectly
message (str) – Error message string returned by kubo
bool