diff --git a/cmd/zetae2e/get_zetaclient_bootstrap.go b/cmd/zetae2e/local/get_zetaclient_bootstrap.go similarity index 93% rename from cmd/zetae2e/get_zetaclient_bootstrap.go rename to cmd/zetae2e/local/get_zetaclient_bootstrap.go index 97139356f5..7e346448b4 100644 --- a/cmd/zetae2e/get_zetaclient_bootstrap.go +++ b/cmd/zetae2e/local/get_zetaclient_bootstrap.go @@ -1,4 +1,4 @@ -package main +package local import ( "fmt" @@ -17,6 +17,8 @@ import ( observertypes "github.com/zeta-chain/node/x/observer/types" ) +const grpcURLFlag = "grpc-url" + func NewGetZetaclientBootstrap() *cobra.Command { var ConfigureZetaclientBootstrapCmd = &cobra.Command{ Use: "get-zetaclient-bootstrap", @@ -24,13 +26,17 @@ func NewGetZetaclientBootstrap() *cobra.Command { RunE: getZetaclientBootstrap, } + ConfigureZetaclientBootstrapCmd.Flags(). + String(grpcURLFlag, "zetacore0:9090", "--grpc-url zetacore0:9090") + return ConfigureZetaclientBootstrapCmd } func getZetaclientBootstrap(cmd *cobra.Command, _ []string) error { sdkconfig.SetDefault(true) + grpcURL, _ := cmd.Flags().GetString(grpcURLFlag) rpcClient, err := rpc.NewGRPCClients( - "zetacore0:9090", + grpcURL, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock(), ) diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index 0ebb6244f9..e625b4174a 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -83,6 +83,8 @@ func NewLocalCmd() *cobra.Command { cmd.Flags(). Bool(flagUpgradeContracts, false, "set to true to upgrade Gateways and ERC20Custody contracts during setup for ZEVM and EVM") + cmd.AddCommand(NewGetZetaclientBootstrap()) + return cmd } diff --git a/cmd/zetae2e/root.go b/cmd/zetae2e/root.go index d885b532e2..28b4b0c003 100644 --- a/cmd/zetae2e/root.go +++ b/cmd/zetae2e/root.go @@ -29,7 +29,6 @@ func NewRootCmd() *cobra.Command { NewStressTestCmd(), NewInitCmd(), NewSetupBitcoinCmd(), - NewGetZetaclientBootstrap(), ) return cmd diff --git a/contrib/localnet/scripts/start-zetaclientd.sh b/contrib/localnet/scripts/start-zetaclientd.sh index fd4c55249b..c994f1d2df 100755 --- a/contrib/localnet/scripts/start-zetaclientd.sh +++ b/contrib/localnet/scripts/start-zetaclientd.sh @@ -69,7 +69,7 @@ RELAYER_KEY_PATH="$HOME/.zetacored/relayer-keys" mkdir -p "${RELAYER_KEY_PATH}" mkdir -p "$HOME/.tss/" -zetae2e get-zetaclient-bootstrap > "$HOME/.tss/address_book.seed" +zetae2e local get-zetaclient-bootstrap > "$HOME/.tss/address_book.seed" MYIP=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)