2

Issue

I want to create a default generated project working with Truffle. After running the commands truffle init, truffle compile and truffle migrate I got the error: Expected parameter 'from' not passed to function. The geth rpc is successfully running in the other window of Terminal so it's not the cause of the problem. I expect Truffle to start deploying migrations for the default Truffle project.

Actual Results

Using network 'development'.

/usr/local/lib/node_modules/truffle/build/cli.bundled.js:23538
        throw new Error("Expected parameter '" + key + "' not passed to function.");
        ^

Error: Expected parameter 'from' not passed to function.
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:23538:15
    at Array.forEach (<anonymous>)
    at Object.options (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:23536:19)
    at Object.run (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:66868:12)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:88946:23
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:67033:9
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:66861:7
    at done (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:155469:5)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:155526:11
    at FSReqWrap.oncomplete (fs.js:153:5)

Environment

  • Operating System: macOS Sierra
  • Truffle version: 3.4.9
  • Ethereum client: Geth 1.6.7
  • node version: 8.3.0
  • npm version: 5.3.0

1 Answer 1

2

truffle needs to know from which address you want to send transactions.

Try to specify this in truffle.js config file:

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*", // Match any network id
      from: <your address here>
    }
  }
};

Be sure that this address is unlocked in geth before deploying.

2
  • Now it gives me an error: imgur.com/a/v93Jq It says that the address is invalid, but I already unlocked it
    – linkas
    Commented Aug 30, 2017 at 13:54
  • Make sure your address is surrounded by double quotes, e.g. "0xf2983...."
    – manuhalo
    Commented Oct 13, 2017 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.