Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit 79b14cf

Browse files
kevinawhyrusleeping
authored andcommitted
cleanup and bug fixes
License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
1 parent 36286d7 commit 79b14cf

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

datastore.go

+10-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package config
22

3+
import (
4+
"encoding/json"
5+
)
6+
37
// DefaultDataStoreDirectory is the directory to store all the local IPFS data.
48
const DefaultDataStoreDirectory = "datastore"
59

@@ -8,36 +12,19 @@ type Datastore struct {
812
StorageMax string // in B, kB, kiB, MB, ...
913
StorageGCWatermark int64 // in percentage to multiply on StorageMax
1014
GCPeriod string // in ns, us, ms, s, m, h
11-
Path string
12-
NoSync bool // deprecated
15+
16+
// deprecated fields, use Spec
17+
Type string `json:",omitempty"`
18+
Path string `json:",omitempty"`
19+
NoSync bool `json:",omitempty"`
20+
Params *json.RawMessage `json:",omitempty"`
1321

1422
Spec map[string]interface{}
1523

1624
HashOnRead bool
1725
BloomFilterSize int
1826
}
1927

20-
type S3Datastore struct {
21-
Region string `json:"region"`
22-
Bucket string `json:"bucket"`
23-
ACL string `json:"acl"`
24-
}
25-
26-
type FlatDS struct {
27-
Path string
28-
ShardFunc string
29-
Sync bool
30-
}
31-
32-
type LevelDB struct {
33-
Path string
34-
Compression string
35-
}
36-
37-
type SbsDS struct {
38-
Path string
39-
}
40-
4128
// DataStorePath returns the default data store path given a configuration root
4229
// (set an empty string to have the default configuration root)
4330
func DataStorePath(configroot string) (string, error) {

init.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func datastoreConfig() (*Datastore, error) {
9595
"child": map[string]interface{}{
9696
"type": "flatfs",
9797
"path": "blocks",
98-
"nosync": false,
98+
"sync": true,
9999
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
100100
},
101101
},

0 commit comments

Comments
 (0)