$(document).ready(function(){
    //make sure change to your own machine ip or dmain url
    var urlBase = "http://0.0.0.0:30000";
   // var urlBase = "http://10.0.2.2:30000";
 
    
   $("#addUser").click(function(){
    var addUserUrl = urlBase+"/addUser";
    var userName = "admin";
    $.ajax({
      type: 'POST',
      url: addUserUrl,
      data: { userName: userName },
      success: function(data, status, jqXHR){
        if(status==='success'){
          alert("User - "+ userName+ " was successfully added to wallet and is ready to intreact with the fabric network");
        }
        
      },
      error: function(xhr, textStatus, error){
       console.log("EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE");
       console.log( xhr.responseText);
          console.log(xhr.statusText);
          console.log(textStatus);
          console.log(error);
          alert("Error: ffffffffffff"+ xhr.responseText);
      }
    });
  })



 
});
$(document).ajaxStart(function(){
  $("#wait").css("display", "block");
});
$(document).ajaxComplete(function(){
  $("#wait").css("display", "none");
});