To deploy the smart contract, first bring your Ganache blockchain online. Make sure your Ganache test server is running on localhost:8545. To do so, select the New Workspace option from the Ganache launch screen. Click on the Server tab on the Workspace screen. Set the port number to 8545, as shown in the following screenshot:
Click on Save Workspace in the upper-right corner. A blockchain network will be started, as follows:
Let's deploy the contracts we built earlier to our Ganache blockchain, as follows:
- Open a Terminal window and navigate to your truffle project directory. Bring the truffle console online by entering the following command:
truffle console
- Copy and paste the LCMaster.sol and LC.sol contracts into the contracts directory in your truffle project.
- As shown in the following screenshot, navigate back to the truffle...