From 640fbccc8cd98c23f53d41b1ff31594420b7c3fa Mon Sep 17 00:00:00 2001 From: Ujwal Battar Date: Tue, 19 Mar 2019 14:41:35 -0700 Subject: [PATCH] Add ECommerce to migrations --- README.md | 9 ++++++--- migrations/2_deploy_contracts.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 93f922f..952b75a 100644 --- a/README.md +++ b/README.md @@ -482,17 +482,20 @@ Now that you have acquainted yourself with the tools, let us get started writing Now that we have the smart contract in our application, we can go ahead and compile and migrate it. -1. In the terminal, in the root of our dApp run `tronbox compile --compile-all` +1. In application, make the following changes to the migrations/2_deploy_contracts.js file: + - Change line 1(`// var MyContract = artifacts.require("./MyContract.sol");`) to be `var ECommerce = artifacts.require("./ECommerce.sol");`. + - Change line 4(`// deployer.deploy(MyContract);`) to be `deployer.deploy(ECommerce);`. +2. In the terminal, in the root of our dApp run `tronbox compile --compile-all` - This command will compile all the contracts you have in your application. - You should see an output similar to this: ![contract-compilation](./public/reference-images/contract-compilation.png) -2. Now run `tronbox migrate --reset --network shasta` - This tells tronbox to use Shasta network, reset the network, and migrate the contracts onto the network./ - Your output should look similar to this: +3. Now run `tronbox migrate --reset --network shasta` - This tells tronbox to use Shasta network, reset the network, and migrate the contracts onto the network./ - Your output should look similar to this: ![contract-migration](./public/reference-images/contract-migration-shasta.png) -3. Be sure to grab the ECommerce contracts address provided by the previous command. You will see it in both base58 and hex formats. We only need hex but you can store both just in case. - Head over to the **src/components/ECommerce/index.js** file in your text editor. - Near the top of the file, you will see a place to post these addresses. +4. Be sure to grab the ECommerce contracts address provided by the previous command. You will see it in both base58 and hex formats. We only need hex but you can store both just in case. - Head over to the **src/components/ECommerce/index.js** file in your text editor. - Near the top of the file, you will see a place to post these addresses. ### Linking the Front-End of our dApp to our Smart Contract diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 1031ab3..fff637d 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -1,5 +1,5 @@ -// var MyContract = artifacts.require("./MyContract.sol"); +var ECommerce = artifacts.require("./ECommerce.sol"); module.exports = function(deployer) { - // deployer.deploy(MyContract); + deployer.deploy(ECommerce); };