When I create a smart contract, e.g: game. what does the ledger store? (EOS tokens, or heathy points, level of user). If the ledger stores heathy points, level, so how I can push it into block (Please kindly give me some code reference).
1 Answer
The data is stored in tables which resides in ram so it can be there in ram only.Due to the architecture of eosio you can not push the state data to block. It only stored in ram.To create a table and store data into that table refer this https://developers.eos.io/eosio-cpp/docs/using-multi-index-tables
-
Thank you, but I means the transaction, which can store in block, right?– user2644Commented Dec 12, 2018 at 6:20
-
All Transactions are stored in blocks.So, you want code to do transaction ?– Mr.YCommented Dec 12, 2018 at 6:24
-
No, I want to know the flow of code. I want to select feature on contract to store in block.– user2644Commented Dec 12, 2018 at 6:26
-
Contract cannot store block.Because it's stored only in chain.– Mr.YCommented Dec 12, 2018 at 6:28
-
Yep, I know. I means in a contract, I have a struct of data. So I want to chose some field in this and push to block.– user2644Commented Dec 12, 2018 at 6:30