I followed the steps in the following link to create a local Ethereum testnet, but now I want to deploy a contract to "MyTestNetNode":


testrpc wasn't a good option because test rpc doesn't save the state when you stop the daemon. I need to create a testnet with geth which I have already done and I would like to deploy a contract to it using Truffle without getting errors. Can anyone help me?


All you need is to change the truffle config file according to your local configuration:

module.exports = {
  networks: {
    development: {
      host: 'localhost',
      port: 8545, //the port of your local testnet
      network_id: '*' //any network ID

in top of that you can actually use also ganache-cli as testrpc client and add the parameter --db to save the database. In this way you can run the test node again using the saved data instead of starting from a new one anytime

| improve this answer | |

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.