public void Compartiendo_pares_entre_3_nodos()
        {
            using (var loggerFactory = CreateLoggerFactory())
            {
                var channel = new PeerChannelInProc();
                var node1   = new Node(new NodeOptions("Nodo 1", "1111", 1, 2000, $"http://{host1}:{port1}"), new BlockBuilder(), loggerFactory, channel);
                var node2   = new Node(new NodeOptions("Nodo 2", "2222", 1, 2000, $"http://{host2}:{port2}"), new BlockBuilder(), loggerFactory, channel);
                var node3   = new Node(new NodeOptions("Nodo 3", "3333", 1, 2000, $"http://{host3}:{port3}"), new BlockBuilder(), loggerFactory, channel);
                channel.Add(node1);
                channel.Add(node2);
                channel.Add(node3);

                Assert.AreEqual(0, node1.Peers.Count);
                Assert.AreEqual(0, node2.Peers.Count);
                Assert.AreEqual(0, node3.Peers.Count);

                node1.Connect(node2.Host.PublicUrl);

                Assert.AreEqual(1, node1.Peers.Count, string.Join(", ", node1.Peers.List()));
                Assert.AreEqual(1, node2.Peers.Count, string.Join(", ", node2.Peers.List()));
                Assert.AreEqual(0, node3.Peers.Count, string.Join(", ", node3.Peers.List()));

                node2.Connect(node3.Host.PublicUrl);
                Assert.AreEqual(1, node1.Peers.Count, string.Join(", ", node1.Peers.List()));
                Assert.AreEqual(2, node2.Peers.Count, string.Join(", ", node2.Peers.List()));
                Assert.AreEqual(1, node3.Peers.Count, string.Join(", ", node3.Peers.List()));

                node3.Discovery();
                Assert.AreEqual(2, node1.Peers.Count, string.Join(", ", node1.Peers.List()));
                Assert.AreEqual(2, node2.Peers.Count, string.Join(", ", node2.Peers.List()));
                Assert.AreEqual(2, node3.Peers.Count, string.Join(", ", node3.Peers.List()));
            }
        }
        public void Mensaje_entre_red_de_3_nodos()
        {
            using (var loggerFactory = CreateLoggerFactory())
            {
                var channel = new PeerChannelInProc();
                var node1   = new Node(new NodeOptions("Nodo 1", "1111", 1, 2000, "http://localhost:8001"), new BlockBuilder(), loggerFactory, channel);
                var node2   = new Node(new NodeOptions("Nodo 2", "2222", 1, 2000, "http://localhost:8002"), new BlockBuilder(), loggerFactory, channel);
                var node3   = new Node(new NodeOptions("Nodo 3", "3333", 1, 2000, "http://localhost:8003"), new BlockBuilder(), loggerFactory, channel);
                channel.Add(node1);
                channel.Add(node2);
                channel.Add(node3);

                node1.Connect(node2.Host.PublicUrl);
                Assert.AreEqual(1, node1.Peers.Count);
                Assert.AreEqual(1, node2.Peers.Count);
                Assert.AreEqual(0, node3.Peers.Count);

                node2.Connect(node3.Host.PublicUrl);
                Assert.AreEqual(1, node1.Peers.Count);
                Assert.AreEqual(2, node2.Peers.Count);
                Assert.AreEqual(1, node3.Peers.Count);

                node3.Discovery();
                Assert.AreEqual(2, node1.Peers.Count);
                Assert.AreEqual(2, node2.Peers.Count);
                Assert.AreEqual(2, node3.Peers.Count);

                node2.Syncronize();
                node3.Syncronize();

                node1.Add(new Community {
                    Address = new byte[] { 1, 2, 3 }
                });
                Assert.AreEqual(1, node2.Pendings.Count());
                Assert.AreEqual(1, node3.Pendings.Count());
            }
        }