mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-24 22:38:27 +08:00
Merge pull request #2973 from ipfs/feature/blockstore-bloom-config
config: add config option for bloom filter
This commit is contained in:
@ -136,6 +136,12 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
|
||||
var err error
|
||||
bs := bstore.NewBlockstore(n.Repo.Datastore())
|
||||
opts := bstore.DefaultCacheOpts()
|
||||
conf, err := n.Repo.Config()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
opts.HasBloomFilterSize = conf.Datastore.BloomFilterSize
|
||||
if !cfg.Permament {
|
||||
opts.HasBloomFilterSize = 0
|
||||
}
|
||||
|
@ -15,9 +15,10 @@ type Datastore struct {
|
||||
StorageGCWatermark int64 // in percentage to multiply on StorageMax
|
||||
GCPeriod string // in ns, us, ms, s, m, h
|
||||
|
||||
Params *json.RawMessage
|
||||
NoSync bool
|
||||
HashOnRead bool
|
||||
Params *json.RawMessage
|
||||
NoSync bool
|
||||
HashOnRead bool
|
||||
BloomFilterSize int
|
||||
}
|
||||
|
||||
func (d *Datastore) ParamData() []byte {
|
||||
|
@ -85,6 +85,7 @@ func datastoreConfig() (Datastore, error) {
|
||||
StorageGCWatermark: 90, // 90%
|
||||
GCPeriod: "1h",
|
||||
HashOnRead: false,
|
||||
BloomFilterSize: 0,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user