From 3f7f19ee1955c86c438a29d492074c748b583073 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 2 Aug 2023 10:52:34 -0400 Subject: [PATCH 1/2] docs(cosmos/x/vstorage): Add README section for "REST" API interface --- golang/cosmos/x/vstorage/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/golang/cosmos/x/vstorage/README.md b/golang/cosmos/x/vstorage/README.md index af6dfc6079a..cea572ba878 100644 --- a/golang/cosmos/x/vstorage/README.md +++ b/golang/cosmos/x/vstorage/README.md @@ -46,6 +46,24 @@ and `data` \ Date: Wed, 2 Aug 2023 11:29:21 -0400 Subject: [PATCH 2/2] docs(cosmos/x/vstorage): Add README section for CLI --- golang/cosmos/x/vstorage/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/golang/cosmos/x/vstorage/README.md b/golang/cosmos/x/vstorage/README.md index cea572ba878..32dfefc7eb7 100644 --- a/golang/cosmos/x/vstorage/README.md +++ b/golang/cosmos/x/vstorage/README.md @@ -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