code: func newEnsClient(endpoint string, addr common.Address, config *api.Config, privkey *ecdsa.PrivateKey) (*ensClient, error) {
  	log.Info("connecting to ENS API", "url", endpoint)
  	client, err := rpc.Dial(endpoint)
  	if err != nil {
  		return nil, fmt.Errorf("error connecting to ENS API %s: %s", endpoint, err)
  	}
  	ethClient := ethclient.NewClient(client)
  
  	ensRoot := config.EnsRoot
  	if addr != (common.Address{}) {
  		ensRoot = addr
  	} else {
  		a, err := detectEnsAddr(client)
  		if err == nil {
  			ensRoot = a
  		} else {
  			log.Warn(fmt.Sprintf("could not determine ENS contract address, using default %s", ensRoot), "err", err)
  		}
  	}
  	transactOpts := bind.NewKeyedTransactor(privkey)
  	dns, err := ens.NewENS(transactOpts, ensRoot, ethClient)
  	if err != nil {
  		return nil, err
  	}
  	log.Debug(fmt.Sprintf("-> Swarm Domain Name Registrar %v @ address %v", endpoint, ensRoot.Hex()))
  	return &ensClient{
  		ENS:    dns,
  		Client: ethClient,
  	}, err
  }
docs: // newEnsClient creates a new ENS client for that is a consumer of
  // a ENS API on a specific endpoint. It is used as a helper function
  // for creating multiple resolvers in NewSwarm function.