Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Update "sedge-data" default directory from "[WORK_DIR]/sedge-data" to "[HOME_DIR]/.local/share/.sedge/sedge-data".

## [v1.7.0] - 2024-10-24

### Added
Expand Down
20 changes: 15 additions & 5 deletions configs/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ package configs

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

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

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

func init() {
cwd, err := os.Getwd()
if err != nil {
// notest
// 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)
if err != nil{
fmt.Println(err)
}
DefaultAbsSedgeDataPath = filepath.Join(cwd, DefaultSedgeDataFolderName)

DefaultAbsSedgeDataPath = filepath.Join(dataDir.Path(), DefaultSedgeDataFolderName)
}
14 changes: 7 additions & 7 deletions docs/docs/commands/generate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Flags:
--lido generate Lido CSM node
--logging string Docker logging driver used by all the services. Set 'none' to use the default docker logging driver. Possible values: [none json] (default "json")
-n, --network string Target network. e.g. mainnet, sepolia, holesky, gnosis, chiado, etc. (default "mainnet")
-p, --path string generation path for sedge data. Default is sedge-data (default "/path/to/sedge-data")
-p, --path string generation path for sedge data. Default is sedge-data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")

Global Flags:
--log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")
Expand Down Expand Up @@ -119,7 +119,7 @@ Global Flags:
--log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")
--logging string Docker logging driver used by all the services. Set 'none' to use the default docker logging driver. Possible values: [none json] (default "json")
-n, --network string Target network. e.g. mainnet,sepolia, holesky, gnosis, chiado, etc. (default "mainnet")
-p, --path string generation path for sedge data. Default is sedge-data (default "/path/to/sedge/sedge-data")
-p, --path string generation path for sedge data. Default is sedge-data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
```
#### Op-Full-Node

Expand Down Expand Up @@ -170,7 +170,7 @@ Global Flags:
--log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")
--logging string Docker logging driver used by all the services. Set 'none' to use the default docker logging driver. Possible values: [json none] (default "json")
-n, --network string Target network. e.g. mainnet,sepolia, holesky, gnosis, chiado, etc. (default "mainnet")
-p, --path string generation path for sedge data. Default is sedge-data (default "/path/to/sedge/sedge-data")
-p, --path string generation path for sedge data. Default is sedge-data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
```

:::note
Expand Down Expand Up @@ -221,7 +221,7 @@ Global Flags:
--log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")
--logging string Docker logging driver used by all the services. Set 'none' to use the default docker logging driver. Possible values: [none json] (default "json")
-n, --network string Target network. e.g. mainnet,sepolia, holesky, gnosis, chiado, etc. (default "mainnet")
-p, --path string generation path for sedge data. Default is sedge-data (default "/path/to/sedge/sedge-data")
-p, --path string generation path for sedge data. Default is sedge-data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
```

#### Execution
Expand Down Expand Up @@ -252,7 +252,7 @@ Global Flags:
--log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")
--logging string Docker logging driver used by all the services. Set 'none' to use the default docker logging driver. Possible values: [none json] (default "json")
-n, --network string Target network. e.g. mainnet,sepolia, holesky, gnosis, chiado, etc. (default "mainnet")
-p, --path string generation path for sedge data. Default is sedge-data (default "/path/to/sedge/sedge-data")
-p, --path string generation path for sedge data. Default is sedge-data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
```

#### Validator
Expand Down Expand Up @@ -297,7 +297,7 @@ Global Flags:
--log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")
--logging string Docker logging driver used by all the services. Set 'none' to use the default docker logging driver. Possible values: [none json] (default "json")
-n, --network string Target network. e.g. mainnet,sepolia, holesky, gnosis, chiado, etc. (default "mainnet")
-p, --path string generation path for sedge data. Default is sedge-data (default "/path/to/sedge/sedge-data")
-p, --path string generation path for sedge data. Default is sedge-data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
```

#### MevBoost
Expand All @@ -321,5 +321,5 @@ Global Flags:
--lido generate Lido CSM node
--log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")
--logging string Docker logging driver used by all the services. Set 'none' to use the default docker logging driver. Possible values: [none json] (default "json")
-p, --path string generation path for sedge data. Default is sedge-data (default "/path/to/sedge/sedge-data")
-p, --path string generation path for sedge data. Default is sedge-data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
```
4 changes: 2 additions & 2 deletions docs/docs/commands/importKey.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Flags:
--custom-config string file path or url to use as custom network config.
--custom-deploy-block string custom network deploy block.
--custom-genesis string file path or url to use as custom network genesis.
--from string path to the validator keys, must follow the EIP-2335: BLS12-381 Keystore standard (default "[WORK_DIR]/sedge-data/keystore")
--from string path to the validator keys, must follow the EIP-2335: BLS12-381 Keystore standard (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
-h, --help help for import-key
-n, --network string network (default "mainnet")
-p, --path string path to the generation directory (default "[WORK_DIR]/sedge-data")
-p, --path string path to the generation directory (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
--start-validator starts the validator client after import, regardless of the state the validator was in before
--stop-validator stops the validator client after import, regardless of the state the validator was in before

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/commands/keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Flags:
-n, --network string Target network. e.g. mainnet,sepolia, holesky, gnosis, chiado etc. (default "mainnet")
--num-validators int Number of validators to generate. This number will be used in addition to the existing flag as the end index for the generated keystores. (default -1)
--passphrase-path string Path to file with a keystores passphrase to use.
-p, --path string Absolute path to keystore folder. e.g. /home/user/keystore (default "/path/to/sedge-data")
-p, --path string Absolute path to keystore folder. e.g. /home/user/keystore (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
--random-passphrase Usa a randomly generated passphrase to encrypt keystores.

Global Flags:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/commands/logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Usage:

Flags:
-h, --help help for logs
-p, --path string generation path for sedge data (default "/path/to/sedge-data")
-p, --path string generation path for sedge data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
-t, --tail int Tail the number of desired logs. If not set, or set to 0, logs are followed.

Global Flags:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/commands/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Usage:

Flags:
-h, --help help for run
-p, --path string generation path for sedge data (default "/path/to/sedge-data")
-p, --path string generation path for sedge data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
--services strings List of services to run. If this flag is not provided, all services will run.
--skip-pull Avoid pulling images before running containers. If the images are not available locally, this flag could cause an error.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/commands/show.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Usage:

Flags:
-h, --help help for show
-p, --path string generation path for sedge data (default "/path/to/sedge-data")
-p, --path string generation path for sedge data (default "[HOME_DIR]/.local/share/.sedge/sedge-data")

Global Flags:
--log-level string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/commands/slashingExport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Flags:
-h, --help help for slashing-export
-n, --network string network (default "mainnet")
-o, --out string path to write slashing protection data (default "[GENERATION_PATH]/slashing_protection.json")
-p, --path string path to the generation directory (default "/path/to/sedge-data")
-p, --path string path to the generation directory (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
--start-validator starts the validator client after export, regardless of the state the validator was in before
--stop-validator stops the validator client after export, regardless of the state the validator was in before

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/commands/slashingImport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Flags:
-f, --from string path to the JSON file in the EIP-3076 format with the slashing protection data to import (default: <generation-dir>/slashing_protection.json)
-h, --help help for slashing-import
-n, --network string network (default "mainnet")
-p, --path string path to the generation directory (default "/path/to/sedge-data")
-p, --path string path to the generation directory (default "[HOME_DIR]/.local/share/.sedge/sedge-data")
--start-validator starts the validator client after import, regardless of the state the validator was in before
--stop-validator stops the validator client after import, regardless of the state the validator was in before

Expand Down