- 下载dist.ipfs.io/go-ipfs/v0.…后解压(需要翻墙)
cd go-ipfs
./install.sh
# 初始化仓库 默认仓库位置为~/.ipfs
ipfs init
- 下载github.com/Kubuxu/go-i…仓库,用于生成私钥
cd go-ipfs-swarm-key-gen/ipfs-swarm-key-gen
go build main.go
# 生成私有密钥swarm.key到仓库位置
./main > ~/.ipfs/swarm.key
- 删除默认节点,添加本地节点
# 删除bootstrap的所有共用节点
ipfs bootstrap rm all
# 记录下id,下方的最后一串为这里的id
ipfs id
#添加本机节点
ipfs bootstrap add /ip4/127.0.0.1/tcp/4001/p2p/12D3KooWAhKLmYrzbjxY17UPRBog98XviwJ2qjMzzDLJ2yGnatpA
#启动
ipfs daemon
- 启动后会报如下错误,为正常现象
ERROR cmd/ipfs ipfs/daemon.go:567 failed to bootstrap (no peers found): consider updating Bootstrap or Peering section of your config
ERROR reprovider.simple simple/reprovide.go:109 failed to reprovide: failed to find any peer in table
【ipfs官网】docs.ipfs.io 需要翻墙