예제 #1
0
            public string GetPeer()
            {
                // ko me kdo poklièe, vrnem podatke o svojem nodu
                var peer = new Model.Peer
                {
                    PeerCount            = 1,
                    HighestBlockNum      = DependencyManager.BlockMiner.Blockchain.Count(),
                    TimestampUtcLastSeen = DateTime.UtcNow,
                    PeerPublicKey        = "123",
                    PeerHostName         = "hp8730w",
                    PeerHostip           = "192.168.1.64",
                    PeerFrendlyName      = "Moj Blokchain node",
                    NodeClass            = "Odin"
                };

                return(JsonConvert.SerializeObject(peer, Formatting.Indented));
            }
예제 #2
0
            public string ListPeers()
            {
                // Create a list of peers.
                List <Model.Peer> peers = new List <Model.Peer>();

                var peer = new Model.Peer
                {
                    PeerCount            = 1,
                    HighestBlockNum      = DependencyManager.BlockMiner.Blockchain.Count(),
                    TimestampUtcLastSeen = DateTime.UtcNow,
                    PeerPublicKey        = "123",
                    PeerHostName         = "hp8730w",
                    PeerHostip           = "192.168.1.64",
                    PeerFrendlyName      = "Moj Blokchain node",
                    NodeClass            = "Odin"
                };

                peers.Add(peer);
                peers.Add(new Model.Peer());
                peers.Add(peer);

                return(JsonConvert.SerializeObject(peers, Formatting.Indented));
            }