示例#1
0
        public async Task Execute(CancellationToken cancellationToken)
        {
            bool hiveEnabled = Environment.GetEnvironmentVariable("NETHERMIND_HIVE_ENABLED")?.ToLowerInvariant() == "true";

            if (hiveEnabled)
            {
                if (_api.BlockTree == null)
                {
                    throw new StepDependencyException(nameof(_api.BlockTree));
                }
                if (_api.EthereumJsonSerializer == null)
                {
                    throw new StepDependencyException(nameof(_api.EthereumJsonSerializer));
                }

                HiveRunner hiveRunner = new HiveRunner(
                    _api.BlockTree,
                    _api.EthereumJsonSerializer,
                    _api.ConfigProvider,
                    _api.LogManager.GetClassLogger(),
                    _api.FileSystem
                    );

                await hiveRunner.Start(cancellationToken);
            }
        }
示例#2
0
        public async Task Execute()
        {
            bool hiveEnabled = Environment.GetEnvironmentVariable("NETHERMIND_HIVE_ENABLED")?.ToLowerInvariant() == "true";

            if (hiveEnabled)
            {
                if (_context.BlockTree == null)
                {
                    throw new StepDependencyException(nameof(_context.BlockTree));
                }
                if (_context.Wallet == null)
                {
                    throw new StepDependencyException(nameof(_context.Wallet));
                }
                if (_context.EthereumJsonSerializer == null)
                {
                    throw new StepDependencyException(nameof(_context.EthereumJsonSerializer));
                }
                HiveRunner hiveRunner = new HiveRunner(_context.BlockTree, _context.Wallet, _context.EthereumJsonSerializer, _context.ConfigProvider, _context.LogManager.GetClassLogger());
                await hiveRunner.Start();
            }
        }