我想在我的项目中使用 IPFS,然后,我正在研究 Go IPFS API。然后,我写了这个非常简单的代码:
package main
import (
"fmt"
"bytes"
sh "github.com/ipfs/go-ipfs-api"
)
func main() {
shell := sh.NewShell("https://ipfs.io")
bufferExample := bytes.NewBufferString("Hello IPFS Shell tests")
mhash, err := shell.AddNoPin(bufferExample)
if err != nil {
panic(err) // ends where
}
fmt.Println(mhash)
}
但我收到错误panic: add: command not found
,我不明白为什么。我的计算机中已经有 IPFS(例如,我可以运行守护程序)。我还安装了带有开发依赖项的 Go IPFS 库。
如何解决?