2

I'm trying to deploy a simple contract to truffle. This is very confusing now because truffle has it's own network built into it, yet the tutorial I'm following uses test-rpc. I've looked at a few other questions about this but none seem to address my specific issue.

I'm running the command:

test-rpc --network-id 1337

Inside of my project I've configured my truffle.js like so:

module.exports = {
    networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "1337"
    }
  }
};

Then I ran:

truffle compile
truffle migrate

truffle console

I check to verify my contract has been deployed in the console by running:

OrdersFacilitator.network_id

this returns 1337 yet when I run:

var facilitator;
OrdersFacilitator.deployed().then(x => facilitator = x);

I receive an error:

Error: OrdersFacilitator has not been deployed to detected network (network/artifact mismatch)

The weird thing is that when I run OrdersFacilitator.network_id it shows the proper networkId. How can I fix this issue?

johnny 5
  • 293
  • 3
  • 16

0 Answers0