Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
review updates
Browse files Browse the repository at this point in the history
gartnera committed Dec 11, 2024

Verified

This commit was signed with the committer’s verified signature.
gartnera Alex Gartner
1 parent 96786f0 commit f1ca865
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions cmd/zetae2e/get_zetaclient_bootstrap.go
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion contrib/localnet/scripts/start-zetaclientd.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f1ca865

Please sign in to comment.