@hedayat not really, it’s up to the application to control in whatever granularity they want.
@ldwm so, here is how the process goes: when you do
hdk::commit_entry, that creates the entry, hashes it and creates a header besides it. That header is chained to your other headers, which is the “chain” part of holochain. But, everything that is content addressable is deduplicated in a holochain node. So, if you create a new entry that already existed in the node, it will calculate the hash, look at the CAS (Content Addressable Store), see that’s already there and not store it. It will create a new header, with the hash of the entry, and then append that to your source chain. When querying all the entries of your source chain, it appears as “duplicate” but that’s merely a matter of doing twice the “query_entry” for the same hash in the same store, the entry is not actually duplicated.
It should be fairly easy to write a function (I think you already did) and publish it as a library for everyone to reuse, for example in this one: https://github.com/holochain-open-dev/holochain_entry_utils.