I'm trying to access a smart contract in my local dev environment, but it doesn't appear to be deploying fully. In summary, I get what seems to be a successful migration, however, I am not able to access the contract using web3.js/truffle-contract.js, and I get the following response in truffle console (MyToken.deployed() does return the expected contract info):
truffle(development)> MyTokenCrowdsale.deployed();
Uncaught:
Error: MyTokenCrowdsale has not been deployed to detected network (network/artifact mismatch)
truffle(development)>
All tests against the 'Crowdale' contract pass
The output from truffle migrate is:
Running migration: 1_initial_migration.js
Deploying Migrations...
... 0xa85fc78b1b630c0234376fcf3cb27f47c10cda7c0c35c517518b017edaa31b97
Migrations: 0x417007b8fcd1a9c970f03756857ff27ebb61135f
Saving artifacts...
Running migration: 2_deploy_crowdsale.js
Deploying MyToken...
... 0x7d5c3d4d6d60139001eab8621cec5b98cf893a44786abb96e901fe942bcdea47
MyToken: 0xd4bd879faa59c4b5b3af1e9074d71ab407cb19da
Saving artifacts...
Deploying MyTokenCrowdsale...
... 0xe469c8fbd19895674074d6fbeb2b3bcf1d2adaefc07aabf74254aa99678f275e
MyTokenCrowdsale: 0x35b66ed95a88157ddaf85c20a1d3d189c5cdafa3
I'm running a local dev node with ganache-cli. The network config is:
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
ganache: {
post: 'localhost',
port: 8545,
networkd_id: '*'
},
Thanks!