i

Blockchain Complete Guide  

Making a Blockchain Application

1. We can make a project using truffle init.
Truffle comes bundled with many commands like
truffle compile
truffle console
truffle test
truffle build
truffle box
One such command is truffle init
It would create a basic structure for our blockchain application.

2. Run our Blockchain (In this case, Personal blockchain)

3. Make sure to make changes to truffle-config.js to set network settings

Host, port and network_id should match to our blockchain configurations (Personal Blockchain in our case)

4. Make a smart contract (We will be using VS Code along with truffle framework)

5. Make a deployment file and name it 2_deploy_contracts.js

7. Compile the smart contract


After compilation, it will generate corresponding .json file for smart contracts named .abi files and address will be generated for smart contract.

8. Once compiled successfully, Open another terminal and deploy the smart contract on the blockchain network.
Execute
truffle migrate

This migration of smart contract to our blockchain would cost ether.

The first account from the list of ten accounts is chosen as the deploying account (The account which deploys smart contract)

9. Test Application using truffle console  (Truffle provide a console for testing our smart contract status)

10. Calling out the functions and attribute provided by smart contract

As we discussed, writing operations on Ethereum (blockchain in general) cost gas (Ether correspondingly) while reading operations do not.
So, we can see that there was no change in the number of ethers for account1.

11. While for writing operations, it costs gas

We can check our post like this (which is again a reading operation)