diff options
author | Janoš Guljaš <janos@users.noreply.github.com> | 2019-04-10 22:50:58 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-05-10 18:26:26 +0800 |
commit | 996755c4a832afce8629a771cab8879c88c98355 (patch) | |
tree | fcf48d69c183a89823e3435f8d08468278a97c3c /swarm/api/config.go | |
parent | c94d582aa781b26412ba7d570f6707d193303a02 (diff) | |
download | go-tangerine-996755c4a832afce8629a771cab8879c88c98355.tar go-tangerine-996755c4a832afce8629a771cab8879c88c98355.tar.gz go-tangerine-996755c4a832afce8629a771cab8879c88c98355.tar.bz2 go-tangerine-996755c4a832afce8629a771cab8879c88c98355.tar.lz go-tangerine-996755c4a832afce8629a771cab8879c88c98355.tar.xz go-tangerine-996755c4a832afce8629a771cab8879c88c98355.tar.zst go-tangerine-996755c4a832afce8629a771cab8879c88c98355.zip |
cmd/swarm, swarm: LocalStore storage integration
Diffstat (limited to 'swarm/api/config.go')
-rw-r--r-- | swarm/api/config.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/swarm/api/config.go b/swarm/api/config.go index 0a7100c57..3a87488cc 100644 --- a/swarm/api/config.go +++ b/swarm/api/config.go @@ -45,7 +45,13 @@ const ( type Config struct { // serialised/persisted fields *storage.FileStoreParams - *storage.LocalStoreParams + + // LocalStore + ChunkDbPath string + DbCapacity uint64 + CacheCapacity uint + BaseKey []byte + *network.HiveParams Swap *swap.LocalProfile Pss *pss.PssParams @@ -78,7 +84,6 @@ type Config struct { func NewConfig() (c *Config) { c = &Config{ - LocalStoreParams: storage.NewDefaultLocalStoreParams(), FileStoreParams: storage.NewFileStoreParams(), HiveParams: network.NewHiveParams(), Swap: swap.NewDefaultSwapParams(), @@ -130,8 +135,9 @@ func (c *Config) Init(prvKey *ecdsa.PrivateKey, nodeKey *ecdsa.PrivateKey) error c.Swap.Init(c.Contract, prvKey) } - c.LocalStoreParams.Init(c.Path) - c.LocalStoreParams.BaseKey = common.FromHex(c.BzzKey) + c.privateKey = prvKey + c.ChunkDbPath = filepath.Join(c.Path, "chunks") + c.BaseKey = common.FromHex(c.BzzKey) c.Pss = c.Pss.WithPrivateKey(c.privateKey) return nil |