How to save the different version for same ObjectId #98
Replies: 3 comments
-
By scanning the meta chain, you can get every version of every object stored in the chain. This is because in the block, the tx is stored, which is every operation done on the chain. Although only the latest version of the object is stored in the state database of the chain, through the scanning mechanism of spv, I can store every version of the object in spv and provide the corresponding query interface |
Beta Was this translation helpful? Give feedback.
-
Therefore, I am going to store each version of the object in the SPV NODE and provide the following interface. GET /objects/:objectid?body=&begin=&end= Returns. |
Beta Was this translation helpful? Give feedback.
-
I implement |
Beta Was this translation helpful? Give feedback.
-
Group is a variable object, and its status at any time is based on the current configuration of the Group. Therefore, a mechanism is needed to save multiple different versions of the Group and provide the query function by version;
This is a general requirement: an object with body needs to store multiple historical versions and can provide queries
According to the existing mechanism
All objects with body are based on the latest version on the chain
Different versions have been stored in the meta chain (in principle, only one object of the same object_id will be stored in a block? Is there any special case that there are multiple versions, which also depends on the storage method of objects in each block)
Only one version of the local noc can exist. According to the product requirements, you need to request different versions to be used or saved from metamain
You need to use the body version mechanism (hash and prev_version) to save and query the target version of the object body based on the chain
Therefore, Metamain needs to add the following query support (it can be implemented on the spv node)
get_object_with_body_version(object_id, object_body_version)
The body version-based index needs to be added to the meta chain service to query
get_object_with_range(args list, block_height_range : [start_height, end_height])
In addition, can we consider adding a core object of BLOB type? Developers can encode and decode their objects of different versions into BLOB and cache objects of different versions in NOC, so that developers can save objects of different versions without relying on the meta chain.
@lurenpluto @waterflier
Beta Was this translation helpful? Give feedback.
All reactions