Beispiel #1
0
 public SynchronizationTopologyInitializer(IStatesRepository statesRepository, INodesDataService nodesDataService, ILoggerService loggerService)
 {
     _synchronizationGroupState     = statesRepository.GetInstance <ISynchronizationGroupState>();
     _syncRegistryNeighborhoodState = statesRepository.GetInstance <ISyncRegistryNeighborhoodState>();
     _nodesDataService = nodesDataService;
     _logger           = loggerService.GetLogger(nameof(SynchronizationTopologyInitializer));
 }
Beispiel #2
0
 public SynchronizationProducer(ISerializersFactory signatureSupportSerializersFactory, IStatesRepository statesRepository,
                                IServerCommunicationServicesRegistry communicationServicesRegistry, IConfigurationService configurationService,
                                IHashCalculationsRepository hashCalculationsRepository)
 {
     _signatureSupportSerializersFactory = signatureSupportSerializersFactory;
     _nodeContext                   = statesRepository.GetInstance <INodeContext>();
     _synchronizationContext        = statesRepository.GetInstance <ISynchronizationContext>();
     _synchronizationGroupState     = statesRepository.GetInstance <ISynchronizationGroupState>();
     _communicationServicesRegistry = communicationServicesRegistry;
     _configurationService          = configurationService;
     _proofOfWorkCalculation        = hashCalculationsRepository.Create(Globals.POW_TYPE);
 }
Beispiel #3
0
 public SynchronizationGroupParticipationService(ISynchronizationProducer synchronizationProducer, IStatesRepository statesRepository,
                                                 INodesRatingProviderFactory nodesRatingProvidersFactory, ILoggerService loggerService)
 {
     _synchronizationProducer   = synchronizationProducer;
     _nodesRatingProvider       = nodesRatingProvidersFactory.GetInstance(PacketType.Transactional);
     _synchronizationContext    = statesRepository.GetInstance <ISynchronizationContext>();
     _accountState              = statesRepository.GetInstance <IAccountState>();
     _synchronizationGroupState = statesRepository.GetInstance <ISynchronizationGroupState>();
     _synchronizationGroupParticipationCheckAction = new TransformBlock <string, string>((Func <string, string>)SynchronizationGroupParticipationCheckAction, new ExecutionDataflowBlockOptions {
         MaxDegreeOfParallelism = 1
     });
     _synchronizationGroupLeaderCheckAction = new ActionBlock <string>((Action <string>)SynchronizationGroupLeaderCheckAction, new ExecutionDataflowBlockOptions {
         MaxDegreeOfParallelism = 1
     });
     _logger = loggerService.GetLogger(nameof(SynchronizationGroupParticipationService));
 }