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

Local Rest Server & API Instructions #881

Merged
merged 6 commits into from
Mar 21, 2022
Merged

Local Rest Server & API Instructions #881

merged 6 commits into from
Mar 21, 2022

Conversation

arun-koshy
Copy link
Contributor

Added documentation to get anyone started with using the rest apis against a local rest server & local sui network.

doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
@arun-koshy
Copy link
Contributor Author

There was an issue with the /sui/stop endpoint and I made an update to the /objects endpoint which is required for the version of the Postman runbook I linked in this doc. Will land PR#892 before this one.

@arun-koshy arun-koshy requested a review from awelc March 17, 2022 17:45
Copy link
Contributor

@awelc awelc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a newbie with very little familiarity (but some) with REST, I don't feel like I have enough info to follow this document and get stuff to work... It's cool if we are targeting this at folks with a larger familiarity level, but then we should be more specific what kind of background info we require for people to be able to follow.

doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
doc/src/build/rest-api.md Outdated Show resolved Hide resolved
@arun-koshy
Copy link
Contributor Author

As a newbie with very little familiarity (but some) with REST, I don't feel like I have enough info to follow this document and get stuff to work... It's cool if we are targeting this at folks with a larger familiarity level, but then we should be more specific what kind of background info we require for people to be able to follow.

I think we should make it as accessible as possible, please continue to ask questions & leave feedback about things that don't make sense. Thanks!

@awelc
Copy link
Contributor

awelc commented Mar 17, 2022

I think we should make it as accessible as possible, please continue to ask questions & leave feedback about things that don't make sense. Thanks!

Thanks. I did not want to come out as TOO annoying :-)

Made medium edits throughout the doc's text
Copy link
Contributor

@Clay-Mysten Clay-Mysten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Arun. I made my changes in a distinct commit. Otherwise, LGTM!

@Clay-Mysten
Copy link
Contributor

P.S. Please peer test all commands here and in all docs.

@arun-koshy
Copy link
Contributor Author

Great work, Arun. I made my changes in a distinct commit. Otherwise, LGTM!

Awesome! Thanks Clay, can I close this PR and let you submit the commit with your changes?

@arun-koshy
Copy link
Contributor Author

Great work, Arun. I made my changes in a distinct commit. Otherwise, LGTM!

Awesome! Thanks Clay, can I close this PR and let you submit the commit with your changes?

Ignore that I will submit this and let you submit the changes on top of it. Think @awelc will also be adding more to this as well. Thanks everyone :)

@awelc
Copy link
Contributor

awelc commented Mar 18, 2022

Think @awelc will also be adding more to this as well. Thanks everyone :)

I don't think I will have time to work on this before Monday, particularly that neither this PR nor the following one by @Clay-Mysten are in yet... FYI, the plan was to expand examples a bit so that it's clear what should go into the likes of {{address}}.

@Clay-Mysten
Copy link
Contributor

Think @awelc will also be adding more to this as well. Thanks everyone :)

I don't think I will have time to work on this before Monday, particularly that neither this PR nor the following one by @Clay-Mysten are in yet... FYI, the plan was to expand examples a bit so that it's clear what should go into the likes of {{address}}.

Hi team, to be clear, I made my edits as a commit to this PR:
26dce20

So my changes are in. As I do, I say we get this content in and more eyes on it. Then iterate. We can revisit the outstanding comments here and even add them to the following issue (or anew) for tracking:
#732

@arun-koshy
Copy link
Contributor Author

I cannot submit this without approvals from @sblackshear & @awelc (because they requested changes). I think I addressed all the comments but let me know if I missed something


The recomended way to test the Sui REST API is to use Postman.

Postman is an API paltform for building and using APIs. Postman provides an alternative solution to accessing APIs over issuing curl commands in a terminal. You can use variables rather than copy-pasting addresses & object ids for each call in a terminal. We have provided a sample Postman runbook for you to use. Click `Run in Postman`, login and import the collection into your workspace and fire calls at the network.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Postman is an API paltform for building and using APIs. Postman provides an alternative solution to accessing APIs over issuing curl commands in a terminal. You can use variables rather than copy-pasting addresses & object ids for each call in a terminal. We have provided a sample Postman runbook for you to use. Click `Run in Postman`, login and import the collection into your workspace and fire calls at the network.
Postman is an API platform for building and using APIs. Postman provides an alternative solution to accessing APIs over issuing curl commands in a terminal. You can use variables rather than copy-pasting addresses & object ids for each call in a terminal. We have provided a sample Postman runbook for you to use. Click `Run in Postman`, login and import the collection into your workspace and fire calls at the network.

- Refer to [Postman](https://learning.postman.com/docs/getting-started/introduction/) documentation for more general usage information.

### Sui Network Endpoints

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's super obvious that the result of running curl commands is JSON, but if it's not perhaps we could say something like this here:

"Below we provide a list of network endpoints - a result of running each command is in JSON format but we omit output for brevity as it can be quite long"

Edit: Actually, I think it makes sense to show the output, at least in some cases (it's OK to abbreviate it). See other comments below.

doc/src/build/rest-api.md Outdated Show resolved Hide resolved
Returns the list of objects owned by an address.

```shell
curl --location --request GET $SUI_GATEWAY_HOST'/objects?address={{address}}' | json_pp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it's implicit that {address} could be obtained from the output of the previous command, I am not sure if this will be immediately obvious.

What I would do (and actually I CAN do it rather than this being part of this PR) is to show some output and point to it showing subsequent commands, much like it's done in wallet.md.

@awelc
Copy link
Contributor

awelc commented Mar 20, 2022

I cannot submit this without approvals from @sblackshear & @awelc (because they requested changes). I think I addressed all the comments but let me know if I missed something

That's strange - one approval should be enough. I approved, but I am not sure if it unblocked it...

@arun-koshy
Copy link
Contributor Author

Merging is blocked
Merging can be performed automatically once the requested changes are addressed.

Thanks, think I still need @sblackshear's approval and I can merge. I also thought one approval would be enough 🤷🏽

Merging is blocked
Merging can be performed automatically once the requested changes are addressed.

@sblackshear
Copy link
Collaborator

Merging is blocked
Merging can be performed automatically once the requested changes are addressed.

Thanks, think I still need @sblackshear's approval and I can merge. I also thought one approval would be enough 🤷🏽

Merging is blocked
Merging can be performed automatically once the requested changes are addressed.

I think you should be able to dismiss my review... let me know if this doesn't work in the future and we can change the settings!

Dismissing it and merging for now.

@sblackshear sblackshear dismissed their stale review March 21, 2022 01:55

addressed

@sblackshear sblackshear merged commit 8006703 into main Mar 21, 2022
@sblackshear sblackshear deleted the arun/rest-readme branch March 21, 2022 01:56
@Clay-Mysten Clay-Mysten mentioned this pull request Mar 21, 2022
mwtian pushed a commit to mwtian/sui that referenced this pull request Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants