示例#1
0
 public SyncPeerMock(string peerName, bool causeTimeoutOnInit = false, bool causeTimeoutOnBlocks = false)
 {
     _causeTimeoutOnInit   = causeTimeoutOnInit;
     _causeTimeoutOnBlocks = causeTimeoutOnBlocks;
     NodeStats             = new NodeStatsLight(new Node(NodeId), new StatsConfig(), LimboLogs.Instance);
     Blocks.Add(_genesisBlock);
     ClientId = peerName;
 }
        private void SetupSpeedStats(PublicKey publicKey, int transferSpeed)
        {
            Node           node  = new Node(publicKey, "127.0.0.1", 30303);
            NodeStatsLight stats = new NodeStatsLight(node, new StatsConfig());

            stats.AddTransferSpeedCaptureEvent(TransferSpeedType.Headers, transferSpeed);

            _stats.GetOrAdd(Arg.Is <Node>(n => n.Id == publicKey)).Returns(stats);
        }
        private void SetupLatencyStats(PublicKey publicKey, int milliseconds)
        {
            Node           node  = new Node(publicKey, "127.0.0.1", 30303);
            NodeStatsLight stats = new NodeStatsLight(node, new StatsConfig());

            stats.AddLatencyCaptureEvent(NodeLatencyStatType.BlockHeaders, milliseconds);
            stats.AddLatencyCaptureEvent(NodeLatencyStatType.BlockBodies, milliseconds);
            stats.AddLatencyCaptureEvent(NodeLatencyStatType.P2PPingPong, milliseconds);

            _stats.GetOrAdd(Arg.Is <Node>(n => n.Id == publicKey)).Returns(stats);
        }
示例#4
0
        public long LightRep()
        {
            NodeStatsLight stats = new NodeStatsLight(_node);

            return(stats.CurrentNodeReputation);
        }
示例#5
0
 public void Light()
 {
     NodeStatsLight stats = new NodeStatsLight(_node);
 }
示例#6
0
 public void Light()
 {
     NodeStatsLight stats = new NodeStatsLight(_node, _statsConfig);
 }
示例#7
0
        public long LightRep()
        {
            NodeStatsLight stats = new NodeStatsLight(_node, _statsConfig, _logManager);

            return(stats.CurrentNodeReputation);
        }
示例#8
0
 public void Light()
 {
     NodeStatsLight stats = new NodeStatsLight(_node, _statsConfig, _logManager);
 }