Steemit Crypto Academy – Season 2 - Week 5 - Post for @sapwood

in hive-108451 •  4 years ago  (edited)

steemit crypto academy - bandwidth & Energy (Tron)..jpg

Hello awesome people, how is everyone doing today, we are on another fun weekend, lots of amazing things have happened over the week and we are aiming to round up the week on a positive note. Exciting times ahead as we look forward to the new week to come. This week’s topic is about bandwidth & Energy (Tron).

How to connect my TronLink Wallet to Tronscan.org

Connecting tronlink wallet to tronscan is quite an easy and straight forward process. This can be achieved by either connecting to the tronlink extension wallet or the tronlink mobile wallet app. For this demonstration, I will be connecting to my tronlink extension wallet. To do this,

Screenshot (2879).png

  • You will be shown two options to connect to either tronlink or ledger, but in this case, we will be connecting to tronlink
  • Select TronLink
  • Click on connect

Screenshot (2882).png

  • Tronlink and tronscan are well integrated that it is superfast to connect. Your tronlink extension is now connected to tronscan

Screenshot (2883).png

How to freeze TRX to obtain Bandwidth

Freezing TRX to obtain bandwidth using tronscan is also very easy and straightforward. To do this,

  • After connecting your tronlink wallet to tronscan, click on resources tab
  • Click on the obtain button

Screenshot (2885).png

  • On the obtain drop-down, click on Tron power and bandwidth.

Screenshot (2887).png

  • Input the amount of TRX you want to freeze
  • Confirm the terms

Screenshot (2894).png

  • Accept the transaction on tronlink extension
  • Done, you have successfully frozen the desired number of TRX

Screenshot (2889).png

Screenshot (2891).png

How to freeze TRX to obtain Energy

This is a similar process to how to freeze TRX to obtain bandwidth. As expected, Freezing TRX to obtain energy using tronscan is also very easy and straightforward. To do this,

  • After connecting your tronlink wallet to tronscan, click on resources tab
  • Click on the obtain button

Screenshot (2885).png

  • On the obtain drop-down, click on Tron power and energy.

Screenshot (2893).png

  • Input the amount of TRX you want to freeze
  • Confirm the terms

Screenshot (2896).png

  • Accept the transaction on tronlink extension
  • Done, you have successfully frozen the desired number of TRX

Screenshot (2897).png

Screenshot (2898).png

What types of transaction consumes Bandwidth only and what types of transaction consume both Bandwidth & Energy?

Only bandwidth

On the tron blockchain, bandwidth and energy are very important elements of the blockchain network. Ordinary transactions on tron like transfers only consumes bandwidth.

Screenshot (2903).png

Both bandwidth and energy

On the tron blockchain, transactions that involves the use of smart contract calls on the tron blockchain uses both bandwidth and energy. This is because of the complex nature of smart contracts.

Screenshot (2935).png

Screenshot (2936).png

How do I check "how much Bandwidth and Energy are consumed

To check how much bandwidth and energy are consumed in a particular transaction on tronscan is easy and straight forward.

  • On tronscan, search your wallet address on the search bar

Screenshot (2904).png

  • Scroll down and select transactions
  • Choose from the list of transaction hash and click on anyone

Screenshot (2907).png

  • You will see the amount of bandwidth used at the bottom

Screenshot (2906).png

How do I avoid burning TRX to accommodate the Energy

On tron blockchain, the way to avoid using TRX to compensate for lack of energy is to freeze TRX to obtain energy like I showed above. Before you can do this, you need to have a decent amount of liquid TRX on your wallet, then you can decide to freeze any amount of TRX to obtain energy, that way, you don’t need to burn your TRX whenever you are performing a transaction that requires energy.

Freezing TRX to obtain energy is calculated by the following, the amount of TRX I have frozen divided by the total amount of TRX that is frozen in the tron network multiplied by 50,000,000,000.

How to freeze TRX to obtain energy

  • Click on resources tab
  • Click on the obtain button

Screenshot (2885).png

  • On the obtain drop-down, click on Tron power and energy.

Screenshot (2893).png

  • Input the amount of TRX you want to freeze
  • Confirm the terms

Screenshot (2896).png

  • Accept the transaction on tronlink extension
  • Done, you have successfully frozen the desired number of TRX

Screenshot (2897).png

Screenshot (2898).png

Interaction with Justswap

Using justswap is a easy and straight forward to do, everything can be done without much extra steps.

  • On tronscan, click on JustDefi, select Justswap

Screenshot (2908).png

Screenshot (2909).png

  • On Justswap, select the token you want to swap TRX to or vice versa. I will be swapping TRX to WIN token
  • Input the amount you want to swap. for this demo, I used 1 TRX to get 142.93771 WIN tokens
  • Click on swap to initiate the swap protocol

Screenshot (2912).png

  • you will be prompted to accept the smart contract call on your tronlink extension, accept to complete the swap.

Screenshot (2914).png

Screenshot (2915).png

check wallet to identify an "ordinary transfer" & a "Smart-contract-operated transfer"

To identify an ordinary transfer and a smart contract transfer is a straight forward process on tronscan.

  • On tronscan, search your wallet address on the search bar
    Screenshot (2904).png

  • Scroll down and select transactions

Screenshot (2933).png

  • You will see a list of all the transactions you have performed using your tronwallet.
  • Look for the transaction that has “Transfer”

Screenshot (2932).png

  • Select any transfer you want to check and click on the hash to open the transfer info page

Screenshot (2934).png

  • From the data, you can see that only bandwidth was used to perform an ordinary transfer transaction.
  • For the smart contract info, Look for the transaction that has “Trigger Smart Contracts”

Screenshot (2931).png

  • Select any Trigger Smart Contracts you want to check and click on the hash to open the transfer info page

Screenshot (2935).png

Screenshot (2936).png

  • From the data, you can see that both bandwidth and energy was used to perform a smart contract transaction.

The difference between the two transactions is that for an ordinary transfer, only bandwidth is used to carry out that operation. While for a smart contract transaction, both bandwidth and energy are used to carry out smart contract transactions.

@sapwood

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
  ·  4 years ago (edited)

Thank you for attending the lecture in Steemit-Crypto-Academy- Season 2 & doing the homework task-5.

This is because of the complex nature of smart contracts.

That's because a particular function needs to be executed in the virtual machine, therefore it requires CPU and storage.

Freezing TRX to obtain energy is calculated by the following, the amount of TRX I have frozen divided by the total amount of TRX that is frozen in the tron network multiplied by 50,000,000,000.

At the moment total energy limit is not 50,000,000,000. The actual figure is somewhere around 90 billion at the moment. And it's a dynamic thing.

Suggestions/Feedback

  • The author has produced real transactions(mint function in JustLend & swap function in Justswap) to demonstrate Bandwidth & Energy.
  • The transactions of a borrow function in Just Lend is missing. So the comparative analysis of resource consumption(between borrow & swap function) is also missing.
  • We would suggest the author cover all sub-parts and should be in line with the requirements to score better.

Thank you.


Homework Task -5 accomplished.
[4.5]

Nice work! You just got yourself a $4.66 upvote. Enjoy! Check us out at acom.uno or swing by for a chat at ACOM Discord