public async Task <Operation> ResumeSidechain(string node)
 {
     return(await ExecuteAction(async() =>
     {
         var ip = await _cloudPlugin.GetNodeIP(node);
         var result = await Fetch.PostAsync(ip + Resources.ResumeSideChain);
         //_cloudPlugin.ResumeNode(node);
         await _nodeDAO.StartNodeAsync(node);
         var ResponseString = JsonStringNavigator.GetDeeper(result, "succeeded");
         if (!(ResponseString == "true"))
         {
             throw new Exception("Fetch Failed");
         }
     }));
 }
Beispiel #2
0
        public async Task SetStatusNode()
        {
            try
            {
                var inDB = new List <Node> {
                    new Node {
                        Account = "Requester", Ip = "Mock", Service = "Mock", Type = "Requester", Status = "OFF"
                    },
                };
                var nodesDAO = new NodesDataAccessObject();
                nodesDAO.TestDB();
                await nodesDAO.StopNodeAsync("Requester");

                var node = await nodesDAO.GetNodeAsync("Requester");

                await nodesDAO.StartNodeAsync("Requester");

                Assert.IsTrue(node.Status == "OFF");
            }
            catch (Exception e)
            {
                Assert.IsTrue(false);
            }
        }