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); }
public long LightRep() { NodeStatsLight stats = new NodeStatsLight(_node); return(stats.CurrentNodeReputation); }
public void Light() { NodeStatsLight stats = new NodeStatsLight(_node); }
public void Light() { NodeStatsLight stats = new NodeStatsLight(_node, _statsConfig); }
public long LightRep() { NodeStatsLight stats = new NodeStatsLight(_node, _statsConfig, _logManager); return(stats.CurrentNodeReputation); }
public void Light() { NodeStatsLight stats = new NodeStatsLight(_node, _statsConfig, _logManager); }