0

I am trying to deploy a work in progress dapp to the ropsten network using:

truffle migrate --network ropsten

I have a geth instance running in terminal and I receive the following error:

Unknown network "true". See your Truffle configuration file for available networks.

This is my truffle.js file:

    module.exports = {
      networks: {
        development: {
          host: "localhost",
          port: 8545,
          network_id: "*" // Match any network id
        },
        ropsten: {
          network_id: 3,
          host: "localhost",
          from: "<<Address is usually here>>",
          port: 8545,
          gas: 2900000
        }
      }
    };

EDIT: I am using ubuntu for development

3 Answers 3

1

If you're on Windows, make sure you're using truffle-config.js otherwise use truffle.js for configuration. I usually keep both files in sync to avoid confusion.

2
  • I am using Ubuntu for development so I don't think I have truffle-config.js, only truffle.js. I will edit the post.
    – David Weir
    Feb 7, 2018 at 14:39
  • Somehow your network is being evaluated as 'true' instead of 'ropsten'. Configuration file looks fine but re-check for any typos in your file in case it's not exactly as pasted in the question. Feb 7, 2018 at 15:10
0

The problem was fixed after a fresh install of truffle

0

Not sure how beneficial now, but for future reference: I've moved on from truffles configs as I've had some problems on the mainnet. I've been deploying for some time using plain old node.js scripts and I've even written a small library to help me out. Here is a snippet:

const etherlime = require('etherlime');

const ICOTokenContract = require('./build/contracts/ICOToken.json');

const randomAddress = '0xda8a06f1c910cab18ad187be1faa2b8606c2ec86';

const defaultConfigs = {
    gasPrice: 20000000000,
    gasLimit: 4700000
}

const deployer = new etherlime.InfuraPrivateKeyDeployer('Your Privste KEY', 'ropsten', 'Your infura API key', defaultConfigs);

const runICODeployment = async () => {
    const contractWrapper = await deployer.deploy(ICOTokenContract);
    const transferTransaction = await contractWrapper.contract.transferOwnership(randomAddress);
    const result = await contractWrapper.verboseWaitForTransaction(transferTransaction.hash, 'Transfer Ownership');
}
runICODeployment()

Paste this in a file, change your contracts

Your Answer

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

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