diff --git a/docs/toolkit/best-practices.md b/docs/toolkit/best-practices.md index 28c16507a..a47596c01 100644 --- a/docs/toolkit/best-practices.md +++ b/docs/toolkit/best-practices.md @@ -1,7 +1,19 @@ --- -title: Solana Smart Contract Best Practices +title: Solana Program Best Practices sidebarSortOrder: 3 sidebarLabel: Best Practices +description: + "The best practices for Solana program development, including: optimize + compute, fuzzing, repo structure, indexing, and more." +seoTitle: "What are best practices for Solana program development?" +keywords: + - solana best practices + - program best practices + - program development + - program security + - development best practices + - smart contract best practices + - solana smart contracts --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is diff --git a/docs/toolkit/getting-started.md b/docs/toolkit/getting-started.md index 9d8d1275a..a9fb77ecb 100644 --- a/docs/toolkit/getting-started.md +++ b/docs/toolkit/getting-started.md @@ -2,6 +2,16 @@ sidebarSortOrder: 1 sidebarLabel: Getting Started title: Getting Started with the Solana Toolkit +description: "How to set up the Solana Toolkit and install the Solana CLI" +seoTitle: "How to set up the Solana Toolkit and install the Solana CLI" +keywords: + - solana toolkit + - smart contract development + - program development + - program tools + - solana tools + - smart contract tools + - solana foundry --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is diff --git a/docs/toolkit/index.md b/docs/toolkit/index.md index 44f166f22..8c085631a 100644 --- a/docs/toolkit/index.md +++ b/docs/toolkit/index.md @@ -1,6 +1,27 @@ --- title: The Solana Toolkit sidebarSortOrder: 3 +description: + "This is an overview of the Solana Toolkit and mucho CLI. It includes how to + write tests for Solana programs, how to create a new project on Solana, and + what the best practices are for writing Solana programs" +keywords: + - solana testing + - solana fuzz tester + - solana code coverage + - solana programs + - rust tests + - javascript tests + - solana program development + - solana program best practices + - local testing + - solana toolkit + - smart contract development + - program development + - program tools + - solana tools + - smart contract tools + - solana foundry --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -12,7 +33,35 @@ The Solana Program development toolkit is published as the will be used to run most of the Solana program development tools - _mucho tools, one cli_. +## Install + +```shell +npx -y mucho@latest install +``` + +For more information, go to [Getting Started](/docs/toolkit/getting-started.md). + +## Create a Project + +```shell +pnpm create solana-program +``` + +For more information, go to the [Projects](/docs/toolkit/projects/overview.md). + +[Source code](https://github.com/solana-program/create-solana-program). + +## Testing on Solana + +- [Fuzz tester](/docs/toolkit/test-suite/fuzz-tester.md) +- [Code coverage](/docs/toolkit/test-suite/code-coverage.md) +- [JavaScript Tests](/docs/toolkit/test-suite/js-test.md) +- [Rust Test](/docs/toolkit/test-suite/rust-tests.md) +- [Security Scanner](/docs/toolkit/test-suite/security-scanner.md) +- [Local Testing](/docs/toolkit/local-validator.md) +- [Program Best Practices](/docs/toolkit/best-practices.md) + +## Contributing + You can contribute to this [Toolkit book on GitHub](https://github.com/solana-foundation/developer-content/tree/main/docs/toolkit). - -Now let's [Get Started](/docs/toolkit/getting-started.md)! diff --git a/docs/toolkit/local-validator.md b/docs/toolkit/local-validator.md index c21323f2b..fb24c9ad6 100644 --- a/docs/toolkit/local-validator.md +++ b/docs/toolkit/local-validator.md @@ -2,6 +2,16 @@ title: Running a Local Solana Validator Network sidebarSortOrder: 4 sidebarLabel: Local Validator +description: "How to run the Solana local validator for Solana local testing" +seoTitle: "How to run the Solana local validator for testing" +keywords: + - solana testing + - solana localnet + - solana local validator + - local testing + - local program testing + - solana program tests + - solana program development --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is diff --git a/docs/toolkit/projects/anchor-init.md b/docs/toolkit/projects/anchor-init.md index d14d19fba..6e9372327 100644 --- a/docs/toolkit/projects/anchor-init.md +++ b/docs/toolkit/projects/anchor-init.md @@ -1,7 +1,18 @@ --- -title: Basic Anchor Smart Contracts +title: Basic Anchor Programs sidebarSortOrder: 2 sidebarLabel: Basic Anchor +seoTitle: "How to create a Solana program with Anchor" +description: + "How to set up a new Anchor workspace for Solana program development for + beginners." +keywords: + - anchor + - anchor init + - solana anchor development + - intro to anchor + - anchor framework + - anchor workspace set up --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -14,8 +25,8 @@ anchor init ## Overview -This initializes a simplistic workspace set up for Anchor smart contract -development, with the following structure: +This initializes a simplistic workspace set up for Anchor program development, +with the following structure: - `Anchor.toml`: Anchor configuration file. - `Cargo.toml`: Rust workspace configuration file. @@ -40,8 +51,7 @@ anchor build anchor test ``` -To start writing your own Anchor smart contract, navigate to -`programs/src/lib.rs`. +To start writing your own Anchor program, navigate to `programs/src/lib.rs`. ## File Structure Template diff --git a/docs/toolkit/projects/existing-project.md b/docs/toolkit/projects/existing-project.md index 6f7ccde8d..08f87fc90 100644 --- a/docs/toolkit/projects/existing-project.md +++ b/docs/toolkit/projects/existing-project.md @@ -2,6 +2,17 @@ title: Update an Existing Project sidebarSortOrder: 7 sidebarLabel: Existing Projects +seoTitle: "How to add Solana into an existing app or project" +description: + "How to add an existing project to Solana project scaffold using the + 'create-solana-program' tool." +keywords: + - solana program development + - create solana program + - solana anchor development + - program scaffold + - anchor framework + - solana workspace set up --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is diff --git a/docs/toolkit/projects/mobile-app.md b/docs/toolkit/projects/mobile-app.md index 91eaac778..204d0f180 100644 --- a/docs/toolkit/projects/mobile-app.md +++ b/docs/toolkit/projects/mobile-app.md @@ -1,7 +1,14 @@ --- -title: Mobile App with a Smart Contract Connection +title: Mobile App with a Solana Program Connection sidebarSortOrder: 6 sidebarLabel: Mobile App +seoTitle: "How to create a Solana mobile app" +description: "How to create a mobile app on the Solana blockchain" +keywords: + - solana mobile + - mobile development + - how to create a solana mobile app + - intro to solana mobile --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is diff --git a/docs/toolkit/projects/overview.md b/docs/toolkit/projects/overview.md index 32b5b8e14..594a03057 100644 --- a/docs/toolkit/projects/overview.md +++ b/docs/toolkit/projects/overview.md @@ -1,9 +1,20 @@ --- -title: Smart Contract Project Templates +title: Program Project Templates sidebarSortOrder: 1 sidebarLabel: Overview altRoutes: - /docs/toolkit/projects +seoTitle: "How to create a new Solana program or app" +description: + "How to create a new project for Solana program development for beginners." +keywords: + - anchor + - anchor init + - solana anchor development + - create solana program + - intro to solana development + - projects on solana + - solana program development --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -12,13 +23,13 @@ altRoutes: Choose from one of the below scaffolds to generate a new project workspace: -- [Anchor](#anchor) - A popular Rust-based framework for creating Solana smart - contracts. +- [Anchor](#anchor) - A popular Rust-based framework for creating Solana + programs. - [`create-solana-program`](#create-solana-program) - In-depth workspace - generator for either Anchor smart contract development or Native smart - contract, including JavaScript and Rust clients. + generator for either Anchor program development or Native programs, including + JavaScript and Rust clients. - [Web App Templates](#web-app-template) - Generator for new projects that - connects a Solana smart contract to various frontend stacks, includes wallet + connects a Solana programs to various frontend stacks, includes wallet connector setup. ## Anchor @@ -27,8 +38,8 @@ Choose from one of the below scaffolds to generate a new project workspace: anchor init ``` -This generates a basic workspace to be able to write an Anchor rust smart -contracts, build, test, and deploy. For more information, read the +This generates a basic workspace to be able to write an Anchor rust programs, +build, test, and deploy. For more information, read the [`anchor init` doc](/docs/toolkit/projects/anchor-init.md). ## Create Solana Program @@ -37,9 +48,9 @@ contracts, build, test, and deploy. For more information, read the npx create-solana-program ``` -This generates an in-depth workspace for either Anchor smart contract -development or Native smart contract development with either a Javascript -Client, Rust Client, or both. For more information, read the +This generates an in-depth workspace for either Anchor program development or +Native program development with either a Javascript Client, Rust Client, or +both. For more information, read the [`create-solana-program` doc](/docs/toolkit/projects/solana-program.md). ## Web App Template @@ -48,8 +59,8 @@ Client, Rust Client, or both. For more information, read the npx create-solana-dapp ``` -This initializes a new project that connects a Solana smart contract to a -typescript frontend with a wallet connector. For more information, read the +This initializes a new project that connects a Solana program to a typescript +frontend with a wallet connector. For more information, read the [web app template doc](/docs/toolkit/projects/web-app.md). ## Mobile App Template @@ -73,5 +84,5 @@ You can add the Solana program scaffold to an existing project by following this ## Standard Project Layouts -For best practices on smart contract file structure, read this +For best practices on program file structure, read this [guide](/docs/toolkit/projects/project-layout.md). diff --git a/docs/toolkit/projects/project-layout.md b/docs/toolkit/projects/project-layout.md index 4c6cf631f..699eae7dc 100644 --- a/docs/toolkit/projects/project-layout.md +++ b/docs/toolkit/projects/project-layout.md @@ -1,7 +1,15 @@ --- -title: Smart Contract Repo File Structure +title: Program File Structure sidebarSortOrder: 8 sidebarLabel: Project layout +seoTitle: "How to structure a Solana program and repo" +description: + "Best practices for Solana program repo and file structure when developing + Solana programs" +keywords: + - solana program development + - program file structure + - best practices --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -21,7 +29,7 @@ workspaces will be have the following file structure: └── tests ``` -The main smart contract is the `lib.rs` file, which lives insides the `programs` +The main program is the `lib.rs` file, which lives insides the `programs` directory, as shown below: ```shell @@ -36,8 +44,8 @@ directory, as shown below: └── tests ``` -As the smart contract gets more cumbersome, you'll typically want to separate -the logic into multiple files, as shown below: +As the program gets more cumbersome, you'll typically want to separate the logic +into multiple files, as shown below: ```shell ├── programs @@ -53,9 +61,9 @@ the logic into multiple files, as shown below: ├── mod.rs ``` -For [native rust smart contract development](/docs/programs/rust/index.md), you -need to explicitly write out the entrypoint and processor for the program, so -you'll need a few more files: +For [native rust program development](/docs/programs/rust/index.md), you need to +explicitly write out the entrypoint and processor for the program, so you'll +need a few more files: ```shell ├── program.rs diff --git a/docs/toolkit/projects/solana-program.md b/docs/toolkit/projects/solana-program.md index f31290980..258725b00 100644 --- a/docs/toolkit/projects/solana-program.md +++ b/docs/toolkit/projects/solana-program.md @@ -2,6 +2,17 @@ title: Solana Program Scaffold sidebarSortOrder: 3 sidebarLabel: Solana Programs +seoTitle: "How to create a Solana program (native or Anchor)" +description: + "How to create a new Solana project scaffold for program development with the + 'create solana program' tool." +keywords: + - solana development + - create solana program + - intro to solana development + - projects on solana + - solana program development + - create a solana project --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -9,13 +20,13 @@ sidebarLabel: Solana Programs > [here](https://github.com/solana-foundation/developer-content/issues/new?title=%5Btoolkit%5D%20). ```shell -npx create-solana-program +pnpm create solana-program ``` [`create-solana-program`](https://github.com/solana-program/create-solana-program) initializes an in-depth workspace with everything you need for general Solana -smart contract development. This scaffold allows you to write either native rust -smart contracts or Anchor smart contracts. +program development. This scaffold allows you to write either native rust +programs or Anchor programs. ## Program Frameworks @@ -77,7 +88,7 @@ Client, or both. [web3.js](https://solana-labs.github.io/solana-web3.js/). - **Rust Client** creates a rust crate allowing consumers to interact with the - smart contract. + program. For further workspace customization and additional information, check out the `create-solana-program` diff --git a/docs/toolkit/projects/web-app.md b/docs/toolkit/projects/web-app.md index 8a3f5e521..5cf6a6b81 100644 --- a/docs/toolkit/projects/web-app.md +++ b/docs/toolkit/projects/web-app.md @@ -1,7 +1,18 @@ --- -title: Web App with a Smart Contract Connection +title: Web App with a Program Connection sidebarSortOrder: 5 sidebarLabel: Web App +seoTitle: "How to create a Solana web app" +description: + "How to create a web app for Solana program development with the 'create + solana dapp' tool" +keywords: + - solana web app development + - create solana dapp + - intro to solana development + - projects on solana + - solana program development + - create a solana project --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -12,7 +23,7 @@ sidebarLabel: Web App npx create-solana-dapp ``` -This command generates a new project that connects a Solana smart contract to a +This command generates a new project that connects a Solana program to a frontend with a wallet connector. It has options for multiple popular frontend stacks and UI libraries, including: NextJS, React, Tailwind, and more. diff --git a/docs/toolkit/test-suite/basics.md b/docs/toolkit/test-suite/basics.md index fab6522ab..45bcb515e 100644 --- a/docs/toolkit/test-suite/basics.md +++ b/docs/toolkit/test-suite/basics.md @@ -2,6 +2,13 @@ sidebarLabel: Testing Basics title: Solana Testing Basics sidebarSortOrder: 2 +seoTitle: "How to test Solana programs" +description: "How to run tests for Solana program development" +keywords: + - solana development + - solana testing + - test basics + - how to test programs --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is diff --git a/docs/toolkit/test-suite/code-coverage.md b/docs/toolkit/test-suite/code-coverage.md index c02e70a4c..e433615c4 100644 --- a/docs/toolkit/test-suite/code-coverage.md +++ b/docs/toolkit/test-suite/code-coverage.md @@ -2,6 +2,14 @@ title: Solana Code Coverage Tool sidebarSortOrder: 3 sidebarLabel: Code Coverage +seoTitle: "How to run code coverage for Solana programs" +description: "How to check the code coverage for Solana programs when testing" +keywords: + - solana testing + - solana code coverage + - code coverage tool + - testing with code coverage + - how to check code coverage --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is diff --git a/docs/toolkit/test-suite/fuzz-tester.md b/docs/toolkit/test-suite/fuzz-tester.md index 20eeba331..a52595b2e 100644 --- a/docs/toolkit/test-suite/fuzz-tester.md +++ b/docs/toolkit/test-suite/fuzz-tester.md @@ -2,6 +2,12 @@ title: Solana Fuzz Tester sidebarSortOrder: 4 sidebarLabel: Fuzz Tester +seoTitle: "How to fuzz test for Solana programs" +description: "How to create fuzz tests for Solana programs in Rust" +keywords: + - solana fuzz testing + - solana fuzzer + - fuzz tests --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is diff --git a/docs/toolkit/test-suite/js-test.md b/docs/toolkit/test-suite/js-test.md index ea341d0ff..f74a10e89 100644 --- a/docs/toolkit/test-suite/js-test.md +++ b/docs/toolkit/test-suite/js-test.md @@ -2,6 +2,17 @@ title: JavaScript Testing Framework for Solana sidebarSortOrder: 6 sidebarLabel: JavaScript Tests +seoTitle: "How to test Solana Programs with JavaScript/TypeScript" +description: + "How to write fast tests for Solana programs in JavaScript and NodeJS using + Solana bankrun" +keywords: + - solana javascript tests + - solana testing + - solana bankrun + - bankrun tests + - bankrun examples + - solana test examples --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -10,7 +21,7 @@ sidebarLabel: JavaScript Tests ## Add Dependency -Navigate to your smart contract directory and run: +Navigate to your program directory and run: ```shell npm install solana-bankrun diff --git a/docs/toolkit/test-suite/rust-tests.md b/docs/toolkit/test-suite/rust-tests.md index 670ac63a6..f76267750 100644 --- a/docs/toolkit/test-suite/rust-tests.md +++ b/docs/toolkit/test-suite/rust-tests.md @@ -2,6 +2,16 @@ title: Rust Testing Framework for Solana sidebarSortOrder: 7 sidebarLabel: Rust Tests +seoTitle: "How to test Solana Programs with Rust" +description: "How to write tests for Solana programs in Rust with litesvm" +keywords: + - solana rust tests + - solana litesvm + - litesvm tests + - rust testing + - litesvm + - litesvm examples + - solana test examples --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -10,7 +20,7 @@ sidebarLabel: Rust Tests ## Add Dependency -Navigate to your smart contract directory and run: +Navigate to your program directory and run: ```shell cargo add --dev litesvm diff --git a/docs/toolkit/test-suite/security-scanner.md b/docs/toolkit/test-suite/security-scanner.md index dce86340e..7ee36f897 100644 --- a/docs/toolkit/test-suite/security-scanner.md +++ b/docs/toolkit/test-suite/security-scanner.md @@ -2,6 +2,16 @@ title: Security Vulnerability Scanner sidebarSortOrder: 5 sidebarLabel: Security Scanner +seoTitle: "How to check for security vulnerabilities in Solana programs" +description: "How to check for security vulnerabilities in Solana programs" +keywords: + - solana security + - solana programs + - program development + - program security + - security vulnerabilities + - solana vulnerabilities + - solana security best practices --- > This is a beta version of the [Solana Toolkit](/docs/toolkit/index.md), and is @@ -12,13 +22,13 @@ sidebarLabel: Security Scanner [Radar](https://github.com/Auditware/radar?tab=readme-ov-file) is static analysis tool for Anchor rust programs. It allows you to write, share, and -utilize templates to identify security issues in rust-based smart contracts -using a powerful python based rule engine that enables automating detection of +utilize templates to identify security issues in rust-based programs using a +powerful python based rule engine that enables automating detection of vulnerable code patterns through logical expressions. [Xray](https://github.com/sec3-product/x-ray) is an open-source, cross-platform command-line interface (CLI) tool designed for static analysis of Solana -programs and smart contracts written in Rust. +programs and programs written in Rust. ## Common Security Exploits and Protections diff --git a/docs/toolkit/troubleshooting.md b/docs/toolkit/troubleshooting.md index d1b781c04..613fa0bbe 100644 --- a/docs/toolkit/troubleshooting.md +++ b/docs/toolkit/troubleshooting.md @@ -2,6 +2,16 @@ title: Troubleshooting Solana Programs sidebarSortOrder: 6 sidebarLabel: Troubleshooting +description: "How to troubleshoot Solana programs" +seoTitle: "How to troubleshoot Solana programs" +keywords: + - solana testing + - solana troubleshooting + - solana programs + - solana program development + - solana toolkit + - smart contract development + - program development --- When diagnosing problems with Solana development, you can easily gather loads of