diff --git a/cli/cmd/bridge/ibc/cmd.go b/cli/cmd/bridge/ibc/cmd.go index 9ccdcd08..43abbadf 100644 --- a/cli/cmd/bridge/ibc/cmd.go +++ b/cli/cmd/bridge/ibc/cmd.go @@ -37,7 +37,7 @@ func ibcRelay(cmd *cobra.Command, args []string) { if err != nil { cliContext.Fatalf("Error %s. %s", err, cmd.UsageString()) } - cliContext.Spinner().StartWithMessage("Starting IBC Setup", "green") + cliContext.StartSpinnerIfNotVerbose("Starting IBC Setup", common.DiveLogs) result, err := RunIbcRelay(cliContext) if err != nil { cliContext.Fatal(err) @@ -48,5 +48,5 @@ func ibcRelay(cmd *cobra.Command, args []string) { cliContext.Fatal(err) } - cliContext.Spinner().StopWithMessage(fmt.Sprintf("IBC Setup Completed between %s and %s. Please find service details in current working directory(dive.json)", chainA, chainB)) + cliContext.StopSpinnerIfNotVerbose(fmt.Sprintf("IBC Setup Completed between %s and %s. Please find service details in current working directory(dive.json)", chainA, chainB), common.DiveLogs) } diff --git a/cli/cmd/bridge/ibc/run.go b/cli/cmd/bridge/ibc/run.go index 537d5d78..e22d8bae 100644 --- a/cli/cmd/bridge/ibc/run.go +++ b/cli/cmd/bridge/ibc/run.go @@ -19,7 +19,7 @@ func RunIbcRelay(cli *common.Cli) (string, error) { return "", common.WrapMessageToError(common.ErrInvalidChain, err.Error()) } - enclaveContext, err := cli.Context().GetEnclaveContext(common.DiveEnclave) + enclaveContext, err := cli.Context().GetEnclaveContext(common.EnclaveName) if err != nil { return "", common.WrapMessageToError(err, "IBC Setup Failed") } diff --git a/cli/cmd/chains/archway/cmd.go b/cli/cmd/chains/archway/cmd.go index 3c20beb1..41db6e7b 100644 --- a/cli/cmd/chains/archway/cmd.go +++ b/cli/cmd/chains/archway/cmd.go @@ -32,7 +32,7 @@ func archway(cmd *cobra.Command, args []string) { cliContext.Fatalf("Error %s. %s", err, cmd.UsageString()) } - cliContext.Spinner().StartWithMessage("Starting Archway Node", "green") + cliContext.StartSpinnerIfNotVerbose("Starting Archway Node", common.DiveLogs) response, err := RunArchway(cliContext) @@ -45,7 +45,6 @@ func archway(cmd *cobra.Command, args []string) { cliContext.Fatal(err) } - - cliContext.Spinner().StopWithMessage("Archway Node Started. Please find service details in current working directory(services.json)") + cliContext.StopSpinnerIfNotVerbose("Archway Node Started. Please find service details in current working directory(services.json)", common.DiveLogs) } diff --git a/cli/cmd/chains/archway/run.go b/cli/cmd/chains/archway/run.go index 449d34c3..6fa3d5ce 100644 --- a/cli/cmd/chains/archway/run.go +++ b/cli/cmd/chains/archway/run.go @@ -7,7 +7,7 @@ import ( func RunArchway(cli *common.Cli) (*common.DiveServiceResponse, error) { - enclaveContext, err := cli.Context().GetEnclaveContext(common.DiveEnclave) + enclaveContext, err := cli.Context().GetEnclaveContext(common.EnclaveName) if err != nil { return nil, common.WrapMessageToError(err, "Archway Run Failed") diff --git a/cli/cmd/chains/eth/run.go b/cli/cmd/chains/eth/run.go index 1ee757a7..26af653e 100644 --- a/cli/cmd/chains/eth/run.go +++ b/cli/cmd/chains/eth/run.go @@ -6,7 +6,7 @@ import ( func RunEth(cli *common.Cli) (*common.DiveServiceResponse, error) { - enclaveContext, err := cli.Context().GetEnclaveContext(common.DiveEnclave) + enclaveContext, err := cli.Context().GetEnclaveContext(common.EnclaveName) if err != nil { return nil, common.WrapMessageToError(err, "Eth Run Failed") } @@ -21,7 +21,7 @@ func RunEth(cli *common.Cli) (*common.DiveServiceResponse, error) { responseData, services, skippedInstructions, err := common.GetSerializedData(cli, response) if err != nil { - errRemove := cli.Context().RemoveServicesByServiceNames(services, common.DiveEnclave) + errRemove := cli.Context().RemoveServicesByServiceNames(services, common.EnclaveName) if err != nil { return nil, common.WrapMessageToError(errRemove, "Eth Run Failed ") } diff --git a/cli/cmd/chains/hardhat/run.go b/cli/cmd/chains/hardhat/run.go index 7b32a611..4997c46b 100644 --- a/cli/cmd/chains/hardhat/run.go +++ b/cli/cmd/chains/hardhat/run.go @@ -4,7 +4,7 @@ import "github.com/hugobyte/dive-core/cli/common" func RunHardhat(cli *common.Cli) (*common.DiveServiceResponse, error) { - enclaveContext, err := cli.Context().GetEnclaveContext(common.DiveEnclave) + enclaveContext, err := cli.Context().GetEnclaveContext(common.EnclaveName) if err != nil { return nil, common.WrapMessageToError(err, "Hardhat Run Failed") @@ -20,7 +20,7 @@ func RunHardhat(cli *common.Cli) (*common.DiveServiceResponse, error) { responseData, services, skippedInstructions, err := common.GetSerializedData(cli, response) if err != nil { - errRemove := cli.Context().RemoveServicesByServiceNames(services, common.DiveEnclave) + errRemove := cli.Context().RemoveServicesByServiceNames(services, common.EnclaveName) if errRemove != nil { return nil, common.WrapMessageToError(errRemove, "Hardhat Run Failed ") } diff --git a/cli/cmd/chains/icon/run.go b/cli/cmd/chains/icon/run.go index d723a82e..ff541bc2 100644 --- a/cli/cmd/chains/icon/run.go +++ b/cli/cmd/chains/icon/run.go @@ -12,7 +12,7 @@ import ( func RunIconNode(cli *common.Cli) (*common.DiveServiceResponse, error) { - enclaveContext, err := cli.Context().GetEnclaveContext(common.DiveEnclave) + enclaveContext, err := cli.Context().GetEnclaveContext(common.EnclaveName) if err != nil { return nil, common.WrapMessageToError(err, "Icon Run Failed") @@ -72,7 +72,7 @@ func RunIconNode(cli *common.Cli) (*common.DiveServiceResponse, error) { func RunDecentralization(cli *common.Cli, params string) error { - kurtosisEnclaveContext, err := cli.Context().GetEnclaveContext(common.DiveEnclave) + kurtosisEnclaveContext, err := cli.Context().GetEnclaveContext(common.EnclaveName) if err != nil { return common.WrapMessageToError(err, "Icon Decentralization Failed") diff --git a/cli/cmd/chains/neutron/run.go b/cli/cmd/chains/neutron/run.go index 09a638c6..ce835ee5 100644 --- a/cli/cmd/chains/neutron/run.go +++ b/cli/cmd/chains/neutron/run.go @@ -7,7 +7,7 @@ import ( func RunNeutron(cli *common.Cli) (*common.DiveServiceResponse, error) { - enclaveContext, err := cli.Context().GetEnclaveContext(common.DiveEnclave) + enclaveContext, err := cli.Context().GetEnclaveContext(common.EnclaveName) if err != nil { return nil, common.WrapMessageToError(err, "Neutron Run Failed") diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 176fc79d..1fa12c5f 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -24,6 +24,7 @@ var rootCmd = common.NewDiveCommandBuilder(). AddCommand(chains.ChainCmd). AddCommand(bridge.BridgeCmd). AddBoolPersistentFlag(&common.DiveLogs, "verbose", false, "Prints out logs to Stdout"). + AddStringPersistentFlag(&common.EnclaveName, "enclaveName", common.DiveEnclave, "Provide Enclave Name To Start Service In Enclave Group"). SetRunE(run). Build() diff --git a/cli/cmd/utility/clean.go b/cli/cmd/utility/clean.go index ceae22b5..8c92954e 100644 --- a/cli/cmd/utility/clean.go +++ b/cli/cmd/utility/clean.go @@ -12,7 +12,6 @@ var CleanCmd = common.NewDiveCommandBuilder(). SetShort("Cleans up Kurtosis leftover artifacts"). SetLong("Destroys and removes any running encalves. If no enclaves running to remove it will throw an error"). AddBoolFlagP("all", "a", false, "To Clean All the Service in Enclave"). - AddStringFlagWithShortHand(&common.EnclaveName, "enclaveName", "e", common.DiveEnclave, "Please Provide enclave name to clean"). SetRun(clean).Build() func clean(cmd *cobra.Command, args []string) {