func (s *ShardRPCServer) Connect(ctx context.Context, connectMsg *pb.ConnectMessage) (*empty.Empty, error) {
	addr := connectMsg.Address

	ma, err := multiaddr.NewMultiaddr(addr)
	if err != nil {
		return nil, err
	}

	pi, err := peer.AddrInfoFromP2pAddr(ma)
	if err != nil {
		return nil, err
	}

	err = s.hn.Connect(ctx, *pi)
	if err != nil {
		return nil, err
	}

	return &empty.Empty{}, nil
}
// Connect connects to a peer
Connect connects to a peer
// Connect connects to a peer
func (s *ShardRPCServer) Connect(ctx context.Context, connectMsg *pb.ConnectMessage) (*empty.Empty, error) {
	addr := connectMsg.Address
	ma, err := multiaddr.NewMultiaddr(addr)
	if err != nil {
		return nil, err
	}
	pi, err := peer.AddrInfoFromP2pAddr(ma)
	if err != nil {
		return nil, err
	}
	err = s.hn.Connect(ctx, *pi)
	if err != nil {
		return nil, err
	}
	return &empty.Empty{}, nil
}
func ( s * ShardRPCServer ) Connect ( ctx context . Context , connectMsg * pb . ConnectMessage ) ( * empty . Empty , error ) { addr := connectMsg . Address ma , err := multiaddr . NewMultiaddr ( addr ) if err != nil { return nil , err } pi , err := peer . AddrInfoFromP2pAddr ( ma ) if err != nil { return nil , err } err = s . hn . Connect ( ctx , * pi ) if err != nil { return nil , err } return & empty . Empty { } , nil }
Connect connects to a peer
Connect connects to a peer