public async Task <BlockchainNodeContext> StartAsync(BlockchainNodeContextStartDto dto) { _defaultContractZeroCodeProvider.SetDefaultContractZeroRegistrationByType(dto.ZeroSmartContractType); var context = new BlockchainNodeContext { ChainId = dto.ChainId, TxHub = _txHub, }; var chain = await _blockchainService.GetChainAsync(); chain = chain == null ? await _chainCreationService.CreateNewChainAsync(dto.Transactions) : await _blockchainService.ResetChainToLibAsync(chain); await _smartContractAddressUpdateService.UpdateSmartContractAddressesAsync( await _blockchainService.GetBlockHeaderByHashAsync(chain.BestChainHash)); await _consensusService.TriggerConsensusAsync(new ChainContext { BlockHash = chain.BestChainHash, BlockHeight = chain.BestChainHeight }); return(context); }
public async Task StopAsync(BlockchainNodeContext blockchainNodeContext) { }
public Task StopAsync(BlockchainNodeContext blockchainNodeContext) { return(Task.CompletedTask); }