code: func (n *NodeConfig) UnmarshalJSON(data []byte) error {
  	var confJSON nodeConfigJSON
  	if err := json.Unmarshal(data, &confJSON); err != nil {
  		return err
  	}
  
  	if confJSON.ID != "" {
  		if err := n.ID.UnmarshalText([]byte(confJSON.ID)); err != nil {
  			return err
  		}
  	}
  
  	if confJSON.PrivateKey != "" {
  		key, err := hex.DecodeString(confJSON.PrivateKey)
  		if err != nil {
  			return err
  		}
  		privKey, err := crypto.ToECDSA(key)
  		if err != nil {
  			return err
  		}
  		n.PrivateKey = privKey
  	}
  
  	n.Name = confJSON.Name
  	n.Services = confJSON.Services
  	n.Port = confJSON.Port
  	n.EnableMsgEvents = confJSON.EnableMsgEvents
  
  	return nil
  }
docs: // UnmarshalJSON implements the json.Unmarshaler interface by decoding the json
  // string values into the config fields