Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to deploy contract #2773

Closed
industral opened this issue May 2, 2019 · 5 comments
Closed

Unable to deploy contract #2773

industral opened this issue May 2, 2019 · 5 comments

Comments

@industral
Copy link

industral commented May 2, 2019

Description

Unable to deploy contract.
Was working on beta-34, error with beta-50, not working at all with beta-53.

Expected behavior

  const contractInstance = new web3.eth.Contract(contract.abi);

  const inbox = await contractInstance.deploy({
    data: contract.evm.bytecode.object,
    arguments: ["Test"]
  }).send({from: accounts[0], gas: 1000000});

should deploy contract.

Actual behavior

  • web3@1.0.0-beta.34 - works fine
  • web3@1.0.0-beta.50 - error
  • web3@1.0.0-beta.53 - doesn't return neither throw anything...

Steps to reproduce the behavior

Inbox.sol
test.js

node ./test.js

Versions

  • solc: 0.5.8
  • ganache: 6.4.3
  • web3.js: 1.0.0-beta.50/53
  • nodejs: v10.15.3

ABI

@nivida
Copy link
Contributor

nivida commented May 2, 2019

Could you add the thrown error message and did you configure the transaction confirmation workflow as described in the documentation?

@industral
Copy link
Author

industral commented May 2, 2019

@nivida

Could you add the thrown error message

throw error linked above https://gist.githubusercontent.com/industral/0aa368b8a5348613b07c3e27ff9bfdec/raw/a6f79bb1adb7af36efb530460993300145a05381/gistfile1.txt

did you configure the transaction confirmation workflow as described in the documentation?

Not sure what you mean. Code also provided above https://gist.github.com/industral/16760065d5492c11107a462a1c3cdad3

@nivida
Copy link
Contributor

nivida commented May 2, 2019

throw error linked above

The given error doesn't look like a normal Web3.js error. Did you also test it with geth and parity?

Not sure what you mean. Code also provided above

Web3 Module Options

@industral
Copy link
Author

Settings transactionConfirmationBlocks to 1 fixed problem.

By default it was 24.

console.log(web3.eth.transactionConfirmationBlocks);
const web3 = new Web3(provider, null, {
  transactionConfirmationBlocks: 1
});

I guess that should be 1, as 24 blocks at ~15sec it's about 5 minute minimum of waiting. Also should be better documented. Thanks @nivida for help!

@nivida
Copy link
Contributor

nivida commented May 2, 2019

Great! Yes, this should be better documented and also added to the Getting Started section. I will improve it with the next update of the documentation.
I think it should be one in a local development environment but it should be set to a way higher value in a production environment.

@nivida nivida closed this as completed May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants