在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ipfs/go-ipfs-provider开源软件地址:https://github.com/ipfs/go-ipfs-provider开源编程语言:Go 100.0%开源软件介绍:go-ipfs-providerBackgroundThe provider system is responsible for announcing and reannouncing to the ipfs network that a node has content. InstallVia $ go get github.com/ipfs/go-ipfs-provider
UsageHere's how you create, start, interact with, and stop the provider system: import (
"context"
"time"
"github.com/ipfs/go-ipfs-provider"
"github.com/ipfs/go-ipfs-provider/queue"
"github.com/ipfs/go-ipfs-provider/simple"
)
rsys := (your routing system here)
dstore := (your datastore here)
cid := (your cid to provide here)
q := queue.NewQueue(context.Background(), "example", dstore)
reprov := simple.NewReprovider(context.Background(), time.Hour * 12, rsys, simple.NewBlockstoreProvider(dstore))
prov := simple.NewProvider(context.Background(), q, rsys)
sys := provider.NewSystem(prov, reprov)
sys.Run()
sys.Provide(cid)
sys.Close() ContributePRs are welcome! Small note: If editing the Readme, please conform to the standard-readme specification. LicenseThis library is dual-licensed under Apache 2.0 and MIT terms. Copyright 2019. Protocol Labs, Inc. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论