Esempio n. 1
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);
            }
Esempio 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;
            }
        }