ipfs命令大全

Global p2p merkle-dag filesystem.
命令 參數 英文註釋 中文註釋 命令描述 官方鏈接


ipfs(通用可以附加在一些命令前面的)


-c --config string - Path to the configuration file to use. 指定所使用的配置文件
-D --debug bool - Operate in debug mode. Default: false. 是否是調試模式
-L --local bool - Run the command locally, instead of using the daemon. Default: false. 是否使用後臺模式運行,默認false
--api string - Use a specific API instance (defaults to /ip4/127.0.0.1/tcp/5001). 指定使用特定的API實例地址,通過這個可以訪問WebUi


add 添加文件或者目錄到IPFS網絡

https://ipfs.io/docs/commands/#ipfs-add


-r --recursive bool - Add directory paths recursively. Default: false. 是否遞歸添加
-q --quiet bool - Write minimal output. 是否最小輸出
-Q --quieter bool - Write only final hash. 是否是隻寫入hash
-t --trickle bool - Use trickle-dag format for dag generation. 使用 trickle-dag 格式算法生成DAG
-n --only-hash bool - Only chunk and hash - do not write to disk. 僅僅出快和hash,不寫入磁盤
-w --wrap-with-directory bool - Wrap files with a directory object. 使用目錄對象來包裝文件
-H - Include files that are hidden. Only takes effect on recursive add. 是否添加隱藏文件,只有在遞歸的時候纔有用
-s Chunking algorithm to use. 指定分塊算法
-pin Pin this object when adding. Default: true. 是否持久化(不被垃圾回收所回收)在添加的時候,默認是true
--raw-leaves Use raw blocks for leaf nodes. (experimental). 實驗中的參數。爲葉子節點使用原始塊
--nocopy Add the file using filestore. (experimental). 使用filestore存儲文件
--fscache Check the filestore for pre-existing blocks. (experimental). 檢測filestore是否已經存在了數據塊

bitswap 同本地bitswap代理交互


ipfs bitswap ledger <peer> Show the current ledger for a peer. 顯示當前節點的分類賬目信息
ipfs bitswap stat Show some diagnostic information on the bitswap agent. 顯示當前bitswap的統計信息
ipfs bitswap wantlist Show blocks currently on the wantlist. 顯示當前想要列表的區塊
ipfs bitswap unwant <key> Remove a given block from your wantlist. 移除想要列表

ipfs block

block Interact with raw IPFS blocks. 'ipfs block' is a plumbing command used to manipulate raw IPFS blocks. Reads from stdin or writes to stdout, and <key> is a base58 encoded multihash.


ipfs block get Get a raw IPFS block. 獲取原始ipfs塊信息
ipfs block put <data> Store input as an IPFS block. 把輸入作爲一個ipfs塊
ipfs block stat <key> Print information of a raw IPFS block. 打印ipfs 塊統計信息

bootstrap Show or edit the list of bootstrap peers. 這系列命令顯示或者編輯ipfs啓動節點信息

ipfs bootstrap add <peer> Add peers to the bootstrap list. 把節點加入啓動列表,這個命令已經過時,使用 ipfs bootstrap add default 代替
ipfs bootstrap list Show peers in the bootstrap list 顯示已有節點列表信息
ipfs bootstrap rm Remove peers from the bootstrap list. 移除啓動節點
ipfs bootstrap rm all Remove all peers from the bootstrap list 移除所有啓動列表信息

cat Show IPFS object data. 這系列命令顯示IPFS對象信息

commands List all available commands. 列出所有可用命令
config Get and set ipfs config values. 這個系列命令。設置和獲取IPFS配置值


ipfs config edit Open the config file for editing in $EDITOR. 打開配置文件並進入編輯模式
ipfs config replace Replace the config with <file>. 使用配置文件替換目前的配置文件
ipfs config show Output config file contents. 顯示目前已有ipfs配置信息

daemon Run a network-connected IPFS node. 這系列命令。啓動一個連接到ipfs公共節點的連接 https://ipfs.io/docs/commands/#ipfs-daemon


ipfs daemon --init Initialize ipfs with default settings if not already initialized. Default: false. 如果節點沒有init過,直接init之後啓動
ipfs daemon --routing Overrides the routing option. Default: dht. 覆蓋默認的路由協議,默認dht
ipfs daemon --mount Mounts IPFS to the filesystem. 掛在IPFS到默認文件系統,默認:false
ipfs daemon --writable Enable writing objects 是否開啓可寫模式

dag Interact with ipld dag objects. 這個系列命令用來和dag對象交互


ipfs dag get <ref> Get a dag node from ipfs. 從ipfs獲取一個dag節點
ipfs dag put <object data> accepts input from a file or stdin and parses it into an object of the specified format 從文件或者標準輸入獲取數據轉換爲指定格式對象並且添加一個dag節點到ipfs

ipfs dht 和DHT相關的命令


ipfs dht findpeer 例如:ipfs dht findpeer . Query the DHT for all of the multiaddresses associated with a Peer ID. 查詢和節點ID相關聯的多地址的所有DHT信息
ipfs dht findprovs Find peers in the DHT that can provide a specific value, given a key. 在DHT網絡中找到有指定值的節點
ipfs dht get Given a key, query the DHT for its best value. 在DHT網絡中,給定一個key,找到這個key對應的值
ipfs dht provide Announce to the network that you are providing given values. 廣播給網絡說自己提供了某個值
ipfs dht put Write a key/value pair to the DHT. 往dht網絡中寫入key-value值
ipfs dht query Find the closest Peer IDs to a given Peer ID by querying the DHT. 查詢指定節點附近的節點

diag 這個系列命令是用來診斷的


ipfs diag cmds Lists running and recently run commands. 列出所有最近運行的命令
ipfs diag cmds clear Clear inactive requests from the log 清除最近運行的命令列表
ipfs diag cmds set-time Set how long to keep inactive requests in the log. 設置交互命令請求多長在log中保留
ipfs diag sys Print system diagnostic information 打印診斷社區


ipfs dns To create memorable aliases for multihashes, DNS TXT records can point to other DNS links, IPFS objects, IPNS keys, etc. This command resolves those links to the referenced object. 創建一個方便記憶的別名爲ipfs的多個hash地址。DNS text 可以指向其他dns鏈接,ipfs對象,ipfs 的key值等


ipfs file Interact with IPFS objects representing Unix filesystems. 和ipfs對象交互,返回unix格式系統路徑格式
ipfs file ls List directory contents for Unix filesystem objects. 列出ipfs對象,如果是ipfs對象,則列出文件大小,如果是目錄,列出目錄下的文件
ipfs files Interact with unixfs files. 和系統文件交互。這類的命令都可以加上--flush參數,代表立即寫入,默認爲true,如果不加,會有數據丟失的風險對於大的數據文件。如果設置爲false,可以提高性能。還有如果正在運行 ipfs repo gc 也有可能丟失數據的風險。

ipfs files cp 複製
ipfs files flush 把數據落盤
ipfs files ls 列出路徑下的文件
ipfs files mkdir 創建文件夾
ipfs files mv 移動文件夾
ipfs files read
ipfs files rm 刪除文件
ipfs files stat 統計文件狀態
ipfs files write 寫入文件


ipfs filestore 和文件對象交互


ipfs filestore dups List blocks that are both in the filestore and standard block storage. 列出filestore和塊存儲中的塊
ipfs filestore ls List objects in filestore. 列出在filestore中的對象
ipfs filestore verify Verify objects in filestore. 驗證在filestore中的對象
ipfs get Download IPFS objects. 下載IPFS對象
ipfs id Show ipfs node id info. 顯示IPFS節點信息


ipfs init 初始化ipfs配置文件,默認在本地~/.ipfs 作爲ipfs路徑,也可以自定義 export IPFS_PATH=/path/to/ipfsrepo


ipfs key Create and list IPNS name keypairs 創建和列出ipns相關的key
ipfs key gen Create a new keypair 創建key
ipfs key list List all local keypairs 列出所有本地key


ipfs log Interact with the daemon log output. 列出ipfs守護進程日誌
ipfs log level 改變守護進程的日誌級別
ipfs log ls is a utility command used to list the logging subsystems of a running daemon. 列出IPFS運行l 守護進程的log子系統
ipfs log tail 實時輸出日誌


ipfs ls Displays the contents of an IPFS or IPNS object(s) at the given path, 列出指定目錄下的內容
ipfs mount 掛在ipfs到文件系統。默認情況下/ipfs and /ipns,被掛在由於系統文件指定,使用這個選項可以更改和覆蓋默認的。

ipfs name
ipfs name publish 每次上傳新的文件夾後,得到的Hash均不同,這給訪問帶來了很大的不便。爲了解決這個問題,在持有私鑰的情況下可以把fs Hash publish到一個和公鑰相關的地址keyHash,這樣,用戶就可以用keyHash來訪問不同的內容,而不用擔心內容版本的變化
ipfs name resolve 解析
ipfs object 和對象交互有關的命令
ipfs object data 輸出存放在dag節點的IPFS對象字節
ipfs object diff 比較IFPS對象的異同
ipfs object get Get and serialize the DAG node named by <key>. 得到並且序列化使用key標記的dag節點的名稱
ipfs object links Output the links pointed to by the specified object. 輸出和指定對象關聯的ipfs鏈接
ipfs object new 感覺IPFS對象模板,創建一個ipfs對象。默認返回一個空的默克爾樹節點
ipfs object patch Create a new merkledag object based on an existing one. 基於一個已經存在的默克爾樹節點,創建一個新的
ipfs object stat Get stats for the DAG node 得到給定key的ipsf對象的統計信息

ipfs pin Pin (and unpin) objects to local storage. Pin 是將文件長期保留在本地,不被垃圾回收。
ipfs pin add
ipfs pin ls 查看那些對象被pin了
ipfs pin rm 從本地移除pin對象


ipfs ping 測試和其他節點連通性


ipfs pubsub An experimental publish-subscribe system on ipfs. 一個實驗性的在ipfs網絡上的發佈訂閱命令
ipfs refs 列出ipfs本地或者指定對象所有的鏈接引用
ipfs repo 用來操作ipfs本地倉庫的命令
ipfs repo fsck Remove repo lockfiles. 刪除倉庫中鎖定的文件,只有守護進程停止的時候纔有用。
ipfs repo gc will sweep the local set of stored objects and remove ones that are not pinned in order to reclaim hard disk space. 清理更多的本地沒有被pin的對象,這樣做可以節省更多的存儲空間
ipfs repo stat 統計本地倉庫信息
ipfs repo verify 驗證本地所有ipfs塊有沒有被損壞
ipfs repo version 查看本地倉庫版本
ipfs stats ipfs統計信息
ipfs stats bitswap ipfs bitswap統計信息
ipfs stats bw ipfs帶寬統計信息
ipfs stats repo


ipfs swarm The swarm is the component that opens, listens for, and maintains connections to other ipfs peers in the internet. 這個命令是用來操作swarm的。swarm是一個用來監聽,維護和其他鏈接的組件


ipfs swarm addrs lists all addresses this node is aware of. 列出當前節點能感知到的所有地址
ipfs swarm addrs local List local addresses. 顯示本地IPFS地址
ipfs swarm connect Open connection to a given address. 連接一個新的IFPS節點
ipfs swarm disconnect 從一個ipfs節點斷開
ipfs swarm filters 根據過濾器過濾顯示地址
ipfs swarm peers 顯示當前節點鏈接的IPFS節點
ipfs tar 和文件壓縮解壓縮有關的命令


ipfs tar add parse a tar file and create a merkledag structure to 導入一個tar結構文件到ipfs。過程中要解析一個tar文件並且給他創建一個默克爾樹結構
ipfs tar cat 從IPFS中導出一個tar文件
ipfs tour
ipfs update
ipfs version


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章