Truffle: Error in deploying to Geth

Created on 3 Aug 2016  路  9Comments  路  Source: trufflesuite/truffle

After upgrading to Truffle 2.0, I've managed to migrate and deploy contracts on ethereumjs-testrpc with no problem. But I failed to do that in trying to deploy on my local Geth node. The error msgs are: Error encountered, bailing. Network state unknown. Review successful transactions manually. invalid address.

My Geth version is 1.4.9-stable-b7e3dfc5. And I can log in to it with geth attach and do stuff with no problem. So I'm sure the Geth is working fine.

Most helpful comment

Hello,
I am a beginner in dapp and English too.
I have the same error but I do not know were setting the default account.
Sorry if my question seems stupid.

Thank you in advance for your answer,
Rsav

All 9 comments

Figured it out. I didn't specify the default account when deploying contracts. But I think maybe, we can have a clearer the error message to point to the right direction?

Hello,
I am a beginner in dapp and English too.
I have the same error but I do not know were setting the default account.
Sorry if my question seems stupid.

Thank you in advance for your answer,
Rsav

@rsav34 if you are still looking, or for anyone that stumbles in here.

Your RPC node (geth) needs to have atleast one unlocked account which can be used to create the migration contract. This account also needs to have sufficient funds to deploy the contract.

In case you have multiple accounts unlocked on geth, you can set the account with sufficient funds as default. You can set default using the truffle.js config file as documented here https://truffle.readthedocs.io/en/latest/advanced/configuration/.

New info is here btw: http://truffleframework.com/docs/advanced/configuration

from console: personal.unlockAccount("ADDRESS", "PHRASE")

Add the from parameter into truffle.js development field, then in your geth console, unlock the account which you gave as the value of the from key.

For example in truffle.js:

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

Then in geth console, unlock the account:

personal.unlockAccount("<your_address>")

geth console will ask for your passphrase, supply it and return to truffle to migrate again.
You shouldn't have any problem.

Hi @DOkwufulueze I can't understand the "your_address"

Hi, @cristicmf.
<your_address> is a placeholder which you should replace with the address you want to use to deploy your Smart Contracts, eg 0xabcdef1234567...

<your_address> is usually your coinbase, but you may choose any other address that has enough funds to do a successful migration. Make sure you unlock it using the command [personal.unlockAccount("<your_address>")] in your geth console.

Hope this explanation clears up my use of <your_address>. 馃檪

thank you~
So patiently explain the problem. 馃槃

If you connect with this command:
geth --rinkeby --rpc --rpcapi db,eth,net,web3,personal --unlock="<yourAddress>"

You need to indicate your passphrase after that.

Was this page helpful?
0 / 5 - 0 ratings