Timeline for Is it possible to invoke a program using solana cli?
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 10 at 16:12 | comment | added | Jonas H. |
Then all you need is probably this part if you only have a hello world: txHash = await program.methods .helloWorld() .signers([keyPair]) .rpc(); console.log(Use 'solana confirm -v ${txHash}' to see the logs ); await connection.confirmTransaction(txHash);
|
|
Jan 10 at 15:30 | history | edited | Jonas H. | CC BY-SA 4.0 |
deleted 137 characters in body
|
Jan 10 at 15:29 | comment | added | Jonas H. | When you build your anchor program it will generate your types in the target folder. So you can just replace them to yours in the ts file and interact with your program. | |
Jan 10 at 15:18 | comment | added | Amir reza Riahi | Thanks you, can I use the typescript code generated by the anchor to invoke my program instructions? In fact I just want the easiest way as possible to call my to invoke my program I've written using anchor, does using that tests code make it easier to invoke my program? | |
Jan 10 at 15:07 | vote | accept | Amir reza Riahi | ||
Jan 10 at 14:35 | comment | added | Jonas H. | Got you, makes sense playground can be confusing. I updated the answer and wrote you a little example for local ts file. Hope that helps | |
Jan 10 at 14:34 | history | edited | Jonas H. | CC BY-SA 4.0 |
added 6783 characters in body
|
Jan 10 at 13:22 | comment | added | Amir reza Riahi | Thanks for your answer! Can you show me a self-contained javascript code that can perform this operation? The example you provided and example in the solpg.io are both depended on other stuff (importing some modules, creating connection to cluster, etc) which I'm not aware of. I want to see a complete example. | |
Jan 9 at 16:41 | history | edited | Jonas H. | CC BY-SA 4.0 |
edited body
|
Jan 9 at 16:34 | history | answered | Jonas H. | CC BY-SA 4.0 |