Skip to content

Commit

Permalink
chore: remove custom api component and pages, use node-rpc-docs.celes…
Browse files Browse the repository at this point in the history
…tia.org instead
  • Loading branch information
jcstein committed Oct 10, 2023
1 parent 5bd49d6 commit 0acc004
Show file tree
Hide file tree
Showing 23 changed files with 9 additions and 42,999 deletions.
148 changes: 0 additions & 148 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,151 +62,3 @@ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

## API documentation versioning

In order to version the API docs, you will need to do a few things.

1. change into the `docs/` repository

2. Replace `your-new-version` with your desired version of `celestia-node`.

3. In `docs/src/theme/Navbar/Content/index.js` add your new version to line 55:

Change this:

```js
const versions = ["v0.11.0-rc8"];
```

To this:

```js
const versions = ["your-new-version", "v0.11.0-rc8"];
```

4. Do the same thing in `docs/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.js` on line 24:

```js
const versions = ["your-new-version", "v0.11.0-rc8"];
```

5. Next, you'll need to update the API page and links.

In `docs/developers/node-api.md`, edit line 11:

```md
[the API's documentation](/api/v0.11.0-rc13).
```

Change the above to:

```md
[the API's documentation](/api/your-new-version).
```

6. In the `docs/developers/node-tutorial.mdx` page,

Change this:

```md
## RPC CLI guide

This section of the tutorial will teach you how to interact with a
Celestia node's
[RPC (Remote Procedure Call) API](/api/v0.11.0-rc8).
```

To this:

```md
## RPC CLI guide

This section of the tutorial will teach you how to interact with a
Celestia node's
[RPC (Remote Procedure Call) API](/api/your-new-version).
```

7. Change the path in the `docs/developers/overview.md` page.

Change this:

```md
- [Node API docs](/api/v0.11.0-rc8)
```

To this:

```md
- [Node API docs](/api/your-new-version)
```

8. Next, change the linked API in `sidebars.js`

Change this:

```json
{
"type": "link",
"label": "Celestia Node API",
"href": "/api/v0.11.0-rc8"
},
```

To this:

```json
{
"type": "link",
"label": "Celestia Node API",
"href": "/api/your-new-version"
},
```

9. Lastly, generate or copy the final openrpc.json for the version that you are using.

```bash
git clone https://github.com/celestia-node.git
cd celestia-node
git checkout tags/your-new-version
make openrpc-gen | pbcopy
```

Paste that into `docs/src/openrpc-spec/openrpc-your-new-version.json`
and remove the first line of output from the terminal.

10. Duplicate `docs/src/pages/api/v0.11.0-rc8.js` and change the name of the new version to `docs/src/pages/api/your-new-version.js`. Change the import in the newly named file to what you created above:

```js
import(`@site/src/openrpc-spec/openrpc-your-new-version.json`);
```

11. Lastly, update the `docs/developers/submit-data.md` to reflect the new version:

Change this:

```md
### RPC to a celestia-node

Using the JSON RPC API, submit data using the following methods:

- [blob.Submit](/api/v0.11.0-rc8/#blob.Submit)
- [state.SubmitPayForBlob](/api/v0.11.0-rc8/#state.SubmitPayForBlob)

Learn more in the [celestia-node API docs](/api/v0.11.0-rc8).
```

To this:

```md
### RPC to a celestia-node

Using the JSON RPC API, submit data using the following methods:

- [blob.Submit](/api/your-new-version/#blob.Submit)
- [state.SubmitPayForBlob](/api/your-new-version/#state.SubmitPayForBlob)

Learn more in the [celestia-node API docs](/api/your-new-version).
```

12. Start your newly versioned site to reflect the latest versioning changes!
2 changes: 1 addition & 1 deletion docs/developers/node-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: An overview of the Celestia Node API.
The Celestia Node API is made for interacting with `celestia-node`.
There are two ways in which a user and developer can interact with
the API, the RPC API and the Gateway API. View
[the API's documentation](/api/v0.11.0-rc13).
[the API's documentation](https://node-rpc-docs.celestia.org/).

## RPC API

Expand Down
2 changes: 1 addition & 1 deletion docs/developers/node-tutorial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ With your wallet funded, you can move on to the next step.

This section of the tutorial will teach you how to interact with a
Celestia node's
[RPC (Remote Procedure Call) API](/api/v0.11.0-rc13).
[RPC (Remote Procedure Call) API](https://node-rpc-docs.celestia.org/).

First, you will need to [install and run `celestia-node`](#setting-up-dependencies) if
you have not already. Open up another terminal window in order to begin querying the API.
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It includes:
- [Celestia app](../../developers/celestia-app-wallet/)
- [Celestia node](../../developers/celestia-node-key/)
- [Overview of the Celestia node API](../../developers/node-api/)
- [Node API docs](/api/v0.11.0-rc12)
- [Node API docs](https://node-rpc-docs.celestia.org/)
- [How to use the Celestia node RPC API](../../developers/node-tutorial/)
- Learn [Celestia node API](../../developers/prompt-scavenger/) with a game
- [Deploying rollups on Celestia](../../developers/rollup-overview/)
Expand Down
6 changes: 3 additions & 3 deletions docs/developers/submit-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ func DemoSubmitData(grpcAddr string, kr keyring.Keyring) error {

Using the JSON RPC API, submit data using the following methods:

- [blob.Submit](/api/v0.11.0-rc13/#blob.Submit)
- [state.SubmitPayForBlob](/api/v0.11.0-rc13/#state.SubmitPayForBlob)
- [blob.Submit](https://node-rpc-docs.celestia.org/#blob.Submit)
- [state.SubmitPayForBlob](https://node-rpc-docs.celestia.org/#state.SubmitPayForBlob)

Learn more in the [celestia-node API docs](/api/v0.11.0-rc13).
Learn more in the [celestia-node API docs](https://node-rpc-docs.celestia.org/).

<!-- markdownlint-disable MD013 -->
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ const sidebars = {
{
"type": "link",
"label": "Celestia Node API",
"href": "/api/v0.11.0-rc13"
"href": "https://node-rpc-docs.celestia.org/"
},
{
type: "category",
Expand Down
Loading

0 comments on commit 0acc004

Please sign in to comment.