在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ipfs/go-ipfs-api开源软件地址:https://github.com/ipfs/go-ipfs-api开源编程语言:Go 100.0%开源软件介绍:go-ipfs-api
Installgo get -u github.com/ipfs/go-ipfs-api This will download the source into UsageSee the godocs for details on available methods. This should match the specs at ipfs/specs (Core API); however, there are still some methods which are not accounted for. If you would like to add any of them, see the contribute section below. See also the HTTP API. ExampleAdd a file with the contents "hello world!": package main
import (
"fmt"
"strings"
"os"
shell "github.com/ipfs/go-ipfs-api"
)
func main() {
// Where your local node is running on localhost:5001
sh := shell.NewShell("localhost:5001")
cid, err := sh.Add(strings.NewReader("hello world!"))
if err != nil {
fmt.Fprintf(os.Stderr, "error: %s", err)
os.Exit(1)
}
fmt.Printf("added %s", cid)
} For a more complete example, please see: https://github.com/ipfs/go-ipfs-api/blob/master/tests/main.go ContributeContributions are welcome! Please check out the issues. Want to hack on IPFS?LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论