I am using following code to deploy my smart contract but now my transaction is taking too much time to mine on my private blockchain.
String contractAddress = myContract.deploy(web3j, credentials, DefaultGasProvider.GAS_PRICE, DefaultGasProvider.GAS_LIMIT, BigInteger.valueOf(campaign.getId()),
campaign.getName(), startDateTime, endDateTime).send().getContractAddress();
So far I was using DefaultGasProvider to calculate gas price and gas limit but it seems like now these limits are not enough to mine my blocks...its taking like 34 mins to mine my transactions. How can I programmatically calculate these value using web3j. Please help me.