Ejemplo n.º 1
0
 public P2PNode(Networks network, ServiceFlags serviceFlag, P2PNetworkConnector p2pNetworkConnector, IMessageCoordinator messageCoordinator)
 {
     _network             = network;
     _serviceFlag         = serviceFlag;
     _p2pNetworkConnector = p2pNetworkConnector;
     _messageParser       = new MessageParser();
     _messageCoordinator  = messageCoordinator;
     _ipAdrHelper         = new IpAdrHelper();
 }
Ejemplo n.º 2
0
 internal NodeLauncher(Networks network, ServiceFlags serviceFlag, IRpcNodeFactory rpcNodeFactory, IBlockChainStore blockChainStore, IMessageCoordinator messageCoordinator, ISmartContractStore smartContractStore)
 {
     _network             = network;
     _serviceFlag         = serviceFlag;
     _p2pNetworkConnector = new P2PNetworkConnector(messageCoordinator);
     _p2pNetworkConnector.ConnectEvent    += P2PConnectEvent;
     _p2pNetworkConnector.DisconnectEvent += P2PDisconnectEvent;
     _p2pNode = new P2PNode(_network, _serviceFlag, _p2pNetworkConnector, messageCoordinator);
     _rpcNode = rpcNodeFactory.Build(_network);
     blockChainStore.Switch(network);
     smartContractStore.Switch(network);
     _blockChain = blockChainStore.GetBlockChain();
 }