Skip to content

Commit

Permalink
ipfs: enable OptimisticProvide, experimental feature upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui authored and p4u committed Dec 12, 2023
1 parent 64ada66 commit a8b87d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ import (
"github.com/ipfs/kubo/config"
ipfscore "github.com/ipfs/kubo/core"
ipfsapi "github.com/ipfs/kubo/core/coreapi"
"github.com/ipfs/kubo/core/node/libp2p"
"github.com/ipfs/kubo/plugin/loader"
"github.com/ipfs/kubo/repo"
"github.com/ipfs/kubo/repo/fsrepo"
"github.com/ipfs/kubo/repo/fsrepo/migrations"
"github.com/ipfs/kubo/repo/fsrepo/migrations/ipfsfetcher"
"github.com/libp2p/go-libp2p/core/routing"
"github.com/multiformats/go-multicodec"
"github.com/multiformats/go-multihash"

Expand Down Expand Up @@ -85,6 +87,10 @@ func startNode() (*ipfscore.IpfsNode, coreiface.CoreAPI, error) {
Repo: r,
Online: true,
Permanent: true,
Routing: func(args libp2p.RoutingOptionArgs) (routing.Routing, error) {
args.OptimisticProvide = true
return libp2p.DHTOption(args)
},
}

// We use node.Cancel to stop it instead.
Expand Down

0 comments on commit a8b87d0

Please sign in to comment.