I have a Solana smart contract (written with Anchor) that interacts with Pyth and Chainlink Solana oracles. In EVM world, we would either redeploy the necessary contracts locally in the test start-up and configure them ourselves or perform fork-testing (forking the state of the mainnet and running tests independently locally).
Problems with forking:
- I've found this answer on how to "fork" Solana programs and accounts, but I am not sure if I can configure it so the anchor test runner starts up and loads the accounts for me.
- I am not sure how to interact with the program from JS after it's in my local network. I don't have the IDL available.
Problems with setting things up manually:
- I've found this answer on how to retrieve the on-chain programs and insert them inside the anchor test runner, but I am not sure how to interact with the program from JS after it's in my local network. I don't have the IDL available.
If anyone has had the experience of writing localnet tests for either of these oracles or any other external program, please share your experience.