solana-go-sdk icon indicating copy to clipboard operation
solana-go-sdk copied to clipboard

Can I call the smart contract directly? How should I call it

Open E0001 opened this issue 3 years ago • 5 comments

Can I call the smart contract directly? How should I call it

E0001 avatar Dec 01 '21 08:12 E0001

sure. It depends which program you are interacting with. The main idea is to compose transaction if you want to call smart contract (in solana we called it program). FYI

A transaction = many signatures + a message
A message = many instructions + recent blockhash

you can treat every instruction equals a function in the program.

you can take a look at

https://github.com/solana-labs/example-helloworld https://dev.to/cogoo/solana-how-to-send-custom-instructions-via-instruction-data-4g9g

to learn how to compose your own instruciton.

yihau avatar Dec 01 '21 09:12 yihau

How do I call the Hello World function in rust from go-client? https://github.com/solana-labs/example-helloworld

panchuprodhan avatar Jan 27 '22 10:01 panchuprodhan

Oh. I think I should add some examples for interacting with custom program!

yihau avatar Jan 28 '22 03:01 yihau

Yes, that should be helpful!

panchuprodhan avatar Jan 28 '22 08:01 panchuprodhan

Oh. I think I should add some examples for interacting with custom program!

That would be amazing thanks.

leecarney avatar Feb 23 '22 21:02 leecarney