5

I have parity running on my mac and I can start it with

parity --rpcaddr 0.0.0.0 --rpcport 8547 --port 30305 --rpccorsdomain '*' --rpcapi "eth,net,web3"

Once It's all sync'd up I then make a new directory and cd into it and then truffle init I then change truffle.js

module.exports = {
  networks: {
    development: {
      host: "0.0.0.0",
      port: 8547,
      network_id: "1" 
    }
  }
};

I run truffle test and get

Error: Don't set config.from directly. Instead, set config.networks and 
then config.networks[<network name>].from
    at Config.set [as from] 
(/usr/local/lib/node_modules/truffle/build/cli.bundled.js:1868:15)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:209751:21
at process._tickCallback (internal/process/next_tick.js:109:7)

and if i try to deploy a test contract

truffle migrate --reset
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 (native)
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:72807:12)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:95270:23
at Object.needsMigrating (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:72955:14)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:95266:19
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:58698:9
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:37442:13
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:220423:9 
  • This isn't really an answer, but I restarted my computer to fix this issue. As there are a few StackOverflow questions on this topic and no answers, they may be related to a local-state issue. – ghayes Nov 19 '18 at 22:37
0

Just had a similar issue with Pantheon client (it doesn’t support account management at the moment).

Make sure that your node returns at least one imported account in response for eth_accounts call (more information here https://wiki.parity.io/JSONRPC-eth-module#eth_accounts):

curl --data '{"method":"eth_accounts","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

It should return a response like this:

{"jsonrpc":"2.0","result":["0x254fccb0603859f096be3151b10ec4337b4fec57"],"id":1}

But if you see an empty array inside result filed instead, this means that you should check Account Options section in your Parity config. Probably you forgot to import or specify account(s) to use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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