Understanding VStorage in Agoric
What is VStorage?
VStorage (Virtual Storage) is a specialized key-value store that enables communication between smart contracts and user interfaces in Agoric.
Key Characteristics
Contracts (Write-Only)
Clients/UI (Read-Only)
Usage Example
Writing Data
Reading Data
1. Using CLI command agd query to get the data at the storage path
agd query vstorage data 'published.agoricNames'
2. Querying for children of the node at that path
agd query vstorage children 'published.agoricNames'
children:
3. Can also be read via RPC with curl or a javascript fetch(...)
Agoric UI Kit
Agoric UI Kit provides components and tools for building graphical user interfaces for Agoric dApps. It simplifies the process of creating React-based applications that interact with Agoric smart contracts.
Key Components Include:
1. Contract Data Reading
2. Wallet Integration
3. React Components
4. Transaction Handling
Visit the repository to check the code examples out: https://github.com/Agoric/ui-kit
Swap insights and ask questions about “Build on Agoric”.
Ask a question or share your thoughts about this lesson.