I am developing a Solana smart contract and am currently using the Solana Playground environment for testing and development. However, I am encountering an issue where I am unable to use the crate orao_solana_vrf
in the Playground environment. The error message I am seeing is:
error[E0433]: failed to resolve: use of undeclared crate or module `orao_solana_vrf` --> src/misc.rs:5:5 |5 | use orao_solana_vrf::state::RandomnessAccountData; | ^^^^^^^^^^^^^^^ use of undeclared crate or module `orao_solana_vrf`
When trying to import the crate, the Playground fails to resolve it. As the Playground doesn’t seem to support running cargo
commands or managing external dependencies like a local setup, I'm unsure how to proceed.
What I've tried:
- I tried modifying the
Cargo.toml
locally, but I cannot runcargo
commands in the Playground.
Questions:
- Is there any way to use external crates like
orao_solana_vrf
in Solana Playground, or is this environment limited to only the built-in libraries? - If not, what is the best approach to develop and test Solana smart contracts that depend on external crates like
orao_solana_vrf
?