-
Notifications
You must be signed in to change notification settings - Fork 12
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
How to invoke a specific function within a deployed Phat Contract? #29
Comments
Perhaps another way to think about this would also be as follows:
As an example, let's assume we'd like like to call the |
@FaisalAl-Tameemi's answer is correct. If you want to trigger the Phat Contract from the anchor side (pallet or smart contract), you will need to push a message. Once the message is pushed, it stays in the anchor storage. The next time when the offchain rollup Phat Contract reads the storage, it will notice it, and you can get it by accessing the request queue from your PC like mentioned in the readme file (assume you have initialized a rollup client):
This is called Req-Resp model. You add requests on chain, and the Phat Contract answer it later on. The request will be removed once the blockchain receives the response. The request and the response are bytes arrays. So you can pass arbitrary message back and forth. |
@h4x3rotab out of curiously, is it correct that XCM could also be used to invoke an ink! message in the phat contract? |
Theoretically you can send a Transact message to Phala to call |
but not recommended vs. RPC? |
I want to invoke a specific function within a deployed Phat Contract from Anchor by calling
anchor::push_message
. I know this should be encoded as thedata
field, but would like further clarification on how to do it.I've been able to receive responses from this Phat Contract into my Anchor pallet via the
OnResponse
trait, but not yet to send to it.The text was updated successfully, but these errors were encountered: