Beispiel #1
0
 public GrpcNetworkServerTests()
 {
     _networkServer       = GetRequiredService <IAElfNetworkServer>();
     _eventBus            = GetRequiredService <ILocalEventBus>();
     _peerPool            = GetRequiredService <IPeerPool>();
     _reconnectionService = GetRequiredService <IReconnectionService>();
 }
 public GrpcNetworkServerTests()
 {
     _networkServer = GetRequiredService <IAElfNetworkServer>();
     _eventBus      = GetRequiredService <ILocalEventBus>();
     _peerPool      = GetRequiredService <IPeerPool>();
     _testContext   = GetRequiredService <NetworkTestContext>();
 }
Beispiel #3
0
 public GrpcServerServiceTests()
 {
     _networkServer     = GetRequiredService <IAElfNetworkServer>();
     _service           = GetRequiredService <GrpcServerService>();
     _blockchainService = GetRequiredService <IBlockchainService>();
     _peerPool          = GetRequiredService <IPeerPool>();
     _eventBus          = GetRequiredService <ILocalEventBus>();
 }
 public OsBlockchainNodeContextService(IBlockchainNodeContextService blockchainNodeContextService,
                                       IAElfNetworkServer networkServer, ISmartContractAddressService smartContractAddressService,
                                       IServiceContainer <INodePlugin> nodePlugins)
 {
     _blockchainNodeContextService = blockchainNodeContextService;
     _networkServer = networkServer;
     _smartContractAddressService = smartContractAddressService;
     _nodePlugins = nodePlugins;
 }
 public OsBlockchainNodeContextService(IBlockchainNodeContextService blockchainNodeContextService,
                                       IAElfNetworkServer networkServer, ISmartContractAddressService smartContractAddressService,
                                       IEnumerable <INodePlugin> nodePlugins, IOptionsSnapshot <ContractOptions> contractOptions)
 {
     _blockchainNodeContextService = blockchainNodeContextService;
     _networkServer = networkServer;
     _smartContractAddressService = smartContractAddressService;
     _nodePlugins     = nodePlugins;
     _contractOptions = contractOptions.Value;
 }
Beispiel #6
0
        public NetworkService(IPeerPool peerPool, ITaskQueueManager taskQueueManager, IAElfNetworkServer networkServer,
                              IKnownBlockCacheProvider knownBlockCacheProvider)
        {
            _peerPool                = peerPool;
            _taskQueueManager        = taskQueueManager;
            _networkServer           = networkServer;
            _knownBlockCacheProvider = knownBlockCacheProvider;

            Logger = NullLogger <NetworkService> .Instance;
        }
        public static async Task <bool> CheckEndpointAvailableAsync(this IAElfNetworkServer networkServer,
                                                                    string endpoint)
        {
            if (!AElfPeerEndpointHelper.TryParse(endpoint, out var aelfPeerEndpoint))
            {
                return(false);
            }

            return(await networkServer.CheckEndpointAvailableAsync(aelfPeerEndpoint));
        }
Beispiel #8
0
 public GrpcServerServiceTests()
 {
     _networkServer     = GetRequiredService <IAElfNetworkServer>();
     _serverService     = GetRequiredService <GrpcServerService>();
     _blockchainService = GetRequiredService <IBlockchainService>();
     _peerPool          = GetRequiredService <IPeerPool>();
     _eventBus          = GetRequiredService <ILocalEventBus>();
     _nodeManager       = GetRequiredService <INodeManager>();
     _osTestHelper      = GetRequiredService <OSTestHelper>();
     _handshakeProvider = GetRequiredService <IHandshakeProvider>();
 }
Beispiel #9
0
        public GrpcPeerTests()
        {
            _blockchainService = GetRequiredService <IBlockchainService>();
            _networkServer     = GetRequiredService <IAElfNetworkServer>();
            _eventBus          = GetRequiredService <ILocalEventBus>();
            _osTestHelper      = GetRequiredService <OSTestHelper>();
            _pool = GetRequiredService <IPeerPool>();

            _grpcPeer = GrpcTestPeerHelpers.CreateNewPeer();
            _pool.TryAddPeer(_grpcPeer);
        }
        public PeerDiscoveryService(IPeerPool peerPool, INodeManager nodeManager,
                                    IDiscoveredNodeCacheProvider discoveredNodeCacheProvider, IAElfNetworkServer aelfNetworkServer,
                                    IPeerDiscoveryJobProcessor peerDiscoveryJobProcessor)
        {
            _peerPool    = peerPool;
            _nodeManager = nodeManager;
            _discoveredNodeCacheProvider = discoveredNodeCacheProvider;
            _aelfNetworkServer           = aelfNetworkServer;
            _peerDiscoveryJobProcessor   = peerDiscoveryJobProcessor;

            Logger = NullLogger <PeerDiscoveryService> .Instance;
        }
Beispiel #11
0
        public NetworkService(IPeerPool peerPool, ITaskQueueManager taskQueueManager, IAElfNetworkServer networkServer,
                              IBlackListedPeerProvider blackListedPeerProvider,
                              IBroadcastPrivilegedPubkeyListProvider broadcastPrivilegedPubkeyListProvider)
        {
            _peerPool         = peerPool;
            _taskQueueManager = taskQueueManager;
            _networkServer    = networkServer;
            _broadcastPrivilegedPubkeyListProvider = broadcastPrivilegedPubkeyListProvider;
            _blackListedPeerProvider = blackListedPeerProvider;

            Logger = NullLogger <NetworkService> .Instance;
        }
        public PeerDiscoveryJobProcessor(INodeManager nodeManager,
                                         IDiscoveredNodeCacheProvider discoveredNodeCacheProvider, IAElfNetworkServer networkServer,
                                         IAccountService accountService)
        {
            _nodeManager = nodeManager;
            _discoveredNodeCacheProvider = discoveredNodeCacheProvider;
            _networkServer  = networkServer;
            _accountService = accountService;
            CreatePeerDiscoveryDataflow();

            Logger = NullLogger <PeerDiscoveryJobProcessor> .Instance;
        }
Beispiel #13
0
        public GrpcPeerTests()
        {
            _blockchainService = GetRequiredService<IBlockchainService>();
            _networkServer = GetRequiredService<IAElfNetworkServer>();
            _pool = GetRequiredService<IPeerPool>();

            _grpcPeer = GrpcTestPeerHelpers.CreateNewPeer();
            _grpcPeer.IsConnected = true;

            //_nonInterceptedPeer = GrpcTestPeerHelpers.CreateNewPeer("127.0.0.1:2000", false);
            //_nonInterceptedPeer.IsConnected = true;
            _nonInterceptedPeer = MockServiceClient("127.0.0.1:2000");

            _pool.TryAddPeer(_grpcPeer);
        }
 public GrpcNetworkServerBootNodesTests()
 {
     _networkServer       = GetRequiredService <IAElfNetworkServer>();
     _eventBus            = GetRequiredService <ILocalEventBus>();
     _reconnectionService = GetRequiredService <IReconnectionService>();
 }