Skip to content

Commit

Permalink
fix first reg ws not clear
Browse files Browse the repository at this point in the history
  • Loading branch information
AstaFrode committed May 8, 2024
1 parent dba6dd4 commit 2d07ce4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/console/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Command_State_Runfunc(cmd *cobra.Command, args []string) {
if err.Error() != pattern.ERR_Empty {
out.Err(pattern.ERR_RPC_CONNECTION.Error())
} else {
out.Err("You are not a storage node")
out.Err("signature account does not exist, possible: 1.balance is empty 2.rpc address error")
}
os.Exit(1)
}
Expand Down
24 changes: 16 additions & 8 deletions node/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ func (w *Workspace) RemoveAndBuild(rootDir string) error {
w.podr2_rsa_pub = filepath.Join(rootDir, podr2_rsa_pub)
w.idle_prove = filepath.Join(rootDir, idle_prove)
w.service_prove = filepath.Join(rootDir, service_prove)
w.fileDir = filepath.Join(rootDir, fileDir)
w.tmpDir = filepath.Join(rootDir, tmpDir)
w.dbDir = filepath.Join(rootDir, dbDir)
w.logDir = filepath.Join(rootDir, logDir)
w.spaceDir = filepath.Join(rootDir, spaceDir)
w.accDir = filepath.Join(rootDir, accDir)
w.poisDir = filepath.Join(rootDir, poisDir)
w.randomDir = filepath.Join(rootDir, randomDir)

err := os.RemoveAll(w.fileDir)
if err != nil {
return err
Expand Down Expand Up @@ -144,42 +153,41 @@ func (w *Workspace) RemoveAndBuild(rootDir string) error {
os.Remove(w.idle_prove)
os.Remove(w.service_prove)

w.fileDir = filepath.Join(rootDir, fileDir)
err = os.MkdirAll(w.fileDir, configs.FileMode)
if err != nil {
return err
}
w.tmpDir = filepath.Join(rootDir, tmpDir)

err = os.MkdirAll(w.tmpDir, configs.FileMode)
if err != nil {
return err
}
w.dbDir = filepath.Join(rootDir, dbDir)

err = os.MkdirAll(w.dbDir, configs.FileMode)
if err != nil {
return err
}
w.logDir = filepath.Join(rootDir, logDir)

err = os.MkdirAll(w.logDir, configs.FileMode)
if err != nil {
return err
}
w.spaceDir = filepath.Join(rootDir, spaceDir)

err = os.MkdirAll(w.spaceDir, configs.FileMode)
if err != nil {
return err
}
w.accDir = filepath.Join(rootDir, accDir)

err = os.MkdirAll(w.accDir, configs.FileMode)
if err != nil {
return err
}
w.poisDir = filepath.Join(rootDir, poisDir)

err = os.MkdirAll(w.poisDir, configs.FileMode)
if err != nil {
return err
}
w.randomDir = filepath.Join(rootDir, randomDir)

return os.MkdirAll(w.randomDir, configs.FileMode)
}

Expand Down

0 comments on commit 2d07ce4

Please sign in to comment.