aptos-core
aptos-core copied to clipboard
Add API spec explorer to dev docs site
Description
In this PR I add the API spec explorer directly to the docs site. I use the Stoplight elements packages directly to do this. This isn't ready to land, we still need to figure out a few things:
I have tabs for each of the 3 major networks. Do we like this, or do we just want to show mainnet?
I show the stacked view for mainnet and the sidebar view for testnet so we can see which we prefer. On its own I prefer the sidebar view, but inside the docs site, perhaps stacked is cleaner. I think it'd be nice to have a switch so users can choose on their own, that shouldn't be hard. The sidebar view does look a little squished though, it seems like it wastes some space on the right side.
To make this work, I added a bunch of packages that this depended on. Normally this shouldn't be necessary I thought, and yarn should do this on its own. I followed some of the recommendations here to get this to work: https://github.com/stoplightio/elements/discussions/1777. We probably need the help from a frontend export (@zacharydenton) here.
I don't have a custom index.module.css, I just use the css from @stoplight/elements/styles.min.css. We should consider applying our own changes to this perhaps for branding purposes / making it fit better.
A small thing but I think the dark mode view is sort of busy looking. Light mode looks good though.
I suspect we want to put this somewhere else, probably not under the "nodes" tab.
The server for the "try it" feature is wrong.
Test Plan
Check it out on the Netlify preview, you want to visit /nodes/aptos-api-spec#/.
Description
In this PR I add the API spec explorer directly to the docs site. I use the Stoplight elements packages directly to do this. This isn't ready to land, we still need to figure out a few things:
I have tabs for each of the 3 major networks. Do we like this, or do we just want to show mainnet?
Thanks so much, Daniel! I prefer we show all if there will indeed be deltas between them. Looks like it: https://discord.com/channels/945856774056083548/1034215378299133974/1037095816147509249
I show the stacked view for mainnet and the sidebar view for testnet so we can see which we prefer. On its own I prefer the sidebar view, but inside the docs site, perhaps stacked is cleaner. I think it'd be nice to have a switch so users can choose on their own, that shouldn't be hard. The sidebar view does look a little squished though, it seems like it wastes some space on the right side.
I prefer stacked view given the embedding in Aptos.dev. The sidebar view is busy indeed embedded. My two cents.
To make this work, I added a bunch of packages that this depended on. Normally this shouldn't be necessary I thought, and yarn should do this on its own. I followed some of the recommendations here to get this to work: stoplightio/elements#1777. We probably need the help from a frontend export (@zacharydenton) here.
I don't have a custom index.module.css, I just use the css from
@stoplight/elements/styles.min.css. We should consider applying our own changes to this perhaps for branding purposes / making it fit better.A small thing but I think the dark mode view is sort of busy looking. Light mode looks good though.
I suspect we want to put this somewhere else, probably not under the "nodes" tab.
I am suggesting we create a top-level Reference section where this will reside. In the meantime we can swap out the existing REST API link in the top bar of aptos.dev.
The server for the "try it" feature is wrong.
Test Plan
Check it out on the Netlify preview, you want to visit
/nodes/aptos-api-spec#/.
Let me see if I can fix the server thing for the try it feature, I'd say that's the main blocker. As well as the API in the top bar. Let me try that.
Let me know how I can help. Thank you Daniel.
See https://github.com/stoplightio/elements/issues/2279 for the server problem with the "try it" feature.
Forge is running suite land_blocking on de747256be53c99f2e2a91f6f479b91b8b940eb0
- Grafana dashboard (auto-refresh)
- Humio Logs
- Test runner output
- Test run is land-blocking
Forge is running suite compat on 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> de747256be53c99f2e2a91f6f479b91b8b940eb0
- Grafana dashboard (auto-refresh)
- Humio Logs
- Test runner output
- Test run is land-blocking
:white_check_mark: Forge suite land_blocking success on de747256be53c99f2e2a91f6f479b91b8b940eb0
performance benchmark with full nodes : 6902 TPS, 5726 ms latency, 13800 ms p99 latency,(!) expired 920 out of 2948400 txns
Test Ok
- Grafana dashboard
- Humio Logs
- Test runner output
- Test run is land-blocking
:white_check_mark: Forge suite compat success on 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> de747256be53c99f2e2a91f6f479b91b8b940eb0
Compatibility test results for 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> de747256be53c99f2e2a91f6f479b91b8b940eb0 (PR)
1. Check liveness of validators at old version: 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : 7410 TPS, 5218 ms latency, 7400 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: de747256be53c99f2e2a91f6f479b91b8b940eb0
compatibility::simple-validator-upgrade::single-validator-upgrade : 4656 TPS, 8947 ms latency, 11800 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: de747256be53c99f2e2a91f6f479b91b8b940eb0
compatibility::simple-validator-upgrade::half-validator-upgrade : 4601 TPS, 8882 ms latency, 12100 ms p99 latency,no expired txns
4. upgrading second batch to new version: de747256be53c99f2e2a91f6f479b91b8b940eb0
compatibility::simple-validator-upgrade::rest-validator-upgrade : 6882 TPS, 5707 ms latency, 10100 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for 2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> de747256be53c99f2e2a91f6f479b91b8b940eb0 passed
Test Ok
- Grafana dashboard
- Humio Logs
- Test runner output
- Test run is land-blocking