Skip to content

Commit

Permalink
feat: integarate polkadot kurtosis package in DIVE-CLI to run polkado…
Browse files Browse the repository at this point in the history
…t testnet-mainnet setup
  • Loading branch information
abhiyana committed Dec 14, 2023
1 parent 07ab525 commit 1a14fc9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions cli/cmd/chains/polkadot/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func polkadot(cmd *cobra.Command, args []string) {
if err != nil {
cliContext.Fatal(err)
}

serviceFileName := fmt.Sprintf(common.ServiceFilePath, common.EnclaveName)

fmt.Print(response.Dive)
Expand All @@ -63,6 +64,6 @@ func polkadot(cmd *cobra.Command, args []string) {
cliContext.Fatal(err)
}
}

cliContext.StartSpinnerIfNotVerbose("Polkadot Node Started. Please find the service details in current working directory(services.json)", common.DiveLogs)
stopMessage := fmt.Sprintf("Polkadot Node Started. Please find the service details in current working directory (%s)", serviceFileName)
cliContext.StopSpinnerIfNotVerbose(stopMessage, common.DiveLogs)
}
8 changes: 5 additions & 3 deletions cli/cmd/chains/polkadot/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func RunPolkadot(cli *common.Cli) (*common.DiveMultipleServiceResponse, error) {
polkadotResponseData := &common.DiveMultipleServiceResponse{}
result, err := polkadotResponseData.Decode([]byte(responseData))


if err != nil {

errRemove := cli.Context().RemoveServicesByServiceNames(services, common.DiveEnclave)
Expand Down Expand Up @@ -107,8 +106,11 @@ func configureService(serviceConfig *utils.PolkadotServiceConfig) {
}

func configureMetrics(serviceConfig *utils.PolkadotServiceConfig) {
for _, node := range append(serviceConfig.RelayChain.Nodes, serviceConfig.Para[0].Nodes...) {
node.Prometheus = true
for i := range serviceConfig.RelayChain.Nodes {
serviceConfig.RelayChain.Nodes[i].Prometheus = true
}
for i := range serviceConfig.Para[0].Nodes {
serviceConfig.Para[0].Nodes[i].Prometheus = true
}
}

Expand Down
2 changes: 1 addition & 1 deletion cli/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type DiveServiceResponse struct {
PrometheusEndpoint string `json:"endpoint_prometheus,omitempty"`
Prometheus bool `json:"prometheus,omitempty"`
IpAddress string `json:"ip_address,omitempty"`
Node string `json:"node,omitempty"`
Node string `json:"node-type,omitempty"`
}

type DiveMultipleServiceResponse struct {
Expand Down

0 comments on commit 1a14fc9

Please sign in to comment.