Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert base path #470

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions configs/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ package configs

import (
"fmt"
"os"
"path/filepath"

"github.com/NethermindEth/sedge/internal/locker"
"github.com/NethermindEth/sedge/internal/monitoring/data"
"github.com/spf13/afero"
)

// All the strings that are needed for debugging and info logging, and constant strings.
Expand Down Expand Up @@ -123,17 +120,10 @@ Happy Staking!
var DefaultAbsSedgeDataPath string

func init() {
// Set filesystem
// fs := afero.NewMemMapFs() // Uncomment this line if you want to use the in-memory filesystem
// fs := afero.NewBasePathFs(afero.NewOsFs(), "/tmp") // Uncomment this line if you want to use the real filesystem with a base path
fs := afero.NewOsFs() // Uncomment this line if you want to use the real filesystem

// Set locker
locker := locker.NewFLock()
dataDir, err := data.NewDataDirDefault(fs, locker)
cwd, err := os.Getwd()
if err != nil {
// notest
fmt.Println(err)
}

DefaultAbsSedgeDataPath = filepath.Join(dataDir.Path(), DefaultSedgeDataFolderName)
DefaultAbsSedgeDataPath = filepath.Join(cwd, DefaultSedgeDataFolderName)
}