// Mini course

Lesson 03: Compile, Migrate, and Test

Now that the project files are ready, you can compile the Solidity contracts, launch Truffle's local blockchain, deploy the contracts, and run the automated tests. The PDF shows that compilation creates a build folder with JSON artifacts such as MetaCoin.json. fileciteturn0file0

📦 Download the complete MetaCoin project used in this tutorial from GitHub:

Download the MetaCoin Truffle Project


Compile the contracts

truffle compile

If PowerShell gives an execution error, the PDF suggests:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Start the Truffle development chain

truffle develop

This launches a local blockchain simulation with 10 test accounts and private keys for development. You can deploy and test safely without using real Ether. fileciteturn0file0

Deploy and test

migrate test

migrate deploys the contracts to the local chain. test runs the Truffle tests included with MetaCoin.

Restart cleanly when needed

truffle develop migrate --reset test

Use migrate --reset if you want to redeploy the contracts from scratch.

← PreviousNext →