Skip to content

Commit

Permalink
chore/cli: add paseo config (#3677)
Browse files Browse the repository at this point in the history
Co-authored-by: Afri <58883403+q9f@users.noreply.github.com>
  • Loading branch information
kanishkatn and q9f committed Jan 15, 2024
1 parent 3e99f6d commit 92ae2ba
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 0 deletions.
214 changes: 214 additions & 0 deletions chain/paseo/chain-spec-raw.json

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions chain/paseo/defaults.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2021 ChainSafe Systems (ON)
// SPDX-License-Identifier: LGPL-3.0-only

package paseo

import (
cfg "github.com/ChainSafe/gossamer/config"
)

var (
// defaultName Default node name
defaultName = "Paseo"
// defaultID Default chain ID
defaultID = "paseo"
// defaultBasePath Default node base directory path
defaultBasePath = "~/.gossamer/paseo"
// defaultChainSpec is the default chain spec configuration path
defaultChainSpec = "./chain/paseo/chain-spec-raw.json"
)

// DefaultConfig returns a paseo node configuration
func DefaultConfig() *cfg.Config {
config := cfg.DefaultConfig()
config.BasePath = defaultBasePath
config.ID = defaultID
config.Name = defaultName
config.ChainSpec = defaultChainSpec
config.Core.BabeAuthority = false
config.Core.GrandpaAuthority = false
config.Core.Role = 1
config.Network.NoMDNS = false

return config
}
1 change: 1 addition & 0 deletions cmd/gossamer/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Usage:
gossamer --chain westend-local --alice
gossamer --chain westend-dev --key alice --port 7002
gossamer --chain westend --key bob --port 7003
gossamer --chain paseo --key bob --port 7003
gossamer --chain kusama --key charlie --port 7004
gossamer --chain polkadot --key dave --port 7005`,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
4 changes: 4 additions & 0 deletions cmd/gossamer/commands/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"syscall"
"time"

"github.com/ChainSafe/gossamer/chain/paseo"

"github.com/spf13/cobra"

"github.com/ChainSafe/gossamer/chain/kusama"
Expand Down Expand Up @@ -245,6 +247,8 @@ func parseChainSpec(chain string) error {
config = westend.DefaultConfig()
case cfg.WestendDevChain:
config = westenddev.DefaultConfig()
case cfg.PaseoChain:
config = paseo.DefaultConfig()
case cfg.WestendLocalChain:
if alice || key == "alice" {
config = westendlocal.DefaultAliceConfig()
Expand Down
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,8 @@ const (
WestendDevChain Chain = "westend-dev"
// WestendLocalChain is the Westend local chain
WestendLocalChain Chain = "westend-local"
// PaseoChain is the Paseo chain
PaseoChain Chain = "paseo"
)

// String returns the string representation of the chain
Expand Down

0 comments on commit 92ae2ba

Please sign in to comment.