Skip to content

Commit

Permalink
Add ECommerce to migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
UjwalBattar committed Mar 19, 2019
1 parent e922503 commit 640fbcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions README.md
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions 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);
};

0 comments on commit 640fbcc

Please sign in to comment.