Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Generated files
.docusaurus
.cache-loader
/docs/sage/rpc
# Generated RPC pages from before the Sage docs moved to docs/sage
/docs/rpc

# Misc
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ build
.docusaurus
pnpm-lock.yaml
src/openapi.json
docs/sage/rpc
docs/rpc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pnpm install
pnpm start
```

`pnpm start` and `pnpm build` both generate the RPC reference pages first. The generated pages go to `docs/rpc`, which is gitignored. To regenerate them on their own, run `pnpm gen-api-docs`.
`pnpm start` and `pnpm build` both generate the RPC reference pages first. The generated pages go to `docs/sage/rpc`, which is gitignored. To regenerate them on their own, run `pnpm gen-api-docs`.

Before opening a PR, run:

Expand Down
2 changes: 1 addition & 1 deletion docs/config.md → docs/sage/config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
slug: /config
slug: /sage/config
---

# Config
Expand Down
22 changes: 11 additions & 11 deletions docs/files.md → docs/sage/files.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
slug: /files
slug: /sage/files
---

import Tabs from '@theme/Tabs';
Expand All @@ -21,13 +21,13 @@ The username `Alice` is a placeholder, and must be replaced by your actual usern

## Files

| Name | Description |
| --------------- | --------------------------------------------------------------------------------------- |
| `config.toml` | The main configuration file used by the app. See [Config](/config). |
| `keys.bin` | A binary encoding of all imported keys. |
| `logs` | Logs emitted by the backend of the app. |
| `networks.toml` | Information about blockchain networks (ie mainnet or testnet11). See [Config](/config). |
| `peers` | Binary files that store previous peer connections. |
| `ssl` | The SSL certificate used for full node connections and the RPC. |
| `wallets` | SQLite databases for each network and key pair. |
| `wallets.toml` | Configuration for each imported wallet. See [Config](/config). |
| Name | Description |
| --------------- | -------------------------------------------------------------------------------------------- |
| `config.toml` | The main configuration file used by the app. See [Config](/sage/config). |
| `keys.bin` | A binary encoding of all imported keys. |
| `logs` | Logs emitted by the backend of the app. |
| `networks.toml` | Information about blockchain networks (ie mainnet or testnet11). See [Config](/sage/config). |
| `peers` | Binary files that store previous peer connections. |
| `ssl` | The SSL certificate used for full node connections and the RPC. |
| `wallets` | SQLite databases for each network and key pair. |
| `wallets.toml` | Configuration for each imported wallet. See [Config](/sage/config). |
4 changes: 2 additions & 2 deletions docs/index.md → docs/sage/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
slug: /getting-started
slug: /sage/getting-started
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Getting Started

The goal of this website is to provide documentation for Sage and the Wallet SDK it's built with. It will cover a wide range of topics, from configuring and using Sage and its RPCs to building your own applications that utilize the Wallet SDK library to connect to the Chia blockchain.
This section covers Sage itself: building it from source, where it stores its files, how to configure it, and how to use its RPC. If you want to build your own application on the Chia blockchain, see the [Wallet SDK](/sdk) docs, which cover the Rust library Sage is built with.

:::info
If you are looking for download instructions for the app, visit the [Sage Website](https://sagewallet.net).
Expand Down
4 changes: 2 additions & 2 deletions docs/rpc-setup.md → docs/sage/rpc-setup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Setup
slug: /rpc/setup
slug: /sage/rpc/setup
---

# RPC Setup
Expand Down Expand Up @@ -37,7 +37,7 @@ Do not run the command line RPC server at the same time as the GUI. They may ove

## SSL Certificate

The CLI will load the certificate automatically, but if you want to connect to the RPC server from your own client (for example, in a Node.js app), you can find the SSL certificate on the [Files](/files) page.
The CLI will load the certificate automatically, but if you want to connect to the RPC server from your own client (for example, in a Node.js app), you can find the SSL certificate on the [Files](/sage/files) page.

Here is an example of how you need to connect:

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Quick Start

# Wallet SDK

The Chia Wallet SDK is a Rust library for building applications that interact with the Chia blockchain. It provides high-level abstractions for creating transactions, managing coins, and working with Chia primitives like CATs, NFTs, and Vaults.
The Chia Wallet SDK is a Rust library for building applications that interact with the Chia blockchain. It provides high-level abstractions for creating transactions, managing coins, and working with Chia primitives like CATs, NFTs, and Vaults. It's the same library [Sage](/sage/getting-started) is built on.

:::info
This documentation assumes familiarity with Chia blockchain concepts such as coins, puzzles, conditions, and singletons. For background, see the [Chia Documentation](https://docs.chia.net) and [Chialisp Documentation](https://chialisp.com).
Expand Down
34 changes: 30 additions & 4 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ const config: Config = {
docs: {
sidebarPath: "./sidebars.ts",
routeBasePath: "",
// Skip RPC pages generated at docs/rpc before the Sage docs moved to
// docs/sage, so stale local output isn't built alongside the new pages.
exclude: [
"**/_*.{js,jsx,ts,tsx,md,mdx}",
"**/_*/**",
"**/*.test.{js,jsx,ts,tsx}",
"**/__tests__/**",
"rpc/**",
],
docItemComponent: "@theme/ApiItem",
// Generated RPC pages have no source file to edit.
editUrl: ({ docPath }) =>
docPath.startsWith("rpc/")
docPath.startsWith("sage/rpc/")
? undefined
: `https://github.com/xch-dev/docs/tree/main/docs/${docPath}`,
},
Expand All @@ -43,6 +52,17 @@ const config: Config = {
],
],
plugins: [
[
"@docusaurus/plugin-client-redirects",
{
redirects: [{ from: "/sage", to: "/sage/getting-started" }],
// Sage pages used to be served without the /sage prefix.
createRedirects: (existingPath: string) =>
existingPath.startsWith("/sage/")
? [existingPath.slice("/sage".length)]
: undefined,
},
],
[
"docusaurus-plugin-openapi-docs",
{
Expand All @@ -51,7 +71,7 @@ const config: Config = {
config: {
sage_rpc: {
specPath: "src/openapi.json",
outputDir: "docs/rpc/",
outputDir: "docs/sage/rpc/",
sidebarOptions: {
groupPathsBy: "tag",
},
Expand Down Expand Up @@ -82,9 +102,15 @@ const config: Config = {
items: [
{
type: "docSidebar",
sidebarId: "sidebar",
sidebarId: "sage",
position: "left",
label: "Sage",
},
{
type: "docSidebar",
sidebarId: "sdk",
position: "left",
label: "Docs",
label: "Wallet SDK",
},
{
href: "https://github.com/xch-dev/docs",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@docusaurus/core": "3.10.2",
"@docusaurus/plugin-client-redirects": "3.10.2",
"@docusaurus/preset-classic": "3.10.2",
"@easyops-cn/docusaurus-search-local": "^0.55.3",
"@mdx-js/react": "^3.1.1",
Expand Down
51 changes: 51 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 31 additions & 31 deletions sidebars.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
import apiSidebarModule from "./docs/rpc/sidebar";
import apiSidebarModule from "./docs/sage/rpc/sidebar";

const sidebars: SidebarsConfig = {
sidebar: [
{ type: "doc", id: "index" },
{ type: "doc", id: "files" },
{ type: "doc", id: "config" },
sage: [
{ type: "doc", id: "sage/index" },
{ type: "doc", id: "sage/files" },
{ type: "doc", id: "sage/config" },
{
type: "category",
label: "RPC",
items: [{ type: "doc", id: "rpc-setup" }, ...apiSidebarModule.slice(1)],
items: [
apiSidebarModule[0],
{ type: "doc", id: "sage/rpc-setup" },
...apiSidebarModule.slice(1),
],
},
],
sdk: [
{ type: "doc", id: "sdk/index", label: "Quick Start" },
{ type: "doc", id: "sdk/spend-context", label: "SpendContext" },
{ type: "doc", id: "sdk/actions", label: "Action System" },
{ type: "doc", id: "sdk/connectivity", label: "Connectivity" },
{
type: "category",
label: "Wallet SDK",
label: "Primitives",
items: [
{ type: "doc", id: "sdk/index", label: "Quick Start" },
{ type: "doc", id: "sdk/spend-context", label: "SpendContext" },
{ type: "doc", id: "sdk/actions", label: "Action System" },
{ type: "doc", id: "sdk/connectivity", label: "Connectivity" },
{
type: "category",
label: "Primitives",
items: [
{
type: "doc",
id: "sdk/primitives/standard",
label: "Standard (XCH)",
},
{ type: "doc", id: "sdk/primitives/cat", label: "CAT" },
{ type: "doc", id: "sdk/primitives/nft", label: "NFT" },
{
type: "doc",
id: "sdk/primitives/other",
label: "Other Primitives",
},
],
type: "doc",
id: "sdk/primitives/standard",
label: "Standard (XCH)",
},
{ type: "doc", id: "sdk/primitives/cat", label: "CAT" },
{ type: "doc", id: "sdk/primitives/nft", label: "NFT" },
{
type: "doc",
id: "sdk/primitives/other",
label: "Other Primitives",
},
{ type: "doc", id: "sdk/offers", label: "Offers" },
{ type: "doc", id: "sdk/testing", label: "Testing" },
{ type: "doc", id: "sdk/patterns", label: "Application Patterns" },
{ type: "doc", id: "sdk/troubleshooting", label: "Troubleshooting" },
],
},
{ type: "doc", id: "sdk/offers", label: "Offers" },
{ type: "doc", id: "sdk/testing", label: "Testing" },
{ type: "doc", id: "sdk/patterns", label: "Application Patterns" },
{ type: "doc", id: "sdk/troubleshooting", label: "Troubleshooting" },
],
};

Expand Down
2 changes: 2 additions & 0 deletions src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
gap: 1rem;
}
7 changes: 5 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ function HomepageHeader() {
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/getting-started"
to="/sage/getting-started"
>
Get Started
Sage Docs
</Link>
<Link className="button button--secondary button--lg" to="/sdk">
Wallet SDK Docs
</Link>
</div>
</div>
Expand Down
Loading