System Resources
The EOS blockchain works with three system resources: CPU, NET and RAM. The EOS accounts need sufficient system resources to interact with the smart contracts deployed on the blockchain.
To allocate RAM resources to an account you have to purchase RAM. To allocate CPU and NET resources to an account you have to power up the account.
Resource Cost Estimation
As a developer if you want to estimate how much CPU and NET a transaction requires for execution, you can employ one of the following methods:
- Use the
--dry-run
option for thedune -- cleos push transaction
command. - Use any tool that can pack a transaction and send it to the blockchain and specify the
--dry-run
option. - Use the chain API endpoint
compute_transaction
.
In all cases, when the transaction is processed, the blockchain node simulates the execution of the transaction and, as a consequence, the state of the blockchain is changed speculatively, which allows for the CPU and NET measurements to be done. However, the transaction is not sent to the blockchain and the caller receives the estimated CPU and NET costs in return.