Skip to content

Commit

Permalink
docs(cosmos/x/vstorage): Add README section for CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 authored and mhofman committed Aug 7, 2023
1 parent d0dcdf3 commit 5724b15
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions golang/cosmos/x/vstorage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ This is used by the SwingSet "bridge".
* method "size", args path (returns the count of children)
* StreamCell-oriented
* method "append", args [[path, value?], ...]

## CLI

A blockchain node may be interrogated by RPC using `agd [--node $url] query vstorage $command` via [client/cli](./client/cli/query.go).
* `children [--height $blockHeight] [-o {text,json}] [$path]`
* `data [--height $blockHeight] [-o {text,json}] $path`

Examples:
```sh
$ agd --node https://main.rpc.agoric.net:443/ query vstorage children published.reserve
children:
- governance
- metrics
pagination: null

$ agd --node https://main.rpc.agoric.net:443/ query vstorage children -o json published.reserve
{"children":["governance","metrics"],"pagination":null}

$ agd --node https://main.rpc.agoric.net:443/ query vstorage data published.reserve.metrics
value: '{"blockHeight":"11030240","values":["{\"body\":\"#{\\\"allocations\\\":{\\\"Fee\\\":{\\\"brand\\\":\\\"$0.Alleged:
IST brand\\\",\\\"value\\\":\\\"+20053582387\\\"}},\\\"shortfallBalance\\\":{\\\"brand\\\":\\\"$0\\\",\\\"value\\\":\\\"+0\\\"},\\\"totalFeeBurned\\\":{\\\"brand\\\":\\\"$0\\\",\\\"value\\\":\\\"+0\\\"},\\\"totalFeeMinted\\\":{\\\"brand\\\":\\\"$0\\\",\\\"value\\\":\\\"+0\\\"}}\",\"slots\":[\"board0257\"]}"]}'
```

## External protobuf interface

Expand Down

0 comments on commit 5724b15

Please sign in to comment.