-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instructions from a Rust client #883
Comments
Have you found a solution? I'm looking for the equivalent of the following JS code in Rust. const program = new Program(
idl as Idl,
id,
new Provider(bn.conn, null, {
preflightCommitment: 'recent',
commitment: 'recent',
}),
); |
Example rust client with anchor programs here /~https://github.com/project-serum/anchor/blob/master/client/example/src/main.rs |
Closing as I dont see anything actionable here.Closing as there doesn't |
@gitmalong I was hired to write a tool to generate nice APIs for sending Anchor instructions (https://ackeeblockchain.com/blog/announcing-trdelnik-rust-testing-client-for-anchor/). Currently, it uses Rust compiler to expand Anchor program macros, then it parses the code with |
Having the same issue as I need Rust to interact with an Anchor Program I don't have sources of. Are there any ways of interacting with them only having IDL and public key? |
Hi,
Context
I've written the Rust-only example with Solana and MoonZoon (MartinKavik/voting-solana-moonzoon). And I'm just rewriting it to Anchor (MartinKavik/voting-anchor-moonzoon).
The problem
I don't use Javascript so I can't use a generated client from IDL - I create transactions and instructions in Rust code.
I was able to create "native" Solana instructions this way:
but I don't know how to rewrite the code to make it compatible with Anchor instructions.
Anchor instructions and accounts and errors are defined in /~https://github.com/MartinKavik/voting-anchor-moonzoon/blob/master/program/programs/voting_program/src/lib.rs
Thank you!
Other problems (probably suitable for new issues):
system_instruction::create_account_with_seed
to make the account compatible with Anchor?anchor deploy
- an alternative to:The text was updated successfully, but these errors were encountered: