I'm building a Solana SDK and I have a few integration tests that need SPL Programs that are running against live clusters (mainnet or devnet). However, I'd like to use a local testnet using testcontainers which works fine so far, as I'm running the container passing a few --clone
which copy the data I need.
The problem is that one of the tests requires sending a transaction to create a DAO, using the governance program, which doesn't seem to come out of the box in the test validator. As a result, the test fails saying that it attempted to load a program that doesn't exist (this actually means it's not found by bpf loader). A possible fix to this is to checkout the program code (in my specific case I need the tag tags/governance-v2.2.6
), run cargo build-bpf
and pass the option --bpf-program GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw ./spl_governance.so
when I run the test validator. I tried this and it works.
However, I'd like to avoid my workaround and download the .so
into a file programatically, and instantiate the solana-test-validator
pointing to that file. I know it's possible to download some executable data (from here if you navigate to it's executable data account) in a bin format. I don't know how to proceed from here, is it possible to get .so
code from a bin executable? Should I just copy the bin
file into my test ledger folder?
Hope the context and problem are clear. Any guidance will be helpful. Thank you!