Search in sources :

Example 6 with DebugModuleImpl

use of co.rsk.rpc.modules.debug.DebugModuleImpl in project rskj by rsksmart.

the class Web3ImplSnapshotTest method createWeb3.

private Web3Impl createWeb3(SimpleEthereum ethereum) {
    MinerClock minerClock = new MinerClock(true, Clock.systemUTC());
    MinerServer minerServer = getMinerServerForTest(ethereum, minerClock);
    MinerClientImpl minerClient = new MinerClientImpl(null, minerServer, config.minerClientDelayBetweenBlocks(), config.minerClientDelayBetweenRefreshes());
    EvmModule evmModule = new EvmModuleImpl(minerServer, minerClient, minerClock, new SnapshotManager(blockchain, factory.getBlockStore(), factory.getTransactionPool(), minerServer));
    PersonalModule pm = new PersonalModuleWalletDisabled();
    TxPoolModule tpm = new TxPoolModuleImpl(Web3Mocks.getMockTransactionPool());
    DebugModule dm = new DebugModuleImpl(null, null, Web3Mocks.getMockMessageHandler(), null);
    ethereum.blockchain = blockchain;
    return new Web3Impl(ethereum, blockchain, factory.getBlockStore(), factory.getReceiptStore(), Web3Mocks.getMockProperties(), minerClient, minerServer, pm, null, evmModule, tpm, null, dm, null, null, Web3Mocks.getMockChannelManager(), null, null, null, null, null, null, null, null, null);
}
Also used : EvmModuleImpl(co.rsk.rpc.modules.evm.EvmModuleImpl) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) DebugModuleImpl(co.rsk.rpc.modules.debug.DebugModuleImpl) PersonalModuleWalletDisabled(co.rsk.rpc.modules.personal.PersonalModuleWalletDisabled) PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) DebugModule(co.rsk.rpc.modules.debug.DebugModule) EvmModule(co.rsk.rpc.modules.evm.EvmModule) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule) SnapshotManager(co.rsk.core.SnapshotManager)

Example 7 with DebugModuleImpl

use of co.rsk.rpc.modules.debug.DebugModuleImpl in project rskj by rsksmart.

the class Web3ImplLogsTest method createWeb3.

private Web3Impl createWeb3() {
    Wallet wallet = WalletFactory.createWallet();
    PersonalModule personalModule = new PersonalModuleWalletEnabled(config, eth, wallet, transactionPool);
    EthModule ethModule = new EthModule(config.getNetworkConstants().getBridgeConstants(), config.getNetworkConstants().getChainId(), blockChain, transactionPool, null, new ExecutionBlockRetriever(mainchainView, blockChain, null, null), null, new EthModuleWalletEnabled(wallet), null, new BridgeSupportFactory(null, config.getNetworkConstants().getBridgeConstants(), config.getActivationConfig()), config.getGasEstimationCap());
    TxPoolModule txPoolModule = new TxPoolModuleImpl(transactionPool);
    DebugModule debugModule = new DebugModuleImpl(null, null, Web3Mocks.getMockMessageHandler(), null);
    return new Web3RskImpl(eth, blockChain, config, Web3Mocks.getMockMinerClient(), Web3Mocks.getMockMinerServer(), personalModule, ethModule, null, txPoolModule, null, debugModule, null, null, Web3Mocks.getMockChannelManager(), null, null, blockStore, receiptStore, null, null, null, new SimpleConfigCapabilities(), null, new BlocksBloomStore(2, 0, new HashMapDB()), mock(Web3InformationRetriever.class), null);
}
Also used : Wallet(co.rsk.core.Wallet) Web3RskImpl(co.rsk.rpc.Web3RskImpl) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) DebugModuleImpl(co.rsk.rpc.modules.debug.DebugModuleImpl) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) HashMapDB(org.ethereum.datasource.HashMapDB) EthModuleWalletEnabled(co.rsk.rpc.modules.eth.EthModuleWalletEnabled) BlocksBloomStore(co.rsk.logfilter.BlocksBloomStore) Web3InformationRetriever(co.rsk.rpc.Web3InformationRetriever) PersonalModule(co.rsk.rpc.modules.personal.PersonalModule) EthModule(co.rsk.rpc.modules.eth.EthModule) DebugModule(co.rsk.rpc.modules.debug.DebugModule) SimpleConfigCapabilities(org.ethereum.rpc.Simples.SimpleConfigCapabilities) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule)

Example 8 with DebugModuleImpl

use of co.rsk.rpc.modules.debug.DebugModuleImpl in project rskj by rsksmart.

the class TransactionModuleTest method internalCreateEnvironment.

private Web3Impl internalCreateEnvironment(Blockchain blockchain, MiningMainchainView mainchainView, ReceiptStore receiptStore, TransactionPool transactionPool, BlockStore blockStore, boolean mineInstant, StateRootHandler stateRootHandler, RepositoryLocator repositoryLocator, TransactionGateway transactionGateway, TransactionExecutorFactory transactionExecutorFactory) {
    transactionPool.processBest(blockchain.getBestBlock());
    ConfigCapabilities configCapabilities = new SimpleConfigCapabilities();
    CompositeEthereumListener compositeEthereumListener = new CompositeEthereumListener();
    Ethereum eth = new EthereumImpl(new ChannelManagerImpl(config, new SyncPool(compositeEthereumListener, blockchain, config, null, null, null)), transactionGateway, compositeEthereumListener, blockchain);
    MinerClock minerClock = new MinerClock(true, Clock.systemUTC());
    this.transactionExecutorFactory = transactionExecutorFactory;
    MiningConfig miningConfig = ConfigUtils.getDefaultMiningConfig();
    BlockExecutor blockExecutor = new BlockExecutor(config.getActivationConfig(), repositoryLocator, // stateRootHandler,
    this.transactionExecutorFactory);
    MinerServer minerServer = new MinerServerImpl(config, eth, mainchainView, null, new ProofOfWorkRule(config).setFallbackMiningEnabled(false), new BlockToMineBuilder(config.getActivationConfig(), miningConfig, repositoryLocator, blockStore, transactionPool, new DifficultyCalculator(config.getActivationConfig(), config.getNetworkConstants()), new GasLimitCalculator(config.getNetworkConstants()), new ForkDetectionDataCalculator(), mock(BlockUnclesValidationRule.class), minerClock, blockFactory, blockExecutor, new MinimumGasPriceCalculator(Coin.valueOf(miningConfig.getMinGasPriceTarget())), new MinerUtils()), minerClock, blockFactory, new BuildInfo("cb7f28e", "master"), miningConfig);
    Wallet wallet = WalletFactory.createWallet();
    PersonalModuleWalletEnabled personalModule = new PersonalModuleWalletEnabled(config, eth, wallet, transactionPool);
    MinerClient minerClient = new MinerClientImpl(null, minerServer, config.minerClientDelayBetweenBlocks(), config.minerClientDelayBetweenRefreshes());
    EthModuleTransaction transactionModule;
    ReversibleTransactionExecutor reversibleTransactionExecutor1 = new ReversibleTransactionExecutor(repositoryLocator, this.transactionExecutorFactory);
    if (mineInstant) {
        transactionModule = new EthModuleTransactionInstant(config.getNetworkConstants(), wallet, transactionPool, minerServer, minerClient, blockchain, transactionGateway, blockExecutor);
    } else {
        transactionModule = new EthModuleTransactionBase(config.getNetworkConstants(), wallet, transactionPool, transactionGateway);
    }
    final RepositoryBtcBlockStoreWithCache.Factory btcBlockStoreFactory = new RepositoryBtcBlockStoreWithCache.Factory(config.getNetworkConstants().getBridgeConstants().getBtcParams());
    EthModule ethModule = new EthModule(config.getNetworkConstants().getBridgeConstants(), config.getNetworkConstants().getChainId(), blockchain, transactionPool, reversibleTransactionExecutor1, new ExecutionBlockRetriever(mainchainView, blockchain, null, null), repositoryLocator, new EthModuleWalletEnabled(wallet), transactionModule, new BridgeSupportFactory(btcBlockStoreFactory, config.getNetworkConstants().getBridgeConstants(), config.getActivationConfig()), config.getGasEstimationCap());
    TxPoolModule txPoolModule = new TxPoolModuleImpl(transactionPool);
    DebugModule debugModule = new DebugModuleImpl(null, null, Web3Mocks.getMockMessageHandler(), null);
    ChannelManager channelManager = new SimpleChannelManager();
    return new Web3RskImpl(eth, blockchain, config, minerClient, Web3Mocks.getMockMinerServer(), personalModule, ethModule, null, txPoolModule, null, debugModule, null, null, channelManager, null, null, blockStore, receiptStore, null, null, null, configCapabilities, null, null, null, null);
}
Also used : ConfigCapabilities(org.ethereum.net.client.ConfigCapabilities) SimpleConfigCapabilities(org.ethereum.rpc.Simples.SimpleConfigCapabilities) Web3RskImpl(co.rsk.rpc.Web3RskImpl) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) PersonalModuleWalletEnabled(co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled) ProofOfWorkRule(co.rsk.validators.ProofOfWorkRule) RepositoryBtcBlockStoreWithCache(co.rsk.peg.RepositoryBtcBlockStoreWithCache) SimpleChannelManager(org.ethereum.rpc.Simples.SimpleChannelManager) SyncPool(org.ethereum.sync.SyncPool) Ethereum(org.ethereum.facade.Ethereum) DebugModule(co.rsk.rpc.modules.debug.DebugModule) BridgeSupportFactory(co.rsk.peg.BridgeSupportFactory) ExecutionBlockRetriever(co.rsk.rpc.ExecutionBlockRetriever) ChannelManagerImpl(org.ethereum.net.server.ChannelManagerImpl) SimpleChannelManager(org.ethereum.rpc.Simples.SimpleChannelManager) ChannelManager(org.ethereum.net.server.ChannelManager) EthereumImpl(org.ethereum.facade.EthereumImpl) TxPoolModuleImpl(co.rsk.rpc.modules.txpool.TxPoolModuleImpl) DebugModuleImpl(co.rsk.rpc.modules.debug.DebugModuleImpl) MiningConfig(co.rsk.config.MiningConfig) CompositeEthereumListener(org.ethereum.listener.CompositeEthereumListener) BuildInfo(org.ethereum.util.BuildInfo) SimpleConfigCapabilities(org.ethereum.rpc.Simples.SimpleConfigCapabilities) TxPoolModule(co.rsk.rpc.modules.txpool.TxPoolModule)

Aggregations

DebugModule (co.rsk.rpc.modules.debug.DebugModule)8 DebugModuleImpl (co.rsk.rpc.modules.debug.DebugModuleImpl)8 TxPoolModule (co.rsk.rpc.modules.txpool.TxPoolModule)8 TxPoolModuleImpl (co.rsk.rpc.modules.txpool.TxPoolModuleImpl)8 BridgeSupportFactory (co.rsk.peg.BridgeSupportFactory)6 ExecutionBlockRetriever (co.rsk.rpc.ExecutionBlockRetriever)6 Web3RskImpl (co.rsk.rpc.Web3RskImpl)6 PersonalModuleWalletEnabled (co.rsk.rpc.modules.personal.PersonalModuleWalletEnabled)6 Web3InformationRetriever (co.rsk.rpc.Web3InformationRetriever)5 EthModule (co.rsk.rpc.modules.eth.EthModule)5 EthModuleWalletEnabled (co.rsk.rpc.modules.eth.EthModuleWalletEnabled)5 MiningMainchainView (co.rsk.core.bc.MiningMainchainView)4 MinerClient (co.rsk.mine.MinerClient)4 PersonalModule (co.rsk.rpc.modules.personal.PersonalModule)4 ChannelManager (org.ethereum.net.server.ChannelManager)4 BuildInfo (org.ethereum.util.BuildInfo)3 Wallet (co.rsk.core.Wallet)2 MiningMainchainViewImpl (co.rsk.core.bc.MiningMainchainViewImpl)2 EthModuleTransactionBase (co.rsk.rpc.modules.eth.EthModuleTransactionBase)2 PersonalModuleWalletDisabled (co.rsk.rpc.modules.personal.PersonalModuleWalletDisabled)2