Skip to content

Commit

Permalink
chore/cli: renames genesis to chain-spec (#3691)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Romero <diego2737@gmail.com>
  • Loading branch information
2 people authored and timwu20 committed Apr 18, 2024
1 parent 2bd8cae commit 803fa5a
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion chain/kusama/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
// defaultBasePath Default node base directory path
defaultBasePath = "~/.gossamer/kusama"
// defaultChainSpec is the default chain-spec json path
defaultChainSpec = "./chain/kusama/genesis.json"
defaultChainSpec = "./chain/kusama/chain-spec-raw.json"
)

// DefaultConfig returns a kusama node configuration
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion chain/polkadot/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
// defaultBasePath Default node base directory path
defaultBasePath = "~/.gossamer/polkadot"
// defaultChainSpec is the default chain spec configuration path
defaultChainSpec = "./chain/polkadot/genesis.json"
defaultChainSpec = "./chain/polkadot/chain-spec-raw.json"
)

// DefaultConfig returns a polkadot node configuration
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion chain/westend/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
// defaultBasePath Default node base directory path
defaultBasePath = "~/.gossamer/westend"
// defaultChainSpec is the default chain specification path
defaultChainSpec = "./chain/westend/genesis.json"
defaultChainSpec = "./chain/westend/chain-spec-raw.json"
)

// DefaultConfig returns a westend node configuration
Expand Down
6 changes: 3 additions & 3 deletions cmd/gossamer/commands/import_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func init() {
// ImportRuntimeCmd is the command to import a runtime binary into a genesis file
var ImportRuntimeCmd = &cobra.Command{
Use: "import-runtime",
Short: "Appends the given .wasm runtime binary to a genesis file",
Long: `The import-runtime command appends the given .wasm runtime binary to a genesis file.
Short: "Appends the given .wasm runtime binary to a chain-spec",
Long: `The import-runtime command appends the given .wasm runtime binary to a chain-spec.
Example:
gossamer import-runtime --wasm-file runtime.wasm --genesis-file genesis.json > updated_genesis.json`,
gossamer import-runtime --wasm-file runtime.wasm --chain chain-spec.json > chain-spec-new.json`,
RunE: func(cmd *cobra.Command, args []string) error {
return execImportRuntime(cmd)
},
Expand Down
10 changes: 5 additions & 5 deletions lib/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,31 +138,31 @@ func KeystoreFilepaths(basepath string) ([]string, error) {
// GetWestendDevHumanReadableGenesisPath gets the westend-dev human readable spec filepath
func GetWestendDevHumanReadableGenesisPath(t *testing.T) string {
t.Helper()
return filepath.Join(GetProjectRootPathTest(t), "./chain/westend-dev/westend-dev-spec.json")
return filepath.Join(GetProjectRootPathTest(t), "chain", "westend-dev", "westend-dev-spec.json")
}

// GetWestendDevRawGenesisPath gets the westend-dev genesis raw path
func GetWestendDevRawGenesisPath(t *testing.T) string {
t.Helper()
return filepath.Join(GetProjectRootPathTest(t), "./chain/westend-dev/westend-dev-spec-raw.json")
return filepath.Join(GetProjectRootPathTest(t), "chain", "westend-dev", "westend-dev-spec-raw.json")
}

// GetWestendLocalRawGenesisPath gets the westend-local genesis raw path
func GetWestendLocalRawGenesisPath(t *testing.T) string {
t.Helper()
return filepath.Join(GetProjectRootPathTest(t), "./chain/westend-local/westend-local-spec-raw.json")
return filepath.Join(GetProjectRootPathTest(t), "chain", "westend-local", "westend-local-spec-raw.json")
}

// GetKusamaGenesisPath gets the Kusama genesis path
func GetKusamaGenesisPath(t *testing.T) string {
t.Helper()
return filepath.Join(GetProjectRootPathTest(t), "./chain/kusama/genesis.json")
return filepath.Join(GetProjectRootPathTest(t), "chain", "kusama", "chain-spec-raw.json")
}

// GetPolkadotGenesisPath gets the Polkadot genesis path
func GetPolkadotGenesisPath(t *testing.T) string {
t.Helper()
return filepath.Join(GetProjectRootPathTest(t), "./chain/polkadot/genesis.json")
return filepath.Join(GetProjectRootPathTest(t), "chain", "polkadot", "chain-spec-raw.json")
}

// GetProjectRootPathTest finds the root of the project where `go.mod` is
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/gossamer_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func GenerateGenesisAuths(t *testing.T, numAuths int) (genesisPath string) {
buildSpecJSON, err := buildSpec.ToJSONRaw()
require.NoError(t, err)

genesisPath = filepath.Join(t.TempDir(), "genesis.json")
genesisPath = filepath.Join(t.TempDir(), "chain-spec.json")
err = os.WriteFile(genesisPath, buildSpecJSON, os.ModePerm)
require.NoError(t, err)

Expand Down

0 comments on commit 803fa5a

Please # to comment.