Kagome
Polkadot Runtime Engine in C++17
kagome::network::ReputationRepository Class Referenceabstract

#include <reputation_repository.hpp>

Inheritance diagram for kagome::network::ReputationRepository:
Collaboration diagram for kagome::network::ReputationRepository:

Public Types

using PeerId = libp2p::peer::PeerId
 

Public Member Functions

virtual ~ReputationRepository ()=default
 
virtual Reputation reputation (const PeerId &peer_id) const =0
 Current peer reputation. More...
 
virtual Reputation change (const PeerId &peer_id, ReputationChange diff)=0
 
virtual Reputation changeForATime (const PeerId &peer_id, ReputationChange diff, std::chrono::seconds duration)=0
 

Detailed Description

Storage to handle peers' reputation

Definition at line 22 of file reputation_repository.hpp.

Member Typedef Documentation

using kagome::network::ReputationRepository::PeerId = libp2p::peer::PeerId

Definition at line 24 of file reputation_repository.hpp.

Constructor & Destructor Documentation

virtual kagome::network::ReputationRepository::~ReputationRepository ( )
virtualdefault

Member Function Documentation

virtual Reputation kagome::network::ReputationRepository::change ( const PeerId peer_id,
ReputationChange  diff 
)
pure virtual

Change peer reputation by arbitrary amount of points

Parameters
peer_id- peer identifier
diff- reputation increment or decrement
Returns
- resulting peer reputation

Implemented in kagome::network::ReputationRepositoryImpl.

virtual Reputation kagome::network::ReputationRepository::changeForATime ( const PeerId peer_id,
ReputationChange  diff,
std::chrono::seconds  duration 
)
pure virtual

Change peer reputation by arbitrary amount of points for a specified amount of time

Parameters
peer_id- peer identifier
difff- reputation increment or decrement
duration- amount of time to change peer reputation for
Returns
- resulting peer reputation

Implemented in kagome::network::ReputationRepositoryImpl.

virtual Reputation kagome::network::ReputationRepository::reputation ( const PeerId peer_id) const
pure virtual

Current peer reputation.

Implemented in kagome::network::ReputationRepositoryImpl.


The documentation for this class was generated from the following file: