I am following this example eth_price Just wondering how to get the program addresses (Pyth Network) in general for an offchain application ? It seems the PDA is dervied from the feed id and shard id. I can get the feed id, but don’t know if i can get the shard id. Is there a way where i can achieve this ?
Either getting shard id some how so i can derive the program address from shard id + feed id
Or directly the program address on pythnet via some API
Any direction would really be helpful ! Thank you !
Thank you for the reply. The idea was to use existing Rust SDK available.
The Rust SDK Repo says, “utilities for reading price feeds from the pyth.network oracle in on- and off-chain applications.” . The off chain approach, consists of reading the program address and hence the question.
However, if hermes is the desired approach, I don’t see any other option, but to write my own Hermes Client in Rust.
Thanks this helps. Just out of curiosity ! Is it the case that one should be using Hermes Server only for accessing data off-chain . Can’t i connect to Pyth Network RPC (one that is spunned along with publisher’s Pyth validator).
I understand that if i connect to the Pyth Network RPC, i would have to go through product account structure and can then fetch the price feed program address.