diff --git a/cmd/zetaclientd/p2p_diagnostics.go b/cmd/zetaclientd/p2p_diagnostics.go index 8c8bb5582b..dc8a98621d 100644 --- a/cmd/zetaclientd/p2p_diagnostics.go +++ b/cmd/zetaclientd/p2p_diagnostics.go @@ -17,7 +17,6 @@ import ( "github.com/libp2p/go-libp2p/core/protocol" drouting "github.com/libp2p/go-libp2p/p2p/discovery/routing" dutil "github.com/libp2p/go-libp2p/p2p/discovery/util" - "github.com/multiformats/go-multiaddr" maddr "github.com/multiformats/go-multiaddr" "github.com/rs/zerolog" @@ -28,7 +27,7 @@ import ( func RunDiagnostics( startLogger zerolog.Logger, - peers []multiaddr.Multiaddr, + peers []maddr.Multiaddr, hotkeyPk cryptotypes.PrivKey, cfg config.Config, ) error { @@ -60,7 +59,7 @@ func RunDiagnostics( if len(IP) == 0 { startLogger.Warn().Msg("empty env MYIP") } - var externalAddr Multiaddr + var externalAddr maddr.Multiaddr if len(IP) != 0 { externalAddr, err = maddr.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d", IP, 6668)) if err != nil { @@ -72,9 +71,9 @@ func RunDiagnostics( host, err := libp2p.New( libp2p.ListenAddrs(listenAddress), libp2p.Identity(p2pPriKey), - libp2p.AddrsFactory(func(addrs []Multiaddr) []Multiaddr { + libp2p.AddrsFactory(func(addrs []maddr.Multiaddr) []maddr.Multiaddr { if externalAddr != nil { - return []Multiaddr{externalAddr} + return []maddr.Multiaddr{externalAddr} } return addrs }), diff --git a/cmd/zetaclientd/start.go b/cmd/zetaclientd/start.go index ee912a7220..37251c04af 100644 --- a/cmd/zetaclientd/start.go +++ b/cmd/zetaclientd/start.go @@ -15,8 +15,6 @@ import ( "github.com/cometbft/cometbft/crypto/secp256k1" ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/libp2p/go-libp2p/core" - "github.com/multiformats/go-multiaddr" maddr "github.com/multiformats/go-multiaddr" "github.com/pkg/errors" "github.com/rs/zerolog/log" @@ -34,8 +32,6 @@ import ( mc "github.com/zeta-chain/zetacore/zetaclient/tss" ) -type Multiaddr = core.Multiaddr - var StartCmd = &cobra.Command{ Use: "start", Short: "Start ZetaClient Observer", @@ -361,14 +357,14 @@ func start(_ *cobra.Command, _ []string) error { return nil } -func initPeers(peer string) ([]multiaddr.Multiaddr, error) { - var peers []multiaddr.Multiaddr +func initPeers(peer string) ([]maddr.Multiaddr, error) { + var peers []maddr.Multiaddr if peer != "" { address, err := maddr.NewMultiaddr(peer) if err != nil { log.Error().Err(err).Msg("NewMultiaddr error") - return []multiaddr.Multiaddr{}, err + return []maddr.Multiaddr{}, err } peers = append(peers, address) }