Hot answers tagged

10 votes
Accepted

How Does NET/CPU Recharge Over Time?

This is what I understand after a quick walk, through the code. Your usage status is checked and updated on the chain only when an action​ is done with your account.( This is intuitive, when I look ...
6 votes

I'm still wrapping my head around EOS RAM and CPU resources. How do they work exactly?

EOS account can choose to buy ram or cpu? Can they not buy any at all? You need RAM for the nodes to store data about your account,--including account name, public keys, and other meta-data--in the ...
confused00's user avatar
  • 5,554
5 votes

How long is the reset period of the cpu bandwith?

libraries/chain/include/eosio/chain/config.hpp#L48-L49 static const uint32_t account_cpu_usage_average_window_ms = 24*60*60*1000l; static const uint32_t account_net_usage_average_window_ms = ...
NateBrune's user avatar
3 votes

Restricting runtime of a loop (Transaction took too long)

By default, Nodes have a config for max-transaction-time = 30 but it doesn't necessary for all Bp to have exact same config for max transaction time so they can change at any time. ::...
Farhan-TroonTechnologies's user avatar
3 votes

Why do failed transactions not consume CPU?

If transaction fails - it will fail on first validating node. It will not reach block producing node at all. Which mean there is no way this account can be charged for broadcasting bad transaction. ...
Vasiliy Bondarenko's user avatar
2 votes

What EOS Chain Information/Interaction do you wish was more publicly available?

Just a quick shot: Search for blocked/still available names and namespaces like it's done when buying an domain online Cost calculator for creating an account
Lau's user avatar
  • 203
2 votes
Accepted

What EOS Chain Information/Interaction do you wish was more publicly available?

Great idea, I would love to use that. If you need any help, I may use some spare time to participate. in addition to 5. voting: stats for BPs (e.g. how long have they have been active as BP, missed ...
tmm's user avatar
  • 2,114
2 votes

How to increase billable CPU time?

wait a few hours and send transaction again (it will work if you used CPU before in 24 hour window) stake more EOS for CPU and you can send again immediately. push to faster node where you transaction ...
Vasiliy Bondarenko's user avatar
2 votes

How should developers make money to cover cost of EOS CPU, bandwidth, and RAM?

Several things: You can setup your contract such that users pay for the RAM they use; You can require an on-chain fee in EOS from users or off-chain fees when people sign up to your service; You only ...
confused00's user avatar
  • 5,554
2 votes

How to stake EOS to increase the amount of CPU time from a separate account?

your cleos command looks absolutely right. if your transaction did not appear on the blockchain - may be it's because it was accepted by your node (the one that gave you transaction hash), but was ...
Vasiliy Bondarenko's user avatar
2 votes
Accepted

When someone sells his RAM to another account, how it would clear from previous contracts?

confused00 should have made this response as he/she is correct. RAM must be freed before you can sell it. For a dev this means you have to release your claim on the RAM to sell it For an end user ...
Nat's user avatar
  • 3,425
2 votes
Accepted

Ethereum event logs equivalent for EOS

If you want to log events on chain, you can use the demux-js library on the eosio repo to listen to chain events. From here, you can store that data as it updates in your database of choice.
Nat's user avatar
  • 3,425
2 votes
Accepted

Does print() cost CPU cycles?

print() appears to cost CPU cycles and expensiveFunction() is evaluated. I tried with the following. As there is no sleep I just looped (the expensive function takes about 50 ms > 30 ms allowed on the ...
colin's user avatar
  • 267
2 votes
Accepted

How much does it cost to add a new permission to an account?

Testing with v1.5.1, adding a new permission to an account (set account): Corresponding contract action: updateauth RAM: 32 bytes NET: 185 bytes CPU: 320 time for set action permission: ...
Başarcan Celebci's user avatar
2 votes
Accepted

How much does it cost to create a new account, which only needs to hold token balances?

For v1.5.1 an account that won't perform any action (including transfer) you don't need to delegate CPU/NET. Bare minimum amount for new account is 3 kbytes with the current reward for newaccount ...
Başarcan Celebci's user avatar
2 votes
Accepted

How to avoid cpu usage limits

Your idea is along the right lines. Either do batch updates, where you keep track using a seperate table to indicate current progress. Or right an action which takes the primary key as an argument, ...
Phillip Hamnett - EOS42's user avatar
2 votes

How to avoid cpu usage limits

I ran into this issue as well. The batch updating and is a good solution, but maybe slow if you only perform one batch per transaction. If your records are independent you can use a Flooding/Recursive ...
tmm's user avatar
  • 2,114
2 votes

Code examples for ONLY_BILL_FIRST_AUTHORIZER

The ONLYBILL1ST proposal has now been approved by 15 Block producers. I have tested and OnlyBillFirstAuthorizer is working now. I'm using eos-sharp. But it's very similar to eos-js. It's very simple. ...
Bjørn Omsland's user avatar
2 votes
Accepted

How do I send transactions from account, differing from actor account?

If the trx allows, you could sign the trx with B's key, thus B would be charged for something that benefits A. Alternatively you can stake to B from A the EOS in CPU/NET. More on staking here https://...
Nat's user avatar
  • 3,425
1 vote

Restricting runtime of a loop (Transaction took too long)

There is no way to calculate this from within the action. The available CPU time is too complicated and depends on too many external variables. The actions are suposed to be determinsitic and ...
Ami Heines's user avatar
  • 1,686
1 vote

Different of configuration on computer's BPs?

It is not the case. In EOS which has a DPoS consensus model, BPs work together to produce blocks and forks are not very often. The 21 active BPs will take turns to produce blocks one by one. As long ...
Tong Shen's user avatar
  • 475
1 vote
Accepted

Are table lookups, like get_table_rows, included in CPU/NET resource calculation?

You are not charged for any RPC getter API calls. If you're not forced to sign the transaction, then there's no way to know which account to charge. You're charged if you're changing state or ...
Nat's user avatar
  • 3,425
1 vote
Accepted

Performance: Would it be a problem to store 100,000 or 1,000,000 rows in a multi_index table?

Find by primary key is an efficient operation and will scale with your table size. Looping over every row is not something you want to do in the smart contract in a direct way. The risk is you will ...
Ami Heines's user avatar
  • 1,686
1 vote

How to buy more RAM without CPU?

I think it makes sense to have more than one EOS account, exactly to deal with this case. In your "emergency" account, you have EOS that you are to use only for staking as needed. Either you can stake ...
Phillip Hamnett - EOS42's user avatar
1 vote

resource consumption estimation of EOS transaction

You can now estimate your costs for a transaction by using EOS New York's EOS Charge. Methodology: We use a a MongoDB query that runs hourly and averages the CPU and NET resource costs ...
confused00's user avatar
  • 5,554
1 vote

resource consumption estimation of EOS transaction

There is no tool as such but you can estimate the cost by looking at how are you storing the data (this will tell the estimation about RAM) and how much time does your action take (this will give you ...
Rajat Chaudhary's user avatar
1 vote

Any methods for calculation and forecasting cpu usage for contract on some period

You can now estimate your costs for a transaction by using EOS New York's EOS Charge. Methodology: There is a MongoDB query that runs hourly. This query averages the CPU and NET resource costs ...
confused00's user avatar
  • 5,554
1 vote

Does Non fungible Tokens need more RAM?

In fungible tokens you track number of tokens per an account. In non-fungible tokens you track individual token per account. The latter is the only way to do non-fungible tokens - you need to track ...
Mikko Ohtamaa's user avatar
1 vote

Getting account CPU usage in smart contract

In order to access this information, you must create a struct as follows: struct [[eosio::table, eosio::contract("eosio.system")]] user_resources { name owner; asset ...
Phillip Hamnett - EOS42's user avatar
1 vote

What would happen when a transaction fails because "took too long"?

The failed transaction will not be attempted again automatically. If you're the dApp owner, you should increase the CPU resources or wait for them to replete and try again. Or better yet, redesign ...
Ami Heines's user avatar
  • 1,686

Only top scored, non community-wiki answers of a minimum length are eligible