Skip to content

Index channels and their escrow account addresses #3

@toliaqat

Description

@toliaqat

Update 04/30: We have decided to index balances of all accounts instead of calling RPC endpoint for the data during our indexing. This is for performance reasons because calling RPC endpoint inside each handler call could significantly reduce indexing speed reducing our ability to launch new indexing features. By indexing all the account balances, we can get the same data as mentioned bellow, if we also index channels and their addresses.

Total Interchain IST needs to be fetched with custom RPC calls that are equal to the following commands. Subquery does not provide events that can be used for quickly getting this data. The custom RPC. calls needs to be added in the indexer code such that it runs with appropriate interval without causing indexing degradation due to these custom calls.

agd q --node=https://main.rpc.agoric.net:443 ibc channel  channels -ojson \|
jq -r '.channels[] \| select(.port_id == "transfer") \| .channel_id' \|
while read channel; do
addr=$(agd q ibc-transfer escrow-address transfer $channel)
agd q --node=https://main.rpc.agoric.net:443 bank balances --denom=uist -ojson $addr \|
jq -r '"\(.amount)\(.denom)"'
done

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions