Search in sources :

Example 1 with GossipTopicScoreParams

use of io.libp2p.pubsub.gossip.GossipTopicScoreParams in project teku by ConsenSys.

the class LibP2PParamsFactory method createTopicsScoreParams.

public static GossipTopicsScoreParams createTopicsScoreParams(final GossipScoringConfig config) {
    final GossipTopicScoreParams defaultTopicParams = createTopicScoreParams(config.getDefaultTopicScoringConfig());
    final Map<String, GossipTopicScoreParams> topicParams = config.getTopicScoringConfig().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> createTopicScoreParams(e.getValue())));
    return new GossipTopicsScoreParams(defaultTopicParams, topicParams);
}
Also used : GossipPeerScoreParams(io.libp2p.pubsub.gossip.GossipPeerScoreParams) GossipScoringConfig(tech.pegasys.teku.networking.p2p.gossip.config.GossipScoringConfig) GossipPeerScoreParamsBuilder(io.libp2p.pubsub.gossip.builders.GossipPeerScoreParamsBuilder) GossipConfig(tech.pegasys.teku.networking.p2p.gossip.config.GossipConfig) GossipParams(io.libp2p.pubsub.gossip.GossipParams) GossipScoreParams(io.libp2p.pubsub.gossip.GossipScoreParams) Function1(kotlin.jvm.functions.Function1) Collectors(java.util.stream.Collectors) GossipPeerScoringConfig(tech.pegasys.teku.networking.p2p.gossip.config.GossipPeerScoringConfig) PeerId(io.libp2p.core.PeerId) GossipTopicScoreParams(io.libp2p.pubsub.gossip.GossipTopicScoreParams) LibP2PNodeId(tech.pegasys.teku.networking.p2p.libp2p.LibP2PNodeId) Map(java.util.Map) GossipTopicsScoreParams(io.libp2p.pubsub.gossip.GossipTopicsScoreParams) GossipTopicScoringConfig(tech.pegasys.teku.networking.p2p.gossip.config.GossipTopicScoringConfig) GossipTopicScoreParams(io.libp2p.pubsub.gossip.GossipTopicScoreParams) Map(java.util.Map) GossipTopicsScoreParams(io.libp2p.pubsub.gossip.GossipTopicsScoreParams)

Aggregations

PeerId (io.libp2p.core.PeerId)1 GossipParams (io.libp2p.pubsub.gossip.GossipParams)1 GossipPeerScoreParams (io.libp2p.pubsub.gossip.GossipPeerScoreParams)1 GossipScoreParams (io.libp2p.pubsub.gossip.GossipScoreParams)1 GossipTopicScoreParams (io.libp2p.pubsub.gossip.GossipTopicScoreParams)1 GossipTopicsScoreParams (io.libp2p.pubsub.gossip.GossipTopicsScoreParams)1 GossipPeerScoreParamsBuilder (io.libp2p.pubsub.gossip.builders.GossipPeerScoreParamsBuilder)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 Function1 (kotlin.jvm.functions.Function1)1 GossipConfig (tech.pegasys.teku.networking.p2p.gossip.config.GossipConfig)1 GossipPeerScoringConfig (tech.pegasys.teku.networking.p2p.gossip.config.GossipPeerScoringConfig)1 GossipScoringConfig (tech.pegasys.teku.networking.p2p.gossip.config.GossipScoringConfig)1 GossipTopicScoringConfig (tech.pegasys.teku.networking.p2p.gossip.config.GossipTopicScoringConfig)1 LibP2PNodeId (tech.pegasys.teku.networking.p2p.libp2p.LibP2PNodeId)1