Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JSON-RPC] Generate openrpc.json spec and rpc.discover endpoint #1588

Merged
merged 9 commits into from
Apr 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
address comments in doc
  • Loading branch information
patrickkuo committed Apr 28, 2022
commit a96cc1aeb994642880b3ad00d260b26de89406ed
10 changes: 4 additions & 6 deletions doc/src/build/json-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,28 @@ the `curl` command.

### rpc.discover

Retrieve OpenRPC documentation:
Sui RPC server supports OpenRPC’s [service discovery method](https://spec.open-rpc.org/#service-discovery-method).
A `rpc.discover` method is added to provide documentation describing our JSON-RPC APIs service.

```shell
curl --location --request POST $SUI_RPC_HOST \
--header 'Content-Type: application/json' \
--data-raw '{ "jsonrpc":"2.0", "method":"rpc.discover","id":1}'
```

TODO: Explain what they should see or show the output.
You can see an example of the discovery service in the [OpenRPC Playground](https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/MystenLabs/sui/189d61df846f7c3676c1215cc41fb970ee9e22b5/sui/open_rpc/spec/openrpc.json).

### sui_syncAccountState

Synchronize client state with validators with the following command,
replacing `{{address}}` with an actual address value, for example one obtained from `wallet.conf` (without quotes):
replacing `{{address}}` with an actual address value, for example one obtained from `wallet.conf`:

```shell
curl --location --request POST $SUI_RPC_HOST \
--header 'Content-Type: application/json' \
--data-raw '{ "jsonrpc":"2.0", "method":"sui_syncAccountState", "params":["{{address}}"], "id":1}'
```

TODO: Clarify what we mean by "without quotes" above. Do you mean when copying the address from `wallet.conf` or including in the command?
Why does the command include quotes then ("{{address}}")? Should we instead say, replace "{{address}}" then?

This will fetch the latest information on all objects owned by each
address that is managed by this server. This command has no output.

Expand Down