mkdir SourceTracker
cd SourceTracker
truffle init
Open truffle-config.js or truffle.js (located in the SourceTracker directory). Paste the following code under "Networks:" to tell Truffle to connect to Ganache:
development: {
host: "localhost",
port: 7545,
network_id: "*",
},And the following code under "Compilers:" to tell Truffle what compiler version you want to use:
solc: {
version: "0.5.0",
settings: {
optimizer: {
enabled: true,
runs: 200
},
}
}Drag and drop SourceTracker.sol into SourceTracker/contracts
truffle compile
touch migrations/2_salmon_migration.js
In 2_salmon_migration.js, paste the following code:
var Salmon = artifacts.require("SourceTracker");
module.exports = function(deployer)
{
deployer.deploy(Salmon, "salmon", 1000);
}This specifies what contract you'd like to deploy and what its constructor parameters are.
Open the Ganache app.
truffle migrate