Esempio n. 1
0
 public void CanDownloadChain()
 {
     using (var server = new NodeServer(Network.Main))
     {
         server.RegisterPeerTableRepository(PeerCache);
         CancellationTokenSource          cancel  = new CancellationTokenSource();
         StreamObjectStream <ChainChange> changes = new StreamObjectStream <ChainChange>(new MemoryStream());
         var chain = new Chain(changes);
         server.BuildChain(changes, cancel.Token);
     }
 }
Esempio n. 2
0
 public void CanConnectToNodeSet()
 {
     using (var server = new NodeServer(Network.Main))
     {
         server.RegisterPeerTableRepository(PeerCache);
         var set = server.CreateNodeSet(5);
         Assert.Equal(5, set.GetNodes().Length);
         foreach (var node in set.GetNodes())
         {
             Assert.Equal(NodeState.HandShaked, node.State);
         }
     }
 }