如何彻底清理 IPFS 存储库?

How can I completely clean IPFS repo?

在运行以下命令之后,相关::

# unpin and remove all IPFS content from my machine
ipfs pin ls --type recursive | cut -d' ' -f1 | ifne xargs -n1 ipfs pin rm
ipfs repo gc

.ipfs 存储库的大小仍保持原样:

$ du -sh ~/.ipfs
1.4G    .ipfs

我可以 rm -rf ~/.ipfs && ipfs init 但是我的 IPFS id 被重新初始化,我想在不删除它的情况下保留我的原始对等身份。

我想彻底清理 IPFS 存储库的内容。我怎样才能实现它?我观察到在删除固定对象后 ~/.ipfs 的大小仍然没有改变。

移除固定对象不会改变存储库大小。如果块 未被 使用 MFS.

如果您正在使用 flatfs 数据存储,那么存储 space 将被释放。在 badgerds 中,它们将被较新的内容覆盖,但通常不会被释放。