Deploying a USD token for accounting

Let's deploy the contract token we wrote in the previous section to our Ganache development blockchain, as follows:

  1. Bring your Ganache blockchain online. 
  2. Start your truffle console and connect it to the local blockchain by using the following command:
>>truffle console
  1. Move the USD.sol file to the contracts directory in your truffle path. Navigate back to the truffle console and compile the contract from the truffle console, like this:
(truffle development)>> compile
  1. Next, create a migration file for USD.sol, like this:
create migration USD
  1. Check under the migration directory in your truffle path. You'll observe a new migration file for USD. Update it, as follows:
const USD = artifacts.require("USD");

module.exports = function(deployer) {
deployer.deploy(USD);
};
  1.  Navigate back to the console. Migrate the contract to the Ganache blockchain with the help of the following command:
(truffle development)>> migrate

Capture the contract address from the console, after the contract has been deployed. Keep this safe as we'll need it later. The contract address is highlighted in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.106.100