-
-
Save rob-deutsch/2a865aea11e05064d2b6e208d787a6bb to your computer and use it in GitHub Desktop.
ipfs commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add Add a file or directory to ipfs. | |
bitswap Interact with the bitswap agent. | |
ledger Show the current ledger for a peer. | |
reprovide Trigger reprovider. | |
stat Show some diagnostic information on the bitswap agent. | |
wantlist Show blocks currently on the wantlist. | |
block Interact with raw IPFS blocks. | |
get Get a raw IPFS block. | |
put Store input as an IPFS block. | |
rm Remove IPFS block(s). | |
stat Print information of a raw IPFS block. | |
bootstrap Show or edit the list of bootstrap peers. | |
add Add peers to the bootstrap list. | |
default Add default peers to the bootstrap list. | |
list Show peers in the bootstrap list. | |
rm Remove peers from the bootstrap list. | |
all Remove all peers from the bootstrap list. | |
cat Show IPFS object data. | |
commands List all available commands. | |
config Get and set ipfs config values. | |
edit Open the config file for editing in $EDITOR. | |
profile Apply profiles to config. | |
apply Apply profile to config. | |
replace Replace the config with <file>. | |
show Output config file contents. | |
dag Interact with ipld dag objects. | |
get Get a dag node from ipfs. | |
put Add a dag node to ipfs. | |
resolve Resolve ipld block | |
dht Issue commands directly through the DHT. | |
findpeer Find the multiaddresses associated with a Peer ID. | |
findprovs Find peers that can provide a specific value, given a key. | |
get Given a key, query the routing system for its best value. | |
provide Announce to the network that you are providing given values. | |
put Write a key/value pair to the routing system. | |
query Find the closest Peer IDs to a given Peer ID by querying the DHT. | |
diag Generate diagnostic reports. | |
cmds List commands run on this IPFS node. | |
clear Clear inactive requests from the log. | |
set-time Set how long to keep inactive requests in the log. | |
sys Print system diagnostic information. | |
dns Resolve DNS links. | |
file Interact with IPFS objects representing Unix filesystems. | |
ls List directory contents for Unix filesystem objects. | |
files Interact with unixfs files. | |
chcid Change the cid version or hash function of the root node of a given path. | |
cp Copy files into mfs. | |
flush Flush a given path's data to disk. | |
ls List directories in the local mutable namespace. | |
mkdir Make directories. | |
mv Move files. | |
read Read a file in a given mfs. | |
rm Remove a file. | |
stat Display file status. | |
write Write to a mutable file in a given filesystem. | |
filestore Interact with filestore objects. | |
dups List blocks that are both in the filestore and standard block storage. | |
ls List objects in filestore. | |
verify Verify objects in filestore. | |
get Download IPFS objects. | |
id Show ipfs node id info. | |
key Create and list IPNS name keypairs | |
gen Create a new keypair | |
list List all local keypairs | |
rename Rename a keypair | |
rm Remove a keypair | |
log Interact with the daemon log output. | |
level Change the logging level. | |
ls List the logging subsystems. | |
tail Read the event log. | |
ls List directory contents for Unix filesystem objects. | |
mount Mounts IPFS to the filesystem (read-only). | |
name Publish and resolve IPNS names. | |
publish Publish IPNS names. | |
pubsub IPNS pubsub management | |
cancel Cancel a name subscription | |
state Query the state of IPNS pubsub | |
subs Show current name subscriptions | |
resolve Resolve IPNS names. | |
object Interact with IPFS objects. | |
data Output the raw bytes of an IPFS object. | |
diff Display the diff between two ipfs objects. | |
get Get and serialize the DAG node named by <key>. | |
links Output the links pointed to by the specified object. | |
new Create a new object from an ipfs template. | |
patch Create a new merkledag object based on an existing one. | |
add-link Add a link to a given object. | |
append-data Append data to the data segment of a dag node. | |
rm-link Remove a link from an object. | |
set-data Set the data field of an IPFS object. | |
put Store input as a DAG object, print its key. | |
stat Get stats for the DAG node named by <key>. | |
p2p Libp2p stream mounting. | |
close Stop listening for new connections to forward. | |
forward Forward connections to libp2p service | |
listen Create libp2p service | |
ls List active p2p listeners. | |
stream P2P stream management. | |
close Close active p2p stream. | |
ls List active p2p streams. | |
pin Pin (and unpin) objects to local storage. | |
add Pin objects to local storage. | |
ls List objects pinned to local storage. | |
rm Remove pinned objects from local storage. | |
update Update a recursive pin | |
verify Verify that recursive pins are complete. | |
ping Send echo request packets to IPFS hosts. | |
pubsub An experimental publish-subscribe system on ipfs. | |
ls List subscribed topics by name. | |
peers List peers we are currently pubsubbing with. | |
pub Publish a message to a given pubsub topic. | |
sub Subscribe to messages on a given topic. | |
refs List links (references) from an object. | |
local List all local references. | |
repo Manipulate the IPFS repo. | |
fsck Remove repo lockfiles. | |
gc Perform a garbage collection sweep on the repo. | |
stat Get stats for the currently used repo. | |
verify Verify all blocks in repo are not corrupted. | |
version Show the repo version. | |
resolve Resolve the value of names to IPFS. | |
shutdown Shut down the ipfs daemon | |
stats Query IPFS statistics. | |
bitswap Show some diagnostic information on the bitswap agent. | |
bw Print ipfs bandwidth information. | |
repo Get stats for the currently used repo. | |
swarm Interact with the swarm. | |
addrs List known addresses. Useful for debugging. | |
listen List interface listening addresses. | |
local List local addresses. | |
connect Open connection to a given address. | |
disconnect Close connection to a given address. | |
filters Manipulate address filters. | |
add Add an address filter. | |
rm Remove an address filter. | |
peers List peers with open connections. | |
tar Utility functions for tar files in ipfs. | |
add Import a tar file into ipfs. | |
cat Export a tar file from IPFS. | |
update | |
urlstore | |
add Add URL via urlstore. | |
version Show ipfs version information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sort" | |
"strings" | |
cmds "gx/ipfs/QmPXR4tNdLbp8HsZiPMjpsgqphX9Vhw2J6Jh5MKH2ovW3D/go-ipfs-cmds" | |
"github.com/ipfs/go-ipfs/core/commands" | |
) | |
func main() { | |
printSubCommands("", commands.RootSubcommands) | |
} | |
func printSubCommands(prefix string, commands map[string]*cmds.Command) { | |
theList := sortCommands(commands) | |
maxName := theList.MaxNameSize() | |
for _, nc := range theList { | |
spaces := strings.Repeat(" ", maxName-len(nc.name)+2) | |
fmt.Println(prefix, nc.name, spaces, nc.command.Helptext.Tagline) | |
printSubCommands(prefix+" ", nc.command.Subcommands) | |
} | |
} | |
type commandList []struct { | |
name string | |
command *cmds.Command | |
} | |
func sortCommands(commands map[string]*cmds.Command) commandList { | |
theList := make(commandList, len(commands)) | |
idx := 0 | |
for name, command := range commands { | |
theList[idx].name = name | |
theList[idx].command = command | |
idx++ | |
} | |
sort.Sort(theList) | |
return theList | |
} | |
// Len is the number of elements in the collection. | |
func (cl commandList) Len() int { | |
return len(cl) | |
} | |
// Less reports whether the element with | |
// index i should sort before the element with index j. | |
func (cl commandList) Less(i, j int) bool { | |
return cl[i].name < cl[j].name | |
} | |
// Swap swaps the elements with indexes i and j. | |
func (cl commandList) Swap(i, j int) { | |
cl[i], cl[j] = cl[j], cl[i] | |
} | |
func (cl commandList) MaxNameSize() int { | |
maxSize := 0 | |
for _, item := range cl { | |
if len(item.name) > maxSize { | |
maxSize = len(item.name) | |
} | |
} | |
return maxSize | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment