Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

[docs] new JSON RPC API docs format #28197

Closed

Conversation

nickfrosty
Copy link
Contributor

@nickfrosty nickfrosty commented Oct 3, 2022

Problem

The JSON RPC API docs are difficult to navigate and consume. It should be easier to see the actual method docs and examples of how to use the method.

Changes

  • updates Docusaurus version to v2.2.0 to use some of new features
  • created a new /api landing page (see picture below)
  • creates a new display format in a "side-by-side" style format (picture below of what it looks like)
  • each RPC method is segmented out into separate markdown "partial" files (currently living in src/api)
  • the RPC methods for http and websocket methods have been moved to different pages
  • custom sidebar for each of the /api pages to show only the methods related to the current viewed page (e.g. http or websocket methods)
  • verified all recent changes of the JSON RPC page have been implemented into the newly formatted partials
    • verified commits between dates Sep 26, 2022 - Dec 1, 2022 (which are all since this PR was created to when opened)
    • history of changes here
  • added a description of the space value returned for accounts to the API docs

NOTE:
This updated display method will also pave the way to enable the core docs to have each of the client API docs on the same page, with a client "language" selector the user can use to view all the respective API docs for each client (e.g. JSON RPC via cURL, JavaScript, Rust)

Workflow for adding/updating RPC method doc pages

Making updates to the individual docs for each method will be inside of their respective "partial" MDX file, located in the respective src/api folder. See this example of the getAccountInfo method doc for reference

Each of these markdown "partials" will be linked withing the corresponding api doc page (similar to importing a component in React, per the Docusaurus docs). Here is an example for the getAccountInfo method

Screenshot of the proposed new format:

API home page (located at url /api)

Screenshot from 2022-10-22 08-46-57

Example of the "side-by-side" view (this example is located at /api/http#getaccountinfo)

Screenshot from 2022-10-22 08-40-04

Read more "details" component expanded:

Screenshot from 2022-10-22 08-58-08

@mergify mergify bot added the community Community contribution label Oct 3, 2022
@mergify mergify bot requested a review from a team October 3, 2022 19:04
@nickfrosty nickfrosty marked this pull request as draft October 3, 2022 19:04
@nickfrosty nickfrosty changed the title [WIP][docs] Proposed new JSON RPC API docs format [WIP][docs] new JSON RPC API docs format Oct 22, 2022
@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Dec 29, 2022
@nickfrosty nickfrosty changed the title [WIP][docs] new JSON RPC API docs format [docs] new JSON RPC API docs format Jan 4, 2023
@nickfrosty nickfrosty marked this pull request as ready for review January 4, 2023 19:14
@jacobcreech jacobcreech removed the stale [bot only] Added to stale content; results in auto-close after a week. label Jan 4, 2023
@jacobcreech jacobcreech requested review from jacobcreech and removed request for a team January 4, 2023 20:37
HaoranYi and others added 20 commits January 4, 2023 16:15
* test_store_overhead works with write cache

* test_storage_remove_account_double_remove works with write cache

* test_set_storage_count_and_alive_bytes works with write cache

* test_reuse_append_vec_id works with write cache
* make specific tests use write cache

* fix a few more tests
cli: Use QUIC if the default TPU behavior uses QUIC
* ledger-tool create-snapshot uses write cache

* ledger tool create snapshot works with write cache
…stalebot (solana-labs#29157)

I got this wrong in solana-labs#29134. The original config set this at 365 days, not 7.
* test_shrink_candidate_slots uses write cache (solana-labs#29145)

* add tests for collect_from_existing_account
jeffwashington and others added 26 commits January 4, 2023 16:15
…na-labs#29456)

* retry get_latest_blockhash

* more retries for get_latest_blockhash

* retry for get_fee too

* clippy

* fmt

* sleep

* Update accounts-cluster-bench/src/main.rs

Co-authored-by: Tyera <[email protected]>

* Update accounts-cluster-bench/src/main.rs

Co-authored-by: Tyera <[email protected]>

* rename

Co-authored-by: Tyera <[email protected]>
…abs#29421)

dedups gossip addresses, keeping only the one with the highest weight

In order to avoid traffic congestion or sending duplicate packets, when
sampling gossip nodes if several nodes have the same gossip address
(because they are behind a relayer or whatever), they need to be
deduplicated into one.
* cleanup get_snapshot_storages

* pr feedback
A subsequent change to `SamplePerformanceService` introduces non-vote transaction counts, which `bank`s need to store.

Part of work on solana-labs#29159
* frozen-abi/macro

* program-runtime

* sdk/macro

* sdk/program

* storage-bigtable/build-proto

* fix sorting
…olana-labs#29445)

{verify,sign}_shreds_gpu need to point to offsets within the packets for
the signed data. For merkle shreds this signed data is the merkle root
of the erasure batch and this would necessitate embedding the merkle
roots in the shreds payload.
However this is wasteful and reduces shreds capacity to store data
because the merkle root can already be recovered from the encoded merkle
proof.

Instead of pointing to offsets within the shreds payload, this commit
recovers merkle roots from the merkle proofs and stores them in an
allocated buffer. {verify,sign}_shreds_gpu would then point to offsets
within this new buffer for the respective signed data.

This would unblock us from removing merkle roots from shreds payload
which would save capacity to send more data with each shred.
when initializing, if a specific release is requested, we only need to confirm it exists
this can be done with the download url itself, rather than pulling the list of releases
@github-actions github-actions bot added explorer Related to the Solana Explorer webapp web3.js Related to the JavaScript client labels Jan 4, 2023
@mergify mergify bot mentioned this pull request Jan 6, 2023
@nickfrosty nickfrosty closed this Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Community contribution explorer Related to the Solana Explorer webapp web3.js Related to the JavaScript client
Projects
None yet
Development

Successfully merging this pull request may close these issues.