From f1ca8651c5aec336ee2f13cbb3d41b6f0e24f8e9 Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Wed, 11 Dec 2024 09:07:44 -0800 Subject: [PATCH] review updates --- cmd/zetae2e/get_zetaclient_bootstrap.go | 13 +++++++------ contrib/localnet/scripts/start-zetaclientd.sh | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cmd/zetae2e/get_zetaclient_bootstrap.go b/cmd/zetae2e/get_zetaclient_bootstrap.go index 2919c41b06..97139356f5 100644 --- a/cmd/zetae2e/get_zetaclient_bootstrap.go +++ b/cmd/zetae2e/get_zetaclient_bootstrap.go @@ -8,12 +8,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/spf13/cobra" - "github.com/zeta-chain/node/pkg/rpc" - "github.com/zeta-chain/node/pkg/sdkconfig" - observertypes "github.com/zeta-chain/node/x/observer/types" "gitlab.com/thorchain/tss/go-tss/conversion" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + + "github.com/zeta-chain/node/pkg/rpc" + "github.com/zeta-chain/node/pkg/sdkconfig" + observertypes "github.com/zeta-chain/node/x/observer/types" ) func NewGetZetaclientBootstrap() *cobra.Command { @@ -65,9 +66,9 @@ func getZetaclientBootstrap(cmd *cobra.Command, _ []string) error { // in localnet, moniker is also the hostname moniker := validatorRes.Validator.Description.Moniker - peerId, err := conversion.Bech32PubkeyToPeerID(account.GranteePubkey.Secp256k1.String()) + peerID, err := conversion.Bech32PubkeyToPeerID(account.GranteePubkey.Secp256k1.String()) if err != nil { - return fmt.Errorf("conferting pubkey to peerid: %w", err) + return fmt.Errorf("converting pubkey to peerID: %w", err) } zetaclientHostname := strings.ReplaceAll(moniker, "zetacore", "zetaclient") @@ -90,7 +91,7 @@ func getZetaclientBootstrap(cmd *cobra.Command, _ []string) error { if ipv4Address == "" { return fmt.Errorf("no IPv4 address found for hostname %s", zetaclientHostname) } - fmt.Printf("/ip4/%s/tcp/6668/p2p/%s\n", ipv4Address, peerId.String()) + fmt.Printf("/ip4/%s/tcp/6668/p2p/%s\n", ipv4Address, peerID.String()) } return nil diff --git a/contrib/localnet/scripts/start-zetaclientd.sh b/contrib/localnet/scripts/start-zetaclientd.sh index 6e909631af..fd4c55249b 100755 --- a/contrib/localnet/scripts/start-zetaclientd.sh +++ b/contrib/localnet/scripts/start-zetaclientd.sh @@ -71,11 +71,12 @@ mkdir -p "${RELAYER_KEY_PATH}" mkdir -p "$HOME/.tss/" zetae2e get-zetaclient-bootstrap > "$HOME/.tss/address_book.seed" +MYIP=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) + echo "Start zetaclientd" # skip initialization if the config file already exists (zetaclientd init has already been run) if [[ $HOSTNAME == "zetaclient0" && ! -f ~/.zetacored/config/zetaclient_config.json ]] then - MYIP=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) zetaclientd init --zetacore-url zetacore0 --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" --keyring-backend "$BACKEND" --pre-params "$PREPARAMS_PATH" # import relayer private key for zetaclient0