2

From my understanding ram is like drive space in eos. And I'm assuming when we make transactions, that ledger data is stored in ram?

Is there a way to delete what we used in ram to empty it out so we can store other things like other text data?

Or am I not understanding ram properly?

1 Answer 1

1

How does one see how much ram I have used?

$ cleos get account <account_name>

And how can I recover the used ram?

Either the entry in the table should be deleted or the payer for the entry should be changed.

If, for instance, a smart contract with which you interacted made a RAM entry for you during your action, you'd need to see if they allow for your entry to be deleted by calling an action to the contract. If they do, you recover your RAM once they delete your entry. If they don't, you can't recover your RAM until they add functionality for you to do so or if they change the owner of the RAM entry.

And I'm assuming when we make transactions, that ledger data is stored in ram?

No, transactions are stored in the ledger itself. For this type of storage you only need to have staked NET. Data that is stored in RAM is data that can be retrieved from smart contracts and persists even if the ledger is pruned.

You can make as many transactions as you want without consuming any RAM as long as your transactions are not trying to trigger a RAM entry for persistent access from applications.

Is there a way to delete what we used in ram to empty it out so we can store other things like other text data?

Yes, the Multi-Index API provides erase and modify to delete the data or modify the data, respectively.

2
  • So lets say I have ram of 10KB, I can store up to 10,000 characters of an essay I wrote into my ram storage? How would I do that if I wanted to. Commented Oct 16, 2018 at 14:26
  • almost 10,000 characters. each multi_index record has other data as well (e.g. the table key) which takes up some space as well. you'd need to communicate the data to a smart contract that uses the multi-index api to store the data
    – confused00
    Commented Oct 16, 2018 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.