-
Notifications
You must be signed in to change notification settings - Fork 39
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
Adding a Box Describing VStorage as readonly Contract State Query #1256
Conversation
Deploying documentation with Cloudflare Pages
|
Cloudflare deployment logs are available here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"economical" is good, but again, "cost-free" is too far.
and I think a link is incomplete
the Agoric chain does not offer such direct readonly APIs for querying contract state. Instead, the Agoric | ||
platform achieves this functionality through a powerful feature called VStorage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
editorial: starting with "Agoric does not offer X" feels weird.
and "a powerful feature" seems like bravado that I wouldn't expect in docs.
Maybe move the ethereum stuff to the end of this box? "This contract state query mechanism provides much of the funcionality of ethereum readonly or view query APIs." I dunno.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dckc I agree but I am a bit at loss regarding how to start this box - would appreciate any idea s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe:
To expose contract state for query, where smart contracts on Ethereum and other chains use readonly or view query methods, Agoric smart contracts write to storage nodes so that clients can query them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, updated!
API on other blockchains. It is completely cost-free, meaning developers and users can fetch data | ||
from VStorage without incurring any fees. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we don't have a vstorage-specific cost-recovery mechanism in place, there is a cost to the validators and such to store the data. For mainnet 2, we manually verify that the cost of storage used by contracts is paid for somehow. For example, in Inter Protocol, there's a charge to open a vault and to keep it open.
As to fetching the data, operating an RPC server also has a cost. It's typically not born directly by developers or users, but there's no particular guarantee of availability. Rate limiting is typically used to keep the cost manageable, for example.
It's worth saying that fetching data does not incur the cost of a blockchain transaction. But "completely cost-free" over-states the case.
|
||
For instace, if a smart contract manages educational records, it can publish any relevant information | ||
to VStorage through a `chainStorage` API, and anyone can query this data to verify the authenticity of | ||
the records. This approach is illustrated in the [dapp-ed-cert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dapp-ed-cert link seems incomplete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have a small snippet of code inline here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the snippet, I am not sure at this point. ATM dapp-ed-cert
using E()
, as in:
const edCertNode = E(certificateDataRoot).makeChildNode(edCert.certificateId);
await E(edCertNode).setValue(JSON.stringify(edCert));
I would rather add the snippet later after I have fixed it.
Agoric’s approach replaces direct readonly APIs with a public and cost-free vstorage mechanism, | ||
enabling developers to create dynamic and responsive dApps while keeping the blockchain interactions | ||
efficient and economical. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"economical" is good, but again, "cost-free" is too far.
44d68ae
to
1479a31
Compare
1479a31
to
7f50eb6
Compare
Building Client Dapps page is updated to contain a box with a summary of the discussion related to public readonly contract state query.