Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Truffle error: Error encountered, bailing. Network state unknown. Review successful transactions manually

Every time I try to deploy truffle migrate --reset my Organization.sol contract, I get the following error

Error encountered, bailing. Network state unknown. Review successful transactions manually.

I Googled the error and apparently this is due to contract size. My Organization.sol is not even that big; I’ve seen bigger contracts before.

Here is my contract: https://github.com/ulixir/eth-task-contracts/blob/master/contracts/Organization.sol

Any clues?

like image 644
Red Ghost Avatar asked Nov 01 '17 00:11

Red Ghost


1 Answers

Do you also see an error this error Error: insufficient funds for gas * price + value? In that case, the ethereum account you are trying to use may not have enough ether to perform the migration.
Ether can be added to an account by calling miner.start() from the geth console or by allocating ether to the account using the genesis.json file. You can read more about it here.

If you decide to use the genesis file, take the following steps after allocating data to your ethereum account:
1. remove the old geth db using geth --datadir "<your datadir>" removedb.
2. Reinitialize your geth node using the modified genesis file geth <your other params here> init <yourGenesisFile>
3. within the geth console of the new node, make sure you start the miner miner.start()

When done, try the migration again, it should work now.

If you decided to mine ether without modifying the genesis file, start the mining and give your ethereum account some time to mine enough ether. How long would this take?....... That depends on the difficulty level you set on your genesis file.

like image 94
Lone Ronin Avatar answered Oct 18 '22 12:10

Lone Ronin