Steemit Crypto Academy | Season 2 Week 5 Homework Post for @sapwood - Bandwitdh & Energy
Hello everyone. Our world has been fighting a big epidemic for more than a year. I hope all of you are in good health. Stay healthy! Thanks for reading.
Today I will share with you the my homework given by the professor @sapwood
How do I connect my TronLink Wallet to Tronscan.org?
First, go to tronscan => https://tronscan.org/
Then click Connect Wallet
On the page that opens, choose the method you want to connect. I choose TronLink. Then click Connect
Our TronLink wallet has been successfully connected to Tronscan.org!
How do I freeze TRX to obtain Bandwidth?
Move the mouse cursor over your Tron wallet address on the upper right corner of the Tronscan homepage. Click on your tron wallet address in the first row from the tabs that open.
On the page that opens, click on Obtain where I marked it.
Select TRON Power and Bandwidth from the Obtain section in the window that opens.
Write the TRX amount you want to freeze in the Amount section. The bottom part says how much Tron Power and Bandwidth you will earn based on the amount of TRX you will freeze. Then click Freeze
Confirm by clicking Accept in the window that opens.
We've successfully obtain Bandwidth!
How do I freeze TRX to obtain Energy?
Do the same things up to STEP 3 that we do when obtaining bandwidth. Select TRON Power and Energy from the Obtain section in the window that opens.
Write the TRX amount you want to freeze in the Amount section. The bottom part says how much Tron Power and Energy you will earn based on the amount of TRX you will freeze. Then click Freeze.
Confirm by clicking Accept in the window that opens.
We've successfully obtain Energy!
What types of transaction consumes Bandwidth only and what types of transaction consume both Bandwidth & Energy?
Consume Only Bandwidth
- Transfer: Consumes only Bandwidth when transferring TRX to another wallet.
- Freeze: TRX freezing only consumes bandwidth. TRX freezing to obtain bandwidth and energy during homework only consumed bandwidth.
- Unfreeze: TRX unfreezing only consume bandwidth. 2 weeks ago, the unfreezing transaction I did after homework only consumed bandwidth.
Consume Bandwidth & Energy
- Running Smart Contracts: It consumes both bandwidth and energy when running smart contracts.
2 weeks ago, when I supply TRX, I minted jTrx through the smart contract. While doing this, Bandwidth and Energy consumed.
2 weeks ago, I collateralized jtokens to borrow USDT. While doing this, Bandwidth and Energy consumed.
How do I check "How much Bandwidth and Energy are consumed in a particular transaction"?
Move the mouse cursor over your Tron wallet address on the upper right corner of the Tronscan homepage. Click on your tron wallet address in the first row from the tabs that open.
Click more to see all transactions.
Click Transfers on the page that opens.
Select TRX & TRC10 Transfer or TRC20 & TRC721 Transfer.
Select the transaction you want to look in the hash category on the left.
You can check how much bandwidth or energy you consume on the page that opens.
How do I avoid burning TRX to accommodate the Energy required for a transaction?
Gas fee are paid when doing transaction on the Ethereum network. The situation is different in the Tron network. Bandwidth or energy is consumed while performing transactions on the Tron network.
Our transactions consume energy when running a smart contract. If you do not have the necessary energy in your account, TRX will be burned automatically from your wallet and the transaction will take place. By freezing the TRX, we can obtain energy and avoid burning the TRX. After 72 hours, we can unfreeze and use those TRXs again.
From this calculator, we can calculate how much TRX we need to freeze for our transaction and how much TRX will be burned for insufficient energy.
For example, 10000 energy is required for the transaction we will do. In the calculator, we write the amount of energy (10000) required for our transaction in the Energy By Freezing TRX section. Then we can see the TRX amount (331.8221) we need to freeze on the left.
Let's say we have 5000 insufficient energy. In the calculator, we write the insufficient amount of energy (5000) in the Energy By Burning TRX section. Then, we can see the amount of TRX (0.7) that will be burned for insufficient energy.
Include the real example of your interaction with JustLend & Justswap. Indicate how a "swap"(in Justswap) function consumes different "Energy & Bandwidth" than a "borrow" function(in JustLend).
JustLend
I will quickly describe the initial processes we did on the S2W3 homework.
First, go to JustLend and connect your wallet.
Then supply tokens. I supplied TRX.
Then collate jTokens for borrow.
To borrow USDT, click Borrow on the right.
Enter the USDT amount you want to borrow and click Borrow.
Click Accept in the popup window to confirm.
We have successfully borrowed USDT!
Consumed Bandwidth: 313
I don't need to burn TRX while consuming it because it has free 5000 bandwidth.Consumed Energy:112,868
Since there was insufficient energy, 15.80138 TRX was burned.
JustSwap
First, go to JustSwap and connect your wallet.
Click select a token to choose the token you want to swap.
Find the token you want to exchange easily by typing in the search section.
Enter the amount you want to swap and click swap.
Here is the swap information. Confirm by clicking Confirm swap.
Click Accept to confirm.
We swapped successfully!
Consumed Bandwidth:350
I don't need to burn TRX while consuming it because it has free 5000 bandwidth.Consumed Energy:40,377
Since there was insufficient energy, 5.65222 TRX was burned.
Consumed | JustLend | JustSwap |
---|---|---|
Bandwidth | 313 | 350 |
Energy | 112,868 | 40,377 |
More bandwidth was consumed when swapping TRX / USDT on JustSwap than when borrowing USDT from JustLend.
Much less energy was consumed when swapping TRX / USDT on JustSwap than when borrowing USDT from JustLend. Since 1 energy = 1 microsecond, my borrowing transaction on JustLend took longer than the swap transaction I did on JustSwap.
**Explore Tronscan to identify an "ordinary transfer" & a "Smart-contract-operated transfer". **
Move the mouse cursor over your Tron wallet address on the upper right corner of the Tronscan homepage. Click on your tron wallet address in the first row from the tabs that open.
You can identify ordinary transfer or Smart-contract-operated transfer in the Transaction Type section.
Place the mouse cursor over the Transaction type for easier identification.
for exemple:
In ordinary transfer transactions, only bandwidth is consumed. However, while running the smart contract, both bandwidth and energy are consumed in the transactions.
CC: @sapwood
Thanks!