Then install truffle
npm install --global truffle
Create metacoin example project
mkdir metacoin
cd metacoin
truffle unbox metacoin
Update truffle.js
with the following:
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
networks: {
ganache: {
host: "127.0.0.1",
port: 7545,
network_id: "5777" // ganache network id
}
}
};
Run migrations
truffle migrate --network ganache
Run tests
truffle test --network ganache