How transactions for assets are linked across blocks
Hello Folks,As per my understanding in Hyperledger fabric the blocks are created based on criteria's like time/ number of blocks n etc.My questions here is since we store asset by key value and transaction happen over assets.For any particular asset the transactions related to it may be distributed/enclosed in various blocks in a unconsecutive manner.How does Hyperledger fabric maintains/retrieves the History of transaction of an asset for which the transactions are disbursed across multiple blocks? do we maintain any index for Key & its relevant blocks? or we check each block over a chain.? to trace an assetRegards,Sunil Suseelan
There is a chaincode API GetHistoryForKey() that returns the history of changes to an asset key.
This API uses a LevelDB database under the covers that tracks the block and transaction number where each asset key was updated. You can think of it as an index mapping asset keys to block transactions.
Dave Enyeart"Suhan Sumeet" ---05/09/2019 06:25:21 AM---Can anyone please share some guidance on this query. Thanks in advance :) On Wed, May 8, 2019 at 4:0
From: "Suhan Sumeet" <suhan.premilu@...>
To: hyperledger-fabric@...
Date: 05/09/2019 06:25 AM
Subject: Re: [Hyperledger Fabric] How transactions for assets are linked across blocks
Sent by: fabric@...
Can anyone please share some guidance on this query. Thanks in advance :)
On Wed, May 8, 2019 at 4:09 PM Suhan Sumeet via Lists.Hyperledger.Org <suhan.premilu=gmail.com@...> wrote:
- Hello Folks,
As per my understanding in Hyperledger fabric the blocks are created based on criteria's like time/ number of blocks n etc.
My questions here is since we store asset by key value and transaction happen over assets.
For any particular asset the transactions related to it may be distributed/enclosed in various blocks in a unconsecutive manner.
How does Hyperledger fabric maintains/retrieves the History of transaction of an asset for which the transactions are disbursed across multiple blocks? do we maintain any index for Key & its relevant blocks? or we check each block over a chain.? to trace an asset
Regards,
Sunil Suseelan
There is a chaincode API GetHistoryForKey() that returns the history of changes to an asset key.
This API uses a LevelDB database under the covers that tracks the block and transaction number where each asset key was updated. You can think of it as an index mapping asset keys to block transactions.
Dave Enyeart"Suhan Sumeet" ---05/09/2019 06:25:21 AM---Can anyone please share some guidance on this query. Thanks in advance :) On Wed, May 8, 2019 at 4:0
From: "Suhan Sumeet" <suhan.premilu@...>
To: hyperledger-fabric@...
Date: 05/09/2019 06:25 AM
Subject: Re: [Hyperledger Fabric] How transactions for assets are linked across blocks
Sent by: fabric@...
Can anyone please share some guidance on this query. Thanks in advance :)
On Wed, May 8, 2019 at 4:09 PM Suhan Sumeet via Lists.Hyperledger.Org <suhan.premilu=gmail.com@...> wrote:Hello Folks,
As per my understanding in Hyperledger fabric the blocks are created based on criteria's like time/ number of blocks n etc.
My questions here is since we store asset by key value and transaction happen over assets.
For any particular asset the transactions related to it may be distributed/enclosed in various blocks in a unconsecutive manner.
How does Hyperledger fabric maintains/retrieves the History of transaction of an asset for which the transactions are disbursed across multiple blocks? do we maintain any index for Key & its relevant blocks? or we check each block over a chain.? to trace an asset
Regards,
Sunil Suseelan
Internal implementation details are not documented, but you can follow the code that writes to the history index here:
https://github.com/hyperledger/fabric/blob/release-1.4/core/ledger/kvledger/history/historydb/historyleveldb/historyleveldb.go#L74
Dave Enyeart"Suhan Sumeet" ---05/13/2019 05:49:59 AM---Hello David, Thanks for the response,Is there any document or material that talks about
From: "Suhan Sumeet" <suhan.premilu@...>
To: David Enyeart <enyeart@...>
Cc: hyperledger-fabric@...
Date: 05/13/2019 05:49 AM
Subject: Re: [Hyperledger Fabric] How transactions for assets are linked across blocks
Sent by: fabric@...
Hello David,
Thanks for the response,Is there any document or material that talks about this level db storage that maintains index for key along the the Blocks & transaction associated to it.
Regards,
Sunil Suseelan
On Thu, May 9, 2019 at 9:36 PM David Enyeart <enyeart@...> wrote:
- There is a chaincode API GetHistoryForKey() that returns the history of changes to an asset key.
This API uses a LevelDB database under the covers that tracks the block and transaction number where each asset key was updated. You can think of it as an index mapping asset keys to block transactions.
Dave Enyeart
From: "Suhan Sumeet" <suhan.premilu@...>
To: hyperledger-fabric@...
Date: 05/09/2019 06:25 AM
Subject: Re: [Hyperledger Fabric] How transactions for assets are linked across blocks
Sent by: fabric@...
Can anyone please share some guidance on this query. Thanks in advance :)
On Wed, May 8, 2019 at 4:09 PM Suhan Sumeet via Lists.Hyperledger.Org <suhan.premilu=gmail.com@...> wrote:
- Hello Folks,
As per my understanding in Hyperledger fabric the blocks are created based on criteria's like time/ number of blocks n etc.
My questions here is since we store asset by key value and transaction happen over assets.
For any particular asset the transactions related to it may be distributed/enclosed in various blocks in a unconsecutive manner.
How does Hyperledger fabric maintains/retrieves the History of transaction of an asset for which the transactions are disbursed across multiple blocks? do we maintain any index for Key & its relevant blocks? or we check each block over a chain.? to trace an asset
Regards,
Sunil Suseelan