File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
main/guides/getting-started Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,24 @@ message MsgWalletSpendAction {
4747
4848## Querying VStorage
4949
50+ ::: tip VStorage as Contract State Query Mechanism
51+ To expose contract state for query, where smart contracts on Ethereum and other chains use readonly
52+ or [ view query methods] ( https://docs.soliditylang.org/en/latest/contracts.html#view-functions ) , Agoric smart contracts write to storage nodes so that
53+ clients can query them.
54+
55+ Smart contracts on the Agoric chain can write data to VStorage, which acts as a publicly accessible
56+ storage layer. This data is available for anyone to query, similar to the functionality of a getter
57+ API on other blockchains. It is cost-effective, meaning developers and users can fetch data
58+ from VStorage without incurring any extravagant fees.
59+
60+ For instace, if a smart contract manages educational records, it can publish any relevant information
61+ to VStorage through a ` chainStorage ` API, and anyone can query this data to verify the authenticity of
62+ the records. This approach is illustrated in the [ dapp-ed-cert] ( https://github.com/agoric-labs/dapp-ed-cert ) .
63+ Agoric’s approach replaces direct readonly APIs with a public and cost-effective VStorage mechanism,
64+ enabling developers to create dynamic and responsive dApps while keeping the blockchain interactions
65+ efficient and economical.
66+ :::
67+
5068[ VStorage] ( https://github.com/Agoric/agoric-sdk/tree/master/golang/cosmos/x/vstorage#readme ) (for "Virtual Storage") is a key-value store that is
5169read-only for clients of the consensus layer.
5270From within the JavaScript VM, it is accessed via a ` chainStorage ` API with a node at each
You can’t perform that action at this time.
0 commit comments