private FullNode Restart(FullNode fullNode) { fullNode.Dispose(); fullNode.ThrowIfUncatchedException(); fullNode = StratisBitcoinRunner.BuildFullNode(fullNode.Settings); fullNode.Start(); return(fullNode); }
public void ValidSomeBlocksOnMainnet() { using (NodeContext ctx = NodeContext.Create(network: Network.Main)) { var nodeSettings = new NodeSettings(); nodeSettings.DataDir = ctx.FolderName; nodeSettings.ConnectionManager.Connect.Add(new IPEndPoint(IPAddress.Loopback, ctx.Network.DefaultPort)); var fullNode = StratisBitcoinRunner.BuildFullNode(nodeSettings); fullNode.Start(); int increment = 20000; int reachNext = increment; for (int i = 0; i < 10; i++) { WaitReachBlock(fullNode, reachNext); fullNode = Restart(fullNode); reachNext += increment; } fullNode.ThrowIfUncatchedException(); fullNode.Dispose(); } }