1

Hello I am trying desperately to use solana-sdk and solana-client but when I do cargo build-bpf it doesn't work. Can someone help me please?

enter image description here

If I specify only solana-client and solana-sdk, I get this error:

enter image description here

Here is a capture that shows the versions I have of solana, cargo , rustup, rustc

enter image description here

3
  • hey can u specify why do u want to use RpcClient inside your on-chain programs Commented Dec 1, 2022 at 15:37
  • Hello, i need to use this, for make somme verification, for example, when a user create a pseudo, else , he have only this pseudo and not othersusers. For implement this off chain it's easy but on chain it difficult when solana-sdk doesn't work
    – RevOneX9
    Commented Dec 3, 2022 at 12:35
  • I don't understand this , can u put it in a proper context with an example Commented Dec 4, 2022 at 14:59

1 Answer 1

1

Please upgrade your solana cli to stable 1.13.4 And also in your smart contract (on chain) programs you are suppose to use solana-program library. solana-sdk and solana-client are for client side libraries

4
  • Hello, i tried with 1.13.4 it doesn't work, i tried now with 1.14.9, i get this errors
    – RevOneX9
    Commented Nov 29, 2022 at 19:59
  • ^^^^^^^^^^ not found in sys when i compile
    – RevOneX9
    Commented Nov 29, 2022 at 20:00
  • 1
    The answer says to not use solana-client and solana-sdk in your on-chain program, and to use solana-program instead. You need to delete the other dependencies and use solana-program instead.
    – Jon C
    Commented Nov 30, 2022 at 13:42
  • Thanks, but i need to use use " solana_client::rpc_client::RpcClient " , its possible only with solana_client. How i can do ?
    – RevOneX9
    Commented Nov 30, 2022 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.