diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 5eea1595b82e..6ef0b1def45a 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -229,7 +229,8 @@ func daemonFunc(req cmds.Request, res cmds.Response) { // Start assembling node config ncfg := &core.BuildCfg{ - Repo: repo, + Repo: repo, + Permament: true, } offline, _, _ := req.Option(offlineKwd).Bool() ncfg.Online = !offline diff --git a/core/builder.go b/core/builder.go index 6095e2c24879..62e9319b9473 100644 --- a/core/builder.go +++ b/core/builder.go @@ -27,6 +27,10 @@ type BuildCfg struct { // If online is set, the node will have networking enabled Online bool + // If permament then node should run more expensive processes + // that will improve performance in long run + Permament bool + // If NilRepo is set, a repo backed by a nil datastore will be constructed NilRepo bool @@ -131,7 +135,12 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error { var err error bs := bstore.NewBlockstore(n.Repo.Datastore()) - n.Blockstore, err = bstore.CachedBlockstore(bs, ctx, bstore.DefaultCacheOpts()) + opts := bstore.DefaultCacheOpts() + if !cfg.Permament { + opts.HasBloomFilterSize = 0 + } + + n.Blockstore, err = bstore.CachedBlockstore(bs, ctx, opts) if err != nil { return err }