Rise In Logo

Build on Agoric

User Interface

User Interface

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)

  • Can write data to storage nodes
  • Cannot read their own writes
  • Used for publishing updates

Clients/UI (Read-Only)

  • Can read data through queries
  • Cannot modify stored data
  • Receives automatic updates

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:

  • Brand
  • Installation
  • Instance

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

  • VStorage integration
  • Real-time data updates
  • Blockchain state monitoring

2. Wallet Integration

  • Compatible wallet connection
  • Custom signer support
  • Transaction management

3. React Components

4. Transaction Handling

  • Offer creation
  • Status tracking
  • Response management

Visit the repository to check the code examples out: https://github.com/Agoric/ui-kit

Comments

You need to enroll in the course to be able to comment!

Stay in the know

Never miss updates on new programs and opportunities.

Rise In Logo

Rise together in web3!

Disclaimer: The information /programs / events provided on https://patika.dev and https://risein.com are strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice and do not make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://patika.dev and https://risein.com disclaim any responsibility for financial decisions made by users based on information provided here.