Hi new to Sui can anyone please help me with a golang doubt.
I want to do a read call on my deployed contract to get response. I tried using SuiCall but shows method not found
In Sui there is no “read” call. All the information you may want to read exist on the fullnodes. Usually, after setting up your fullnode client, you do something like getObject
or getOwnedObjects
or something similar.
Oh okay so let’s say if I have a function in my move contract which returns me status of execution of id after providing it with the id.
So how do we read that through golang…
I tried getObject but that function returns size
So as all information is available for read from the fullnode, there is no reason to have a result which is for the client to use. The results from Move functions are only usable by other Move functions.
For example if I want to check the id of a new object created in a move-call I would execute the transaction and request the object-changes from the transaction. This would include all the newly created objects on chain.
If the transaction is callable by anyone and I want to track the objects created, I may emit an event with the object id created and use queryEvents
.