Skip to content

Commit

Permalink
feat: implement automate opening of polkadot explorer UI when explore…
Browse files Browse the repository at this point in the history
…r flag is given
  • Loading branch information
abhiyana committed Jan 15, 2024
1 parent a2512ce commit 9ae230f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/cmd/chains/kusama/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

const (
localChain = "local"
polkadotJUrl = "http://127.0.0.1:80"
)

func RunKusama(cli *common.Cli) (*common.DiveMultipleServiceResponse, error) {
Expand Down Expand Up @@ -164,6 +165,13 @@ func startRelayAndParaChain(cli *common.Cli, enclaveContext *enclaves.EnclaveCon
return nil, err
}
finalResult = finalResult.ConcatenateDiveResults(explorerResult)

cli.Logger().Info("Redirecting to Polkadot explorer UI...")
if err := common.OpenFile(polkadotJUrl); err != nil {
cli.Logger().Fatalf(common.CodeOf(err), "Failed to open HugoByte Polkadot explorer UI with error %v", err)
}


}

return finalResult, nil
Expand Down
6 changes: 6 additions & 0 deletions cli/cmd/chains/polkadot/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

const (
localChain = "local"
polkadotJUrl = "http://127.0.0.1:80"
)

func RunPolkadot(cli *common.Cli) (*common.DiveMultipleServiceResponse, error) {
Expand Down Expand Up @@ -164,6 +165,11 @@ func startRelayAndParaChain(cli *common.Cli, enclaveContext *enclaves.EnclaveCon
return nil, err
}
finalResult = finalResult.ConcatenateDiveResults(explorerResult)

cli.Logger().Info("Redirecting to Polkadote explorer UI...")
if err := common.OpenFile(polkadotJUrl); err != nil {
cli.Logger().Fatalf(common.CodeOf(err), "Failed to open HugoByte Polkadot explorer UI with error %v", err)
}
}

return finalResult, nil
Expand Down

0 comments on commit 9ae230f

Please sign in to comment.