From 955deddaa148ac26d352ed96b3d9e3be3ccbcf9d Mon Sep 17 00:00:00 2001 From: riyasng12 Date: Wed, 24 Jan 2024 12:12:55 +0530 Subject: [PATCH] feat: add parachains to ws port list --- cli/cmd/chains/kusama/cmd.go | 2 +- cli/cmd/chains/kusama/run.go | 2 +- cli/cmd/chains/polkadot/cmd.go | 2 +- cli/cmd/chains/polkadot/run.go | 2 +- cli/cmd/chains/utils/types.go | 11 ++++++----- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cli/cmd/chains/kusama/cmd.go b/cli/cmd/chains/kusama/cmd.go index ac31404a..b08c2d57 100644 --- a/cli/cmd/chains/kusama/cmd.go +++ b/cli/cmd/chains/kusama/cmd.go @@ -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(¶Chain, "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."). diff --git a/cli/cmd/chains/kusama/run.go b/cli/cmd/chains/kusama/run.go index 0b97f097..f9927374 100644 --- a/cli/cmd/chains/kusama/run.go +++ b/cli/cmd/chains/kusama/run.go @@ -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 diff --git a/cli/cmd/chains/polkadot/cmd.go b/cli/cmd/chains/polkadot/cmd.go index a1495e7a..0f288a8e 100644 --- a/cli/cmd/chains/polkadot/cmd.go +++ b/cli/cmd/chains/polkadot/cmd.go @@ -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(¶Chain, "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."). diff --git a/cli/cmd/chains/polkadot/run.go b/cli/cmd/chains/polkadot/run.go index 89e4b241..46316c32 100644 --- a/cli/cmd/chains/polkadot/run.go +++ b/cli/cmd/chains/polkadot/run.go @@ -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 diff --git a/cli/cmd/chains/utils/types.go b/cli/cmd/chains/utils/types.go index 78fb01a7..ffb650ca 100644 --- a/cli/cmd/chains/utils/types.go +++ b/cli/cmd/chains/utils/types.go @@ -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() @@ -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 { @@ -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 }