I am trying to deploy contracts on a private geth node. I have mined enough that I have the account balance and the DAG was created.

Here is the netstats for the node :

enter image description here

Now, the contracts start deployment but take too much time. I am stuck for more than 20 minutes on this message :

Writing artifacts to ./build/contracts

Using network 'development'.

Running migration: 1_initial_migration.js
  Deploying Migrations...
  ... 0x68c7b0fcefaf58e20607bfebe8e31bf2d490fa4474478f0ecd96e540c34d58d3

testrpc takes seconds in deployment. Can I make this deployment go fast in any way? I am deploying on the bootstrap node. Even though it shows bootstrap as offline in image, it comes back up in a second.

(Edited according to answer) truffle :

module.exports = {
  networks: {
    development: {
      host: "",
      port: 8545,
      // Match any network id
      network_id: "*",
      from: "",
      gas: 4710000
    ropsten: {
      host: "localhost",
      port: 8545,
      network_id: "3",
      from: ""
  • are you mining? you need to start mining first, otherwise the tx just stays in the pool Sep 4 '17 at 3:52
  • I started mining, then when the DAG completed and blocks were made, I stopped it. I dont think I can do both mining and deployment with same account as mining locks the account; which is why I stopped the mining. Sep 4 '17 at 3:54
  • 2
    you can mine and deploy with the same account at the same time. miners themselves can certainly send transactions :) Sep 4 '17 at 3:56
  • I am getting this now Error: The contract code couldn't be stored, please check your gas amount.. I have >600 eth and the error is still there. What can I do about it? Sep 4 '17 at 3:59
  • how are you deploying your contract? include the deployment code that failed if you can, please Sep 4 '17 at 4:03

You need to specify the amount of gas you're willing to spend in your 'truffle.js' file up to a max of 4710000.

Add the line: gas: 4710000 to your network config.

If you get exceeds block gas limit the total size of the contracts pure deploying per block are too big.

  • I added the gas amount into the code, it still gives same error msg : Error: The contract code couldn't be stored, please check your gas amount. Sep 4 '17 at 7:39
  • Can you post your 2_migrations file and the contract you're trying to deploy ?
    – JohnAllen
    Sep 4 '17 at 16:10
  • Also you're SURE you're mining too right? The mining is what actually adds your contract to the blockchain.
    – JohnAllen
    Sep 4 '17 at 16:59
  • I got it working. I am using docker and the actual reason for the problem was some complication with the image instead of network issue. Now, I can connect to contract, but it just says : [TXS] Pending: 5 from: bootstrap instead of actually doing something. bootstrap is the docker image that runs geth. I kept mining when I was deploying contracts. Now that the contracts are successfully deployed, I have stopped mining. Is that affecting the usage of contract? Sep 4 '17 at 18:54

Considering all the comments, it seems that you are not mining while deploying. EVERY transactions need to be mined. So start mining and that will do.

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.