Skip to content

Commit

Permalink
feat: add parachains to ws port list
Browse files Browse the repository at this point in the history
  • Loading branch information
riyasng12 committed Jan 24, 2024
1 parent 353a3c3 commit 955dedd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/chains/kusama/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
var KusamaCmd = common.NewDiveCommandBuilder().
SetUse("kusama").
SetShort("Build, initialize and start a Kusama node").
SetLong("The command starts the kusama relay chain and kusama parachain if -p flag is given").
SetLong("The command starts the kusama relaychain and kusama parachain if -p flag is given").
SetRun(kusama).
AddStringSliceFlagWithShortHand(&paraChain, "parachain", "p", []string{}, "specify the list of parachains to spawn parachain node").
AddStringFlagWithShortHand(&network, "network", "n", "", "specify the network to run (local/testnet/mainnet). Default will be local.").
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/chains/kusama/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func configureService(serviceConfig *utils.PolkadotServiceConfig) error {
}

if serviceConfig.ChainType == localChain && serviceConfig.RelayChain.Name == "" && len(serviceConfig.Para) != 0 {
return common.WrapMessageToError(common.ErrEmptyFields, "Cannot start a Parachain in local without Relay Chain")
return common.WrapMessageToError(common.ErrEmptyFields, "Cannot start a Parachain in local without Relaychain")
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/chains/polkadot/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
var PolkadotCmd = common.NewDiveCommandBuilder().
SetUse("polkadot").
SetShort("Build, initialize and start a Polkadot node").
SetLong("The command starts the polkadot relay chain and polkadot parachain if -p flag is given").
SetLong("The command starts the polkadot relaychain and polkadot parachain if -p flag is given").
SetRun(polkadot).
AddStringSliceFlagWithShortHand(&paraChain, "parachain", "p", []string{}, "specify the list of parachains to spawn parachain node").
AddStringFlagWithShortHand(&network, "network", "n", "", "specify the network to run (local/testnet/mainnet). Default will be local.").
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/chains/polkadot/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func configureService(serviceConfig *utils.PolkadotServiceConfig) error {
}

if serviceConfig.ChainType == localChain && serviceConfig.RelayChain.Name == "" && len(serviceConfig.Para) != 0 {
return common.WrapMessageToError(common.ErrEmptyFields, "Cannot start a Parachain in local without Relay Chain")
return common.WrapMessageToError(common.ErrEmptyFields, "Cannot start a Parachain in local without Relaychain")
}

return nil
Expand Down
11 changes: 6 additions & 5 deletions cli/cmd/chains/utils/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ func (sc *PolkadotServiceConfig) LoadDefaultConfig() error {
}

func (nc *NodeConfig) AssignPorts(prometheus bool, chainName string) error {
var wsPortEnabled = []string{"robonomics", "parallel", "subsocial", "litmus", "pendulum", "kilt"}
var wsPortEnabled = []string{"robonomics", "parallel", "subsocial", "litmus", "pendulum", "kilt", "litentry", "zeitgeist", "kylin", "subzero", "integritee", "polkadex", "clover"}

var rpcPort, lib2libPort, prometheusPort, wsPort int
var err error
rpcPort, err = common.GetAvailablePort()
Expand Down Expand Up @@ -403,7 +404,7 @@ func (nc *NodeConfig) IsEmpty() error {
}

func (sc *PolkadotServiceConfig) HasPrometheus() bool {
// Check relay chain nodes
// Check relaychain nodes
if sc.RelayChain.Name != "" {
for _, node := range sc.RelayChain.Nodes {
if node.Prometheus {
Expand Down Expand Up @@ -548,19 +549,19 @@ func GetStopMessage(cliContext *common.Cli, filePath string, relayName string, p
return "", err
}
if len(serviceConfig.Para) == 0 {
return fmt.Sprintf("%s Relay Chain Started. ", relayName), nil
return fmt.Sprintf("%s Relaychain Started. ", relayName), nil
}
for _, parachain := range serviceConfig.Para {
stopMessage = stopMessage + parachain.Name + ", "
}
} else {
if len(paraChain) == 0 {
return fmt.Sprintf("%s Relay Chain Started. ", relayName), nil
return fmt.Sprintf("%s Relaychain Started. ", relayName), nil
}
for _, parachain := range paraChain {
stopMessage = stopMessage + parachain + ", "
}
}
stopMessage = stopMessage + fmt.Sprintf("Started For %s Relay Chain. ", relayName)
stopMessage = stopMessage + fmt.Sprintf("Started For %s Relaychain. ", relayName)
return stopMessage, nil
}

0 comments on commit 955dedd

Please sign in to comment.