aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/storage')
-rw-r--r--swarm/storage/netstore.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go
index 7b0612edc..5d4f17deb 100644
--- a/swarm/storage/netstore.go
+++ b/swarm/storage/netstore.go
@@ -57,15 +57,21 @@ type StoreParams struct {
Radius int
}
-func NewStoreParams(path string) (self *StoreParams) {
+//create params with default values
+func NewDefaultStoreParams() (self *StoreParams) {
return &StoreParams{
- ChunkDbPath: filepath.Join(path, "chunks"),
DbCapacity: defaultDbCapacity,
CacheCapacity: defaultCacheCapacity,
Radius: defaultRadius,
}
}
+//this can only finally be set after all config options (file, cmd line, env vars)
+//have been evaluated
+func (self *StoreParams) Init(path string) {
+ self.ChunkDbPath = filepath.Join(path, "chunks")
+}
+
// netstore contructor, takes path argument that is used to initialise dbStore,
// the persistent (disk) storage component of LocalStore
// the second argument is the hive, the connection/logistics manager for the node