code: func (net *Network) NewNodeWithConfig(conf *adapters.NodeConfig) (*Node, error) {
  	net.lock.Lock()
  	defer net.lock.Unlock()
  
  	if conf.Reachable == nil {
  		conf.Reachable = func(otherID enode.ID) bool {
  			_, err := net.InitConn(conf.ID, otherID)
  			if err != nil && bytes.Compare(conf.ID.Bytes(), otherID.Bytes()) < 0 {
  				return false
  			}
  			return true
  		}
  	}
  
  	// check the node doesn't already exist
  	if node := net.getNode(conf.ID); node != nil {
  		return nil, fmt.Errorf("node with ID %q already exists", conf.ID)
  	}
  	if node := net.getNodeByName(conf.Name); node != nil {
  		return nil, fmt.Errorf("node with name %q already exists", conf.Name)
  	}
  
  	// if no services are configured, use the default service
  	if len(conf.Services) == 0 {
  		conf.Services = []string{net.DefaultService}
  	}
  
  	// use the NodeAdapter to create the node
  	adapterNode, err := net.nodeAdapter.NewNode(conf)
  	if err != nil {
  		return nil, err
  	}
  	node := &Node{
  		Node:   adapterNode,
  		Config: conf,
  	}
  	log.Trace("Node created", "id", conf.ID)
  	net.nodeMap[conf.ID] = len(net.Nodes)
  	net.Nodes = append(net.Nodes, node)
  
  	// emit a "control" event
  	net.events.Send(ControlEvent(node))
  
  	return node, nil
  }
docs: // NewNodeWithConfig adds a new node to the network with the given config,
  // returning an error if a node with the same ID or name already exists