Skip to content

Commit c5b1b75

Browse files
committed
Reorder to Anchor, Pinocchio, Native throughout
1 parent 12ba7b9 commit c5b1b75

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Program Examples
22

3-
## Onchain program examples for ⚓ Anchor, 🦀 Native Rust, and 🤥 Pinocchio.
3+
## Onchain program examples for ⚓ Anchor, 🤥 Pinocchio, and 🦀 Native Rust.
44

5-
[![Anchor](https://github.com/solana-developers/program-examples/actions/workflows/anchor.yml/badge.svg?event=schedule)](https://github.com/solana-developers/program-examples/actions/workflows/anchor.yml) [![Native](https://github.com/solana-developers/program-examples/actions/workflows/solana-native.yml/badge.svg?event=schedule)](https://github.com/solana-developers/program-examples/actions/workflows/solana-native.yml) [![Pinocchio](https://github.com/solana-developers/program-examples/actions/workflows/solana-pinocchio.yml/badge.svg?event=schedule)](https://github.com/solana-developers/program-examples/actions/workflows/solana-pinocchio.yml)
5+
[![Anchor](https://github.com/solana-developers/program-examples/actions/workflows/anchor.yml/badge.svg?event=schedule)](https://github.com/solana-developers/program-examples/actions/workflows/anchor.yml) [![Pinocchio](https://github.com/solana-developers/program-examples/actions/workflows/solana-pinocchio.yml/badge.svg?event=schedule)](https://github.com/solana-developers/program-examples/actions/workflows/solana-pinocchio.yml) [![Native](https://github.com/solana-developers/program-examples/actions/workflows/solana-native.yml/badge.svg?event=schedule)](https://github.com/solana-developers/program-examples/actions/workflows/solana-native.yml)
66

77
This repo contains Solana onchain programs (referred to as 'Smart Contracts' in other blockchains).
88

@@ -12,21 +12,20 @@ This repo contains Solana onchain programs (referred to as 'Smart Contracts' in
1212
> ⚠️ This repository uses **pnpm** as the default package manager.
1313
> Ensure pnpm is installed before running any examples.
1414
15-
1615
Each folder includes examples for one or more of the following:
1716

1817
- `anchor` - Written using [Anchor](https://www.anchor-lang.com/), the most popular framework for Solana development, which uses Rust.
1918
Use `anchor build` and `anchor deploy` to build and deploy the program.
2019
Tests should be executed using `pnpm test` as defined in the `Anchor.toml` scripts section.
2120

22-
- `native` - Written using Solana's native Rust crates and vanilla Rust.
23-
Build and test commands are defined via pnpm scripts and use `litesvm` for testing.
24-
Run `pnpm test` to execute tests.
25-
2621
- `pinocchio` - Written using [Pinocchio](https://github.com/febo/pinocchio), a zero-copy, zero-allocation library for Solana programs.
2722
Build and test commands are the same as native examples.
2823
Run `pnpm test` to execute tests.
2924

25+
- `native` - Written using Solana's native Rust crates and vanilla Rust.
26+
Build and test commands are defined via pnpm scripts and use `litesvm` for testing.
27+
Run `pnpm test` to execute tests.
28+
3029

3130
**If a given example is missing, please send us a PR to add it!** Our aim is to have every example available in every option. We'd also love to see more programs involving staking, wrapped tokens, oracles, compression and VRF. Follow the [contributing guidelines](./CONTRIBUTING.md) to keep things consistent.
3231

@@ -36,43 +35,43 @@ Each folder includes examples for one or more of the following:
3635

3736
[Hello World on Solana! A minimal program that logs a greeting.](./basics/hello-solana/README.md)
3837

39-
[anchor](./basics/hello-solana/anchor) [native](./basics/hello-solana/native) [pinocchio](./basics/hello-solana/pinocchio)
38+
[anchor](./basics/hello-solana/anchor) [pinocchio](./basics/hello-solana/pinocchio) [native](./basics/hello-solana/native)
4039

4140
### Account-data
4241

4342
Store and retrieve data using Solana accounts.
4443

45-
[anchor](./basics/account-data/anchor) [native](./basics/account-data/native) [pinocchio](./basics/account-data/pinocchio)
44+
[anchor](./basics/account-data/anchor) [pinocchio](./basics/account-data/pinocchio) [native](./basics/account-data/native)
4645

4746
### Storing global state - Counter
4847

4948
[Use a PDA to store global state, making a counter that increments when called.](./basics/counter/README.md)
5049

51-
[anchor](./basics/counter/anchor) [native](./basics/counter/native) [pinocchio](./basics/counter/pinocchio)
50+
[anchor](./basics/counter/anchor) [pinocchio](./basics/counter/pinocchio) [native](./basics/counter/native)
5251

5352
### Saving per-user state - Favorites
5453

5554
Save and update per-user state on the blockchain, ensuring users can only update their own information.
5655

57-
[anchor](./basics/favorites/anchor) [native](./basics/favorites/native) [pinocchio](./basics/favorites/pinocchio)
56+
[anchor](./basics/favorites/anchor) [pinocchio](./basics/favorites/pinocchio) [native](./basics/favorites/native)
5857

5958
### Checking Instruction Accounts
6059

6160
[Check that the accounts provided in incoming instructions meet particular criteria.](./basics/checking-accounts/README.md)
6261

63-
[anchor](./basics/checking-accounts/anchor) [native](./basics/checking-accounts/native) [pinocchio](./basics/checking-accounts/pinocchio)
62+
[anchor](./basics/checking-accounts/anchor) [pinocchio](./basics/checking-accounts/pinocchio) [native](./basics/checking-accounts/native)
6463

6564
### Closing Accounts
6665

6766
Close an account and get the Lamports back.
6867

69-
[anchor](./basics/close-account/anchor) [native](./basics/close-account/native) [pinocchio](./basics/close-account/pinocchio)
68+
[anchor](./basics/close-account/anchor) [pinocchio](./basics/close-account/pinocchio) [native](./basics/close-account/native)
7069

7170
### Creating Accounts
7271

7372
[Make new accounts on the blockchain.](./basics/create-account/README.md)
7473

75-
[anchor](./basics/create-account/anchor) [native](./basics/create-account/native) [pinocchio](./basics/create-account/pinocchio)
74+
[anchor](./basics/create-account/anchor) [pinocchio](./basics/create-account/pinocchio) [native](./basics/create-account/native)
7675

7776
### Cross program invocations
7877

@@ -84,31 +83,31 @@ Close an account and get the Lamports back.
8483

8584
[Use a PDA to pay the rent for the creation of a new account.](./basics/pda-rent-payer/README.md)
8685

87-
[anchor](./basics/pda-rent-payer/anchor) [native](./basics/pda-rent-payer/native) [pinocchio](./basics/pda-rent-payer/pinocchio)
86+
[anchor](./basics/pda-rent-payer/anchor) [pinocchio](./basics/pda-rent-payer/pinocchio) [native](./basics/pda-rent-payer/native)
8887

8988
### Processing instructions
9089

9190
[Add parameters to an instruction handler and use them.](./basics/processing-instructions/README.md)
9291

93-
[anchor](./basics/processing-instructions/anchor) [native](./basics/processing-instructions/native) [pinocchio](./basics/processing-instructions/pinocchio)
92+
[anchor](./basics/processing-instructions/anchor) [pinocchio](./basics/processing-instructions/pinocchio) [native](./basics/processing-instructions/native)
9493

9594
### Storing date in program derived addresses
9695

9796
Store and retrieve state in Solana.
9897

99-
[anchor](./basics/program-derived-addresses/anchor) [native](./basics/program-derived-addresses/native) [pinocchio](./basics/program-derived-addresses/pinocchio)
98+
[anchor](./basics/program-derived-addresses/anchor) [pinocchio](./basics/program-derived-addresses/pinocchio) [native](./basics/program-derived-addresses/native)
10099

101100
### Handling accounts that expand in size
102101

103102
How to store state that changes size in Solana.
104103

105-
[anchor](./basics/realloc/anchor) [native](./basics/realloc/native) [pinocchio](./basics/realloc/pinocchio)
104+
[anchor](./basics/realloc/anchor) [pinocchio](./basics/realloc/pinocchio) [native](./basics/realloc/native)
106105

107106
### Calculating account size to determine rent
108107

109108
[Determine the necessary minimum rent by calculating an account's size.](./basics/rent/README.md)
110109

111-
[anchor](./basics/rent/anchor) [native](./basics/rent/native) [pinocchio](./basics/rent/pinocchio)
110+
[anchor](./basics/rent/anchor) [pinocchio](./basics/rent/pinocchio) [native](./basics/rent/native)
112111

113112
### Laying out larger programs
114113

@@ -120,7 +119,7 @@ How to store state that changes size in Solana.
120119

121120
[Send SOL between two accounts.](./basics/transfer-sol/README.md)
122121

123-
[anchor](./basics/transfer-sol/anchor) [native](./basics/transfer-sol/native) [pinocchio](./basics/transfer-sol/pinocchio)
122+
[anchor](./basics/transfer-sol/anchor) [pinocchio](./basics/transfer-sol/pinocchio) [native](./basics/transfer-sol/native)
124123
## Tokens
125124
### Creating tokens
126125

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "program-examples",
33
"version": "1.0.0",
4-
"description": "Solana program (smart contract) examples for Anchor, Native Rust, and Pinocchio.",
4+
"description": "Solana program (smart contract) examples for Anchor, Pinocchio, and Native Rust.",
55
"scripts": {
66
"sync-package-json": "ts-node scripts/sync-package-json.ts",
77
"format:fix": "pnpx @biomejs/biome format --write ./",

0 commit comments

Comments
 (0)