public NdmSubprotocolFactory(
     IMessageSerializationService?messageSerializationService,
     INodeStatsManager?nodeStatsManager,
     ILogManager?logManager,
     IAccountService?accountService,
     IConsumerService?consumerService,
     INdmConsumerChannelManager?ndmConsumerChannelManager,
     IEcdsa?ecdsa,
     IWallet?wallet,
     INdmFaucet?faucet,
     PublicKey?nodeId,
     Address?providerAddress,
     Address?consumerAddress,
     bool verifySignature = true)
 {
     if (nodeStatsManager == null)
     {
         throw new ArgumentNullException(nameof(nodeStatsManager));
     }
     MessageSerializationService = messageSerializationService ?? throw new ArgumentNullException(nameof(messageSerializationService));
     NodeStatsManager            = nodeStatsManager ?? throw new ArgumentNullException(nameof(nodeStatsManager));
     LogManager                = logManager ?? throw new ArgumentNullException(nameof(logManager));
     AccountService            = accountService ?? throw new ArgumentNullException(nameof(accountService));
     ConsumerService           = consumerService ?? throw new ArgumentNullException(nameof(consumerService));
     NdmConsumerChannelManager = ndmConsumerChannelManager ?? throw new ArgumentNullException(nameof(ndmConsumerChannelManager));
     Ecdsa           = ecdsa ?? throw new ArgumentNullException(nameof(ecdsa));
     Wallet          = wallet ?? throw new ArgumentNullException(nameof(wallet));
     Faucet          = faucet ?? throw new ArgumentNullException(nameof(faucet));
     NodeId          = nodeId ?? throw new ArgumentNullException(nameof(nodeId));
     ProviderAddress = providerAddress;
     ConsumerAddress = consumerAddress;
     VerifySignature = verifySignature;
     AccountService.AddressChanged += (_, e) => ConsumerAddress = e.NewAddress;
 }
예제 #2
0
 public Eth63ProtocolHandler(
     IP2PSession p2PSession,
     IMessageSerializationService serializer,
     ISynchronizationManager sync,
     ILogManager logManager, IPerfService perfService) : base(p2PSession, serializer, sync, logManager, perfService)
 {
 }
예제 #3
0
        public virtual async Task<INdmCapabilityConnector> InitAsync(IConfigProvider configProvider,
            IDbProvider dbProvider, string baseDbPath, IBlockTree blockTree,
            ITxPool txPool, ISpecProvider specProvider, IReceiptStorage receiptStorage, IWallet wallet,
            IFilterStore filterStore, IFilterManager filterManager,
            ITimestamper timestamper, IEthereumEcdsa ecdsa, IRpcModuleProvider rpcModuleProvider, IKeyStore keyStore,
            IJsonSerializer jsonSerializer, ICryptoRandom cryptoRandom, IEnode enode,
            INdmConsumerChannelManager consumerChannelManager, INdmDataPublisher dataPublisher, IGrpcServer grpcServer,
            INodeStatsManager nodeStatsManager, IProtocolsManager protocolsManager,
            IProtocolValidator protocolValidator, IMessageSerializationService messageSerializationService,
            bool enableUnsecuredDevWallet, IWebSocketsManager webSocketsManager, ILogManager logManager,
            IBlockProcessor blockProcessor)
        {
            var (config, services, faucet, accountService, consumerService, consumerAddress, providerAddress) =
                await PreInitAsync(configProvider, dbProvider, baseDbPath, blockTree, txPool, specProvider,
                    receiptStorage, wallet, filterStore, filterManager, timestamper, ecdsa, rpcModuleProvider, keyStore,
                    jsonSerializer, cryptoRandom, enode, consumerChannelManager, dataPublisher, grpcServer,
                    enableUnsecuredDevWallet, webSocketsManager, logManager, blockProcessor);
            if (!config.Enabled)
            {
                return default;
            }

            var subprotocolFactory = new NdmSubprotocolFactory(messageSerializationService, nodeStatsManager,
                logManager, accountService, consumerService, consumerChannelManager, ecdsa, wallet, faucet,
                enode.PublicKey, providerAddress, consumerAddress, config.VerifyP2PSignature);
            var protocolHandlerFactory = new ProtocolHandlerFactory(subprotocolFactory, protocolValidator,
                services.RequiredServices.EthRequestService, logManager);
            var capabilityConnector = new NdmCapabilityConnector(protocolsManager, protocolHandlerFactory,
                accountService, logManager);

            return capabilityConnector;
        }
예제 #4
0
 public MessageProcessor(IMessageProcessorConfiguration messageProcessorConfiguration, IQueueService queueService,
                         IMessageSerializationService messageSerializationService)
 {
     _messageProcessorConfiguration = messageProcessorConfiguration;
     _queueService = queueService;
     _messageSerializationService = messageSerializationService;
     _queueService.RegisterConsumer(HandleMessageFromQueue);
 }
예제 #5
0
 public Eth62ProtocolHandler(
     IP2PSession p2PSession,
     IMessageSerializationService serializer,
     ISynchronizationManager sync,
     ILogManager logManager)
     : base(p2PSession, serializer, logManager)
 {
     _sync = sync;
 }
 public Eth63ProtocolHandler(
     IP2PSession p2PSession,
     IMessageSerializationService serializer,
     ISynchronizationManager syncManager,
     ILogManager logManager, IPerfService perfService,
     IBlockTree blockTree, ITransactionPool transactionPool, ITimestamp timestamp) : base(p2PSession, serializer,
                                                                                          syncManager, logManager, perfService, blockTree, transactionPool, timestamp)
 {
 }
예제 #7
0
 public AaProtocolHandler(ISession session,
                          IMessageSerializationService serializer,
                          INodeStatsManager nodeStatsManager,
                          IUserOperationPool userOperationPool,
                          ILogManager logManager)
     : base(session, nodeStatsManager, serializer, logManager)
 {
     _session           = session ?? throw new ArgumentNullException(nameof(session));
     _userOperationPool = userOperationPool ?? throw new ArgumentNullException(nameof(userOperationPool));
 }