Remote wallet backends

This commit is contained in:
Łukasz Magiera
2020-09-05 21:39:09 +02:00
parent f90cfda2e6
commit 780f6dba34
14 changed files with 360 additions and 12 deletions
+9
View File
@@ -44,6 +44,7 @@ const (
FullNode RepoType = iota
StorageMiner
Worker
Wallet
)
func defConfForType(t RepoType) interface{} {
@@ -54,6 +55,8 @@ func defConfForType(t RepoType) interface{} {
return config.DefaultStorageMiner()
case Worker:
return &struct{}{}
case Wallet:
return &struct{}{}
default:
panic(fmt.Sprintf("unknown RepoType(%d)", int(t)))
}
@@ -87,6 +90,12 @@ func (fsr *FsRepo) Exists() (bool, error) {
notexist := os.IsNotExist(err)
if notexist {
err = nil
_, err = os.Stat(filepath.Join(fsr.path, fsKeystore))
notexist = os.IsNotExist(err)
if notexist {
err = nil
}
}
return !notexist, err
}