Before pushing an action on blockchain, how do I find out the minimum amount of cpu and net bandwidth required for my transaction to be completed? If there is no way to know such thing, then how do I decide how much EOS do I delegate to my account (I want to minimise the amount of EOS delegated)
1 Answer
CPU bandwidth depends on execution time and net bandwidth depends on the transaction size (bytes). The only way to know is to measure, either on the mainnet or on a similarly-loaded testnet. CPU bandwidth will vary between producers.
Option A:
- Run
cleos get account
and look at theused
fields undernet bandwidth
andcpu bandwidth
- Issue the transaction
- Run
cleos get account
and subtract the fields
Option B:
- Issue the transaction
- Get these fields from the transaction from the block:
cpu_usage_us
andnet_usage_words
cleos get account
example:
$ cleos get account useraaaaaaaa
net bandwidth: (averaged over 3 days)
staked: 50335451.0469 SYS (total stake delegated from account to self)
delegated: 0.0000 SYS (total staked delegated to account from others)
used: 384 bytes
available: 38.46 Gb
limit: 38.46 Gb
cpu bandwidth: (averaged over 3 days)
staked: 50335451.0469 SYS (total stake delegated from account to self)
delegated: 0.0000 SYS (total staked delegated to account from others)
used: 17.05 ms
available: 0.676 hr
limit: 0.676 hr
-
The example is for Option A. Could you also provide an example for Option B?– friedgerJun 15, 2018 at 16:38
-
1any documents? like formulas or codes? If my transaction has a big
memo
, does that mean it take more net? or more ram? Jun 19, 2018 at 10:15 -
@spartucus big memo should take more net and more cpu but not more ram Aug 11, 2018 at 15:47