Exemplo n.º 1
0
 internal BlockExchanger(string configPath, BlockExchangerOptions options,
                         IObjectStoreFactory objectStoreFactory, IConnectionController connectionController,
                         INodeExplorer nodeExplorer, IPublishStorage publishStorage, IWantStorage wantStorage, IBytesPool bytesPool)
 {
     _configPath           = configPath;
     _options              = options;
     _objectStoreFactory   = objectStoreFactory;
     _connectionController = connectionController;
     _nodeExplorer         = nodeExplorer;
     _publishStorage       = publishStorage;
     _wantStorage          = wantStorage;
     _bytesPool            = bytesPool;
 }
Exemplo n.º 2
0
        internal NodeExplorer(string configPath, NodeExplorerOptions options,
                              IObjectStoreFactory objectStoreFactory, IConnectionController connectionController,
                              IPublishStorage publishStorage, IWantStorage wantStorage, IBytesPool bytesPool)
        {
            _configPath           = configPath;
            _options              = options;
            _objectStoreFactory   = objectStoreFactory;
            _connectionController = connectionController;
            _publishStorage       = publishStorage;
            _wantStorage          = wantStorage;
            _bytesPool            = bytesPool;

            {
                var id = new byte[32];
                using var random = RandomNumberGenerator.Create();
                random.GetBytes(id);
                _myId = id;
            }
        }
Exemplo n.º 3
0
            public async ValueTask <INodeExplorer> CreateAsync(string configPath, NodeExplorerOptions options,
                                                               IObjectStoreFactory objectStoreFactory, IConnectionController connectionController,
                                                               IPublishStorage publishStorage, IWantStorage wantStorage, IBytesPool bytesPool)
            {
                var result = new NodeExplorer(configPath, options, objectStoreFactory, connectionController, publishStorage, wantStorage, bytesPool);
                await result.InitAsync();

                return(result);
            }