oasislabs / secret-ballot

Secret Ballot example dApp
Apache License 2.0
7 stars 7 forks source link

2_deploy_contracts fails - Invalid number of parameters for "undefined". Got 2 expected 1!. #48

Open pblin opened 5 years ago

pblin commented 5 years ago

Compiling your contracts...

Building contracts for Oasis Compiling Migrations.sol... Compiling SecretBallot.sol...

Starting migrations...

Network name: 'oasis' Network id: 42261 Block gas limit: 0xf42400

2_deploy_contracts.js

Deploying 'SecretBallot'

Error: Deployment Failed

"SecretBallot" -- Invalid number of parameters for "undefined". Got 2 expected 1!.

willscott commented 5 years ago

It looks like we were packaging an older version of truffle with this repo. should have fixed that in https://github.com/oasislabs/secret-ballot/pull/49#pullrequestreview-223508556

If you install truffle globally per the readme, you should get a version that works with the migration script 👍

pblin commented 5 years ago

resolve this by using truffle 4.1.7 and adding

compilers: { solc: { version: "0.4.23" // ex: "0.4.20". (Default: Truffle's installed solc) } } to truffle-config.js

there was also a problem of web3.utils undefined at web3.utils.fromAscii. it was resolved by npm install web3c and adding use we3 = require('web3c');

contract is deployed successfully but the truffle migration hangs at eventually return some errors:

saving successful migration to network... ... 0x68ff89b8387403af878e34d7ac86146d307683ea164b5fd5ddf7f9af79d83356 Saving artifacts... Running migration: 2_deploy_contracts.js Replacing SecretBallot... ... 0xe604e9cbd4ed6ea8936bb57d8d9dbec24cfd505edae0caf3b090fbf54a289908 SecretBallot: 0x012048011da835101383ff037ea45d057fcfaae2 Saving successful migration to network... ... 0x69550d2351a8b0c71c76831fb5bb65bbb6882f0685c1278077336902b161d4b9 Saving artifacts... Error: Invalid JSON RPC response: "" at Object.InvalidResponse (/secret-ballot/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/fainashalts/truffle-dev/truffle/node_modules/web3/node_modules/web3-core-helpers/src/errors.js:42:1) at e.i.onreadystatechange (/secret-ballot/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/fainashalts/truffle-dev/truffle/node_modules/web3/node_modules/web3-providers-http/src/index.js:92:1) at e.t.dispatchEvent (/secret-ballot/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/fainashalts/truffle-dev/truffle/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:1) at e._setReadyState (/secret-ballot/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/fainashalts/truffle-dev/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:208:1) at e._onHttpRequestError (/secret-ballot/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/fainashalts/truffle-dev/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:349:1) at ClientRequest. (/secret-ballot/node_modules/truffle-hdwallet-provider/dist/webpack:/truffle-hdwallet-provider/Users/fainashalts/truffle-dev/truffle/node_modules/xhr2-cookies/dist/xml-http-request.js:252:47) at ClientRequest.emit (events.js:182:13) at TLSSocket.socketErrorListener (_http_client.js:392:9) at TLSSocket.emit (events.js:182:13) at emitErrorNT (internal/streams/destroy.js:82:8) at emitErrorAndCloseNT (internal/streams/destroy.js:50:3) at process._tickCallback (internal/process/next_tick.js:63:19)

willscott commented 5 years ago

can you try running with --verbose-rpc so we can get a better idea of which request truffle is getting stuck on?