-
Notifications
You must be signed in to change notification settings - Fork 5
mintlify migration #18
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2023 Mintlify | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Mintlify Starter Kit | ||
|
|
||
| Use the starter kit to get your docs deployed and ready to customize. | ||
|
|
||
| Click the green **Use this template** button at the top of this repo to copy the Mintlify starter kit. The starter kit contains examples with | ||
|
|
||
| - Guide pages | ||
| - Navigation | ||
| - Customizations | ||
| - API reference pages | ||
| - Use of popular components | ||
|
|
||
| **[Follow the full quickstart guide](https://starter.mintlify.com/quickstart)** | ||
|
|
||
| ## Development | ||
|
|
||
| Install the [Mintlify CLI](https://www.npmjs.com/package/mint) to preview your documentation changes locally. To install, use the following command: | ||
|
|
||
| ``` | ||
| npm i -g mint | ||
| ``` | ||
|
|
||
| Run the following command at the root of your documentation, where your `docs.json` is located: | ||
|
|
||
| ``` | ||
| mint dev | ||
| ``` | ||
|
Comment on lines
+25
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Add language identifier to fenced code block. Per markdown best practices (MD040), fenced code blocks should specify a language for syntax highlighting. This CLI command should be marked as -```
+```bash
mint dev
-```
+```🧰 Tools🪛 markdownlint-cli2 (0.18.1)25-25: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
|
|
||
| View your local preview at `http://localhost:3000`. | ||
|
|
||
| ## Publishing changes | ||
|
|
||
| Install our GitHub app from your [dashboard](https://dashboard.mintlify.com/settings/organization/github-app) to propagate changes from your repo to your deployment. Changes are deployed to production automatically after pushing to the default branch. | ||
|
|
||
| ## Need help? | ||
|
|
||
| ### Troubleshooting | ||
|
|
||
| - If your dev environment isn't running: Run `mint update` to ensure you have the most recent version of the CLI. | ||
| - If a page loads as a 404: Make sure you are running in a folder with a valid `docs.json`. | ||
|
|
||
| ### Resources | ||
|
Comment on lines
+35
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Add blank line before heading. Per markdown best practices (MD022), headings should be surrounded by blank lines. Line 42 ("### Resources") needs a blank line above it (after the closing paragraph on line 41). - If a page loads as a 404: Make sure you are running in a folder with a valid `docs.json`.
+
### Resources🧰 Tools🪛 markdownlint-cli2 (0.18.1)42-42: Headings should be surrounded by blank lines (MD022, blanks-around-headings) 🤖 Prompt for AI Agents |
||
| - [Mintlify documentation](https://mintlify.com/docs) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| title: Client Library | ||
| description: Overview to Rust and Typescript client guides. Guides include step-by-step implementation and full code examples. | ||
| --- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,209 @@ | ||
| --- | ||
| title: Create a Program with Compressed PDAs | ||
| description: Overview to compressed PDA core features and guide for program development | ||
| --- | ||
|
|
||
| Compressed PDAs provide full functionality of accounts at PDAs, without per-account rent cost. | ||
|
|
||
| | Creation | Regular PDA Account | Compressed PDA | Cost Reduction | | ||
| | :------------- | :--------------------- | :---------------------- | :------------------ | | ||
| | 100-byte PDA | ~ 0.0016 SOL | **~ 0.00001 SOL** | ***160x*** | | ||
|
|
||
| Compressed PDAs are derived using a specific program address and seed, like regular PDAs. Custom programs invoke the [Light System program](#user-content-fn-1)[^1] to create and update accounts, instead of the System program. | ||
|
|
||
| #### Compressed PDAs at a Glance | ||
|
|
||
| <CardGroup cols={3}> | ||
| <Card title="Rent free PDAs"> | ||
| Create accounts at program-derived addresses without upfront rent exempt balance. | ||
| </Card> | ||
| <Card title="Full PDA Functionality"> | ||
| Persistent unique identification and program ownership. | ||
| </Card> | ||
| <Card title="Composable"> | ||
| CPI support between compressed and regular PDAs. | ||
| </Card> | ||
| </CardGroup> | ||
|
|
||
| ## Start Building | ||
|
|
||
| Developing with compressed PDAs works similar to regular PDAs and involves minimal setup: | ||
|
|
||
| <Steps> | ||
| <Step title="Prerequisites"> | ||
|
|
||
| <Info> | ||
| Required versions: | ||
|
|
||
| * **Rust**: 1.86.0 or later | ||
| * **Solana CLI**: 2.2.15 | ||
| * **Anchor CLI**: 0.31.1 | ||
| * **Zk compression CLI**: 0.27.0 or later | ||
| * **Node.js**: 23.5.0 or later | ||
| </Info> | ||
|
|
||
| **Install Solana CLI:** | ||
|
|
||
| ```bash | ||
| sh -c "$(curl -sSfL https://release.solana.com/v2.2.15/install)" | ||
| ``` | ||
|
|
||
| **Install Anchor CLI:** | ||
|
|
||
| ```bash | ||
| cargo install --git https://github.com/coral-xyz/anchor avm --force | ||
| avm install latest | ||
| avm use latest | ||
| ``` | ||
|
|
||
| **Install the Light CLI:** | ||
|
|
||
| ```bash | ||
| npm -g i @lightprotocol/zk-compression-cli | ||
| ``` | ||
|
|
||
| ```bash | ||
| ### verify installation | ||
| light --version | ||
| ``` | ||
|
|
||
| </Step> | ||
| <Step title="Initialize your Program"> | ||
|
|
||
| Instantiate a template Solana program with compressed accounts with all required dependencies. | ||
|
|
||
| ```bash | ||
| light init testprogram | ||
| ``` | ||
|
|
||
| <Info> | ||
| The `light init` command creates only Anchor-based projects . For Pinocchio programs, manually configure dependencies using `light-sdk-pinocchio`. | ||
| </Info> | ||
|
|
||
| <Accordion title="Dependencies"> | ||
|
|
||
| **Rust Crates** | ||
|
|
||
| * `light-sdk` - Core SDK for compressed accounts in native and anchor programs | ||
| * `light-sdk-pinocchio` Core SDK for compressed accounts in pinocchio programs | ||
| * `light-client` - RPC client and indexer for interacting with compressed accounts | ||
| * `light-program-test` - Testing utilities for compressed programs. | ||
|
|
||
| **TypeScript/JavaScript Packages** | ||
|
|
||
| * `@lightprotocol/stateless.js` - Client library for interacting with compressed accounts | ||
| * `@lightprotocol/zk-compression-cli` - Command-line tools for ZK compression development | ||
|
|
||
| </Accordion> | ||
| </Step> | ||
| <Step title="Build and Test"> | ||
|
|
||
| Now `cd testprogram` and run: | ||
|
|
||
| ```bash | ||
| anchor build | ||
| # Success: Finished `release` profile [optimized] target(s), after compiling. | ||
| # Note: Stack offset warnings are expected and don't prevent compilation | ||
| ``` | ||
|
|
||
| ```bash | ||
| cargo test-sbf | ||
|
|
||
| # Success: test result: ok. 1 passed; 0 failed; 0 ignored | ||
| ``` | ||
| </Step> | ||
| </Steps> | ||
|
|
||
|
|
||
| ### Common Errors | ||
|
|
||
| <Accordion title="assert.h file not found - during compilation."> | ||
|
|
||
| ```shellscript | ||
| Fix: | ||
| In your terminal, run: | ||
| 1. export CC=$(xcrun -find clang) | ||
| 2. export SDKROOT=$(xcrun --show-sdk-path) | ||
| 3. cargo clean | ||
| 4. anchor build | ||
|
|
||
|
|
||
| Example log: | ||
| The following warnings were emitted during compilation: | ||
|
|
||
| warning: blake3@1.5.1: In file included from c/blake3_neon.c:1: | ||
| warning: blake3@1.5.1: c/blake3_impl.h:4:10: fatal error: 'assert.h' file not found | ||
| warning: blake3@1.5.1: 4 | #include <assert.h> | ||
| warning: blake3@1.5.1: | ^~~~~~~~~~ | ||
| warning: blake3@1.5.1: 1 error generated. | ||
|
|
||
| error: failed to run custom build command for `blake3 v1.5.1` | ||
|
|
||
| Caused by: | ||
| process didn't exit successfully: `/Users/you/testprogram/target/release/build/blake3-ac41d29c2eabe052/build-script-build` (exit status: 1) | ||
| --- stdout | ||
| cargo:rerun-if-env-changed=CARGO_FEATURE_PURE | ||
| cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON | ||
| cargo:rerun-if-env-changed=CARGO_FEATURE_NEON | ||
| cargo:rerun-if-env-changed=CARGO_FEATURE_NEON | ||
| cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON | ||
| cargo:rerun-if-env-changed=CARGO_FEATURE_PURE | ||
| cargo:rustc-cfg=blake3_neon | ||
| OUT_DIR = Some(/Users/you/testprogram/target/release/build/blake3-735a4c71d985df30/out) | ||
| TARGET = Some(aarch64-apple-darwin) | ||
| OPT_LEVEL = Some(3) | ||
| HOST = Some(aarch64-apple-darwin) | ||
| cargo:rerun-if-env-changed=CC_aarch64-apple-darwin | ||
| CC_aarch64-apple-darwin = None | ||
| cargo:rerun-if-env-changed=CC_aarch64_apple_darwin | ||
| CC_aarch64_apple_darwin = None | ||
| cargo:rerun-if-env-changed=HOST_CC | ||
| HOST_CC = None | ||
| cargo:rerun-if-env-changed=CC | ||
| CC = Some(/Users/you/.local/share/solana/install/releases/1.18.22/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang) | ||
| RUSTC_WRAPPER = None | ||
| cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT | ||
| cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS | ||
| CRATE_CC_NO_DEFAULTS = None | ||
| DEBUG = Some(false) | ||
| cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET | ||
| MACOSX_DEPLOYMENT_TARGET = None | ||
| cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin | ||
| CFLAGS_aarch64-apple-darwin = None | ||
| cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin | ||
| CFLAGS_aarch64_apple_darwin = None | ||
| cargo:rerun-if-env-changed=HOST_CFLAGS | ||
| HOST_CFLAGS = None | ||
| cargo:rerun-if-env-changed=CFLAGS | ||
| CFLAGS = None | ||
| cargo:warning=In file included from c/blake3_neon.c:1: | ||
| cargo:warning=c/blake3_impl.h:4:10: fatal error: 'assert.h' file not found | ||
| cargo:warning= 4 | #include <assert.h> | ||
| cargo:warning= | ^~~~~~~~~~ | ||
| cargo:warning=1 error generated. | ||
|
|
||
| --- stderr | ||
|
|
||
|
|
||
| error occurred: Command env -u IPHONEOS_DEPLOYMENT_TARGET "/Users/you/.local/share/solana/install/releases/1.18.22/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm64-apple-darwin" "-mmacosx-version-min=14.4" "-Wall" "-Wextra" "-std=c11" "-o" "/Users/you/testprogram/target/release/build/blake3-735a4c71d985df30/out/db3b6bfb95261072-blake3_neon.o" "-c" "c/blake3_neon.c" with args clang did not execute successfully (status code exit status: 1). | ||
| ``` | ||
|
|
||
| </Accordion> | ||
|
|
||
| ## Program Examples | ||
| | Example | Description | | ||
| |:---------|:------------| | ||
| | [basic-operations/anchor](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/anchor) | Anchor programs to create, update, close, reinitialize and burn compressed accounts with Rust and TypeScript tests | | ||
| | [basic-operations/native-rust](https://github.com/Lightprotocol/program-examples/tree/main/basic-operations/native-rust) | Native Solana program implementation to create, update, close, reinitialize and burn compressed accounts with Rust tests | | ||
| | [Counter (Anchor)](https://github.com/Lightprotocol/program-examples/tree/main/counter/anchor) | Full compressed account lifecycle (create, increment, decrement, reset, close) using Anchor framework | | ||
| | [Counter (Native)](https://github.com/Lightprotocol/program-examples/tree/main/counter/native) | Native Solana program implementation with Rust tests | | ||
| | [Counter (Pinocchio)](https://github.com/Lightprotocol/program-examples/tree/main/counter/pinocchio) | Pinocchio implementation using light-sdk-pinocchio with Rust tests | | ||
| | [Create-and-Update](https://github.com/Lightprotocol/program-examples/tree/main/create-and-update) | Create new compressed accounts and update existing ones within a single instruction and one validity proof | | ||
| | [Read-Only](https://github.com/Lightprotocol/program-examples/tree/main/read-only) | Create compressed accounts and read them on-chain | | ||
| | [Account Comparison](https://github.com/Lightprotocol/program-examples/tree/main/account-comparison) | Compare compressed accounts with standard Solana accounts | | ||
| | [ZK-ID](https://github.com/Lightprotocol/program-examples/tree/main/zk-id) | Program that uses zero-knowledge proofs for identity verification with compressed accounts | | ||
|
|
||
|
|
||
| ## Next Steps | ||
|
|
||
| Start building with compressed accounts using our guides or program examples. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| title: Guides | ||
| description: Overview and comparison of guides to create, update, close, reinitialize, and burn permanently compressed accounts. Guides include step-by-step implementation and full code examples. | ||
| sidebarTitle: "Overview" | ||
| --- | ||
|
|
||
| ## Guides Overview | ||
|
|
||
| | Guide | Description | | ||
| | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | ||
| | [Create Compressed Accounts](/compressed-pdas/guides/how-to-create-compressed-accounts) | Create compressed accounts with address | | ||
| | [Update Compressed Accounts](/compressed-pdas/guides/how-to-update-compressed-accounts) | Update compressed accounts | | ||
| | [Close Compressed Accounts](/compressed-pdas/guides/how-to-close-compressed-accounts) | Close compressed accounts, retain the address | | ||
| | [Reinitialize Compressed Accounts](/compressed-pdas/guides/how-to-reinitialize-compressed-accounts) | Reinitialize closed compressed accounts with the same address and new values | | ||
| | [Burn Compressed Accounts](/compressed-pdas/guides/how-to-burn-compressed-accounts) | Burn compressed accounts and their address permanently | | ||
|
|
||
| ## Complete Flow Overview | ||
|
|
||
| <Tabs> | ||
| <Tab title="Create"> | ||
| <div className="hidden dark:block"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| <div className="block dark:hidden"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| </Tab> | ||
| <Tab title="Update"> | ||
| <div className="hidden dark:block"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| <div className="block dark:hidden"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| </Tab> | ||
| <Tab title="Close"> | ||
| <div className="hidden dark:block"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| <div className="block dark:hidden"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| </Tab> | ||
| <Tab title="Reinitialize"> | ||
| <div className="hidden dark:block"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| <div className="block dark:hidden"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| </Tab> | ||
| <Tab title="Burn"> | ||
| <div className="hidden dark:block"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| <div className="block dark:hidden"> | ||
| <Frame> | ||
|  | ||
| </Frame> | ||
| </div> | ||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ## Next Steps | ||
|
|
||
| Create a compressed account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Add language identifier to fenced code block.
Per markdown best practices (MD040), fenced code blocks should specify a language for syntax highlighting. This npm installation command should be marked as
bashorsh.🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
19-19: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents