Awaiting on a transaction to deploy a web3 contract in beta.52 never returns, even though the transaction does go through and the contract is deployed. Tested in ganache with both instant seal and 1s block time. The same snippet worked fine in beta.37.
Awaiting on Contract.deploy().send() should return after the transaction is mined.
Awaiting on Contract.deploy().send() never returns.
Contract.deploy().send()None, but ganache reports the transaction as successful:
Transaction: 0xd74bac6e76aa75e9c9a8998cc0e1835acf38ddf92cd07d47e694709b12b7f58c
Contract created: 0x5b1869d9a4c187f2eaa108f3062412ecf0526b24
Gas usage: 412242
Block Number: 44
Block Time: Sun Apr 14 2019 17:27:16 GMT-0300 (Argentina Standard Time)
const Web3 = require('web3');
async function main() {
const web3 = new Web3('http://localhost:8545');
const [from] = await web3.eth.getAccounts();
const artifact = require('./Greeter.json');
const data = artifact.compilerOutput.evm.bytecode.object;
const abi = artifact.compilerOutput.abi;
const Greeter = new web3.eth.Contract(abi, null, { data, gas: 1e6 });
const greeter = await Greeter.deploy({ arguments: ["Hello"] }).send({ from });
console.log(`Deployed at ${greeter.options.address}`);
}
main();
Thanks for opening this issue!
Did you configure the transactionConfirmationBlocks as described here?
Adding that configuration fixed the issue, thanks! That said, I would expect the option to have a reasonable default value if it is not set.
I too was able to fix this with transactionConfirmationBlocks, but if I'm developing locally with ganache and deploying I need to manually mine a block in order to get a response.
Is there a reasonable way to get around having to do this manual step?
i think I have the same issue, see #2661
@ejwessel We have an issue with the transaction confirmation workflow over an HTTP connection as mentioned from @szerintedmi. Because of this will I close this issue.
As long as the issue is not fixed, it should be left open.
It's a duplication of #2661 @Levino