Skip to content

Commit

Permalink
Toolkit updates (#691)
Browse files Browse the repository at this point in the history
* toolkit updates and SEO optimization

* prettier:fix

* refactor: wording

* refactor: seo title

* fix: nested quotes

---------

Co-authored-by: nickfrosty <75431177+nickfrosty@users.noreply.github.com>
  • Loading branch information
brimigs and nickfrosty authored Jan 14, 2025
1 parent eeb8f55 commit 3597f3d
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 41 deletions.
14 changes: 13 additions & 1 deletion docs/toolkit/best-practices.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 10 additions & 0 deletions docs/toolkit/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
53 changes: 51 additions & 2 deletions docs/toolkit/index.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)!
10 changes: 10 additions & 0 deletions docs/toolkit/local-validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 15 additions & 5 deletions docs/toolkit/projects/anchor-init.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,8 +25,8 @@ anchor init <project_name>

## 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.
Expand All @@ -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

Expand Down
11 changes: 11 additions & 0 deletions docs/toolkit/projects/existing-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion docs/toolkit/projects/mobile-app.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
39 changes: 25 additions & 14 deletions docs/toolkit/projects/overview.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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).
22 changes: 15 additions & 7 deletions docs/toolkit/projects/project-layout.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
19 changes: 15 additions & 4 deletions docs/toolkit/projects/solana-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,31 @@
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
> still a WIP. Please post all feedback as a GitHub issue
> [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

Expand Down Expand Up @@ -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`
Expand Down
Loading

0 comments on commit 3597f3d

Please sign in to comment.