Ejemplo n.º 1
0
        public FederationManagerBase(NodeSettings nodeSettings, Network network, ILoggerFactory loggerFactory, IKeyValueRepository keyValueRepo, ISignals signals)
        {
            this.settings     = Guard.NotNull(nodeSettings, nameof(nodeSettings));
            this.network      = Guard.NotNull(network as PoANetwork, nameof(network));
            this.keyValueRepo = Guard.NotNull(keyValueRepo, nameof(keyValueRepo));
            this.signals      = Guard.NotNull(signals, nameof(signals));

            this.logger = loggerFactory.CreateLogger(this.GetType().FullName);
            this.locker = new object();
        }
Ejemplo n.º 2
0
        public PoAMiner(
            IConsensusManager consensusManager,
            IDateTimeProvider dateTimeProvider,
            Network network,
            INodeLifetime nodeLifetime,
            ILoggerFactory loggerFactory,
            IInitialBlockDownloadState ibdState,
            BlockDefinition blockDefinition,
            ISlotsManager slotsManager,
            IConnectionManager connectionManager,
            PoABlockHeaderValidator poaHeaderValidator,
            IFederationManager federationManager,
            IIntegrityValidator integrityValidator,
            IWalletManager walletManager,
            INodeStats nodeStats,
            VotingManager votingManager,
            PoAMinerSettings poAMinerSettings,
            IAsyncProvider asyncProvider)
        {
            this.consensusManager   = consensusManager;
            this.dateTimeProvider   = dateTimeProvider;
            this.network            = network as PoANetwork;
            this.ibdState           = ibdState;
            this.blockDefinition    = blockDefinition;
            this.slotsManager       = slotsManager;
            this.connectionManager  = connectionManager;
            this.poaHeaderValidator = poaHeaderValidator;
            this.federationManager  = federationManager;
            this.integrityValidator = integrityValidator;
            this.walletManager      = walletManager;
            this.votingManager      = votingManager;
            this.settings           = poAMinerSettings;
            this.asyncProvider      = asyncProvider;

            this.logger            = loggerFactory.CreateLogger(this.GetType().FullName);
            this.cancellation      = CancellationTokenSource.CreateLinkedTokenSource(new[] { nodeLifetime.ApplicationStopping });
            this.votingDataEncoder = new VotingDataEncoder(loggerFactory);

            nodeStats.RegisterStats(this.AddComponentStats, StatsType.Component, this.GetType().Name);
        }