@Test public void testPPT() { String nb = RegistryNodeBuilders.name(RegistryNodeBuilders.Location.RANDOM, true, 0); String nl = NetworkLatency.NetworkLatencyByDistanceWJitter.class.getSimpleName(); ENRGossiping p1 = new ENRGossiping( new ENRGossiping.ENRParameters(100, 10, 25, 15000, 2, 20, 0.4f, 30, 10, 5, nb, nl)); Predicate<Protocol> contIf = pp1 -> pp1.network().time <= 1000 * 100; StatsHelper.StatsGetter sg = new StatsHelper.StatsGetter() { final List<String> fields = new StatsHelper.SimpleStats(0, 0, 0).fields(); @Override public List<String> fields() { return fields; } @Override public StatsHelper.Stat get(List<? extends Node> liveNodes) { return StatsHelper.getStatsOn(liveNodes, n -> ((ENRGossiping.ETHNode) n).doneAt); } }; ProgressPerTime ppp = new ProgressPerTime( p1, "", "Nodes that have found capabilities", sg, 1, null, 10000, TimeUnit.MILLISECONDS); ppp.run(contIf); }
@Override public Network<ETHNode> network() { return network; }
ENRGossiping implements Protocol { @Override public Network<ETHNode> network() { return network; } }
ENRGossiping implements Protocol { @Override public Network<ETHNode> network() { return network; } ENRGossiping(ENRParameters params); }
ENRGossiping implements Protocol { @Override public Network<ETHNode> network() { return network; } ENRGossiping(ENRParameters params); @Override Network<ETHNode> network(); @Override ENRGossiping copy(); @Override void init(); @Override String toString(); static void main(String... args); }
ENRGossiping implements Protocol { @Override public Network<ETHNode> network() { return network; } ENRGossiping(ENRParameters params); @Override Network<ETHNode> network(); @Override ENRGossiping copy(); @Override void init(); @Override String toString(); static void main(String... args); final P2PNetwork<ETHNode> network; }