This is the short presentation of how does the theorem works at a high level.
This presentation introduces Metamask, Infura, Etherscan, ... and how those systems interact with smart contracts.
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
Blockchain introduction
1. Login to Metamask
Send transaction
(buy creeptoma)
Call
infura service
(currently free)
Select one node
+
execute
transaction/query
Choose one node
execute
transaction/query
Send query
directly to infura
(without login.
i.e: get creeptoma price)
Send directly
to one node
MainNet
Blockchain
TestNet
Blockchain
2.
3. contract Creeptoma {
function int getCreeptomaPrice(){}
}
Deploy
- directly to one node
- through infura
0x3cd9498845833058e48fde…
Creetoma.getCreeptomaPrice()
Call method
of
smart contract
Local
Blockchain
TestNet
Blockchain
(8GB)
MainNet
Blockchain
(>1TB)
4.
5. 20,000 gas
3$/ 1gas
1$/ 1gas
3$/ 1gas : gas price
20,000: gas used
// Estimate:
// Gas price: 1 gas = 10 Gwei
// 1 Ether = 650$
// return a string
export function estimateGasToUSD(gas) {
return gweiToEther(gas * 10 * 750) + '$';
}