0 votes
1 view
in Blockchain by (7k points)

I am doing multiple transactions like location update for an asset, and couldn't find any way to query the transactions based on that resource:

For example If I create an asset fish1, and then make transactions to update the location of the fish, now I want to fetch the transactions for the fish1 so I can get a list of geo-points and plot them on the map.

If anyone has done something like this, please help. Thanks! 

1 Answer

0 votes
by (14.5k points)

For On-Chain solutions, there are two approaches depending on the way users 'update' their location.

  1. If information is updated at the same address, users must take precautions to capture all the updates. This assumes that the accountable asset has a collection which it can add to at transaction time. 
  2. If each update results in a new piece of data being added to the blockchain, users would be using some addressing scheme which will use a prefix to '/state?address=xxx` for calling to collect all asset updates. Also, fetch the block to determine the order unless the data at each address catch some time information.

For off-chain solutions,

Hyperledger Sawtooth puts forth an Event registry where clients can register event listeners for storing data off-chain. This is suggested for solutions that have a broad querying need.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...