Skip to content

Commit e95add4

Browse files
authored
Merge pull request #30 from mikemaccana-edwardbot/chore/readmes-link-solana-terminology
docs: link canonical Solana terms to terminology page on first mention
2 parents 34b9660 + 086d812 commit e95add4

40 files changed

Lines changed: 123 additions & 123 deletions

File tree

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Quicknode Solana Program Examples
22

3-
> A fork of the [Solana Foundation program examples](https://github.com/solana-developers/program-examples) with current versions, more programs, and additional frameworks.
3+
> A fork of the [Solana Foundation program examples](https://github.com/solana-developers/program-examples) with current versions, more [programs](https://solana.com/docs/terminology#program), and additional frameworks.
44
55
[![Anchor](../../actions/workflows/anchor.yml/badge.svg)](../../actions/workflows/anchor.yml) [![Quasar](../../actions/workflows/quasar.yml/badge.svg)](../../actions/workflows/quasar.yml) [![Pinocchio](../../actions/workflows/pinocchio.yml/badge.svg)](../../actions/workflows/pinocchio.yml) [![Native](../../actions/workflows/native.yml/badge.svg)](../../actions/workflows/native.yml) [![ASM](../../actions/workflows/solana-asm.yml/badge.svg)](../../actions/workflows/solana-asm.yml)
66

@@ -13,7 +13,7 @@ Each example is available in one or more of the following frameworks:
1313
- [🧬 ASM](https://github.com/blueshift-gg/sbpf) — hand-written sBPF assembly built with the `sbpf` toolchain. Run `pnpm build-and-test` to build and test.
1414

1515
> [!NOTE]
16-
> You don't need to write your own program for basic tasks like creating accounts, transferring SOL, or minting tokens. These are handled by existing programs like the System Program and Token Program.
16+
> You don't need to write your own program for basic tasks like creating [accounts](https://solana.com/docs/terminology#account), transferring SOL, or minting tokens. These are handled by existing programs like the System Program and Token Program.
1717
1818
## Financial Software
1919

@@ -37,7 +37,7 @@ Create a fundraiser specifying a target mint and amount. Contributors deposit to
3737

3838
### Pyth Price Feeds
3939

40-
Read offchain price data onchain using the Pyth oracle network.
40+
Read offchain price data [onchain](https://solana.com/docs/terminology#onchain) using the Pyth oracle network.
4141

4242
[⚓ Anchor](./oracles/pyth/anchor) [💫 Quasar](./oracles/pyth/quasar)
4343

@@ -57,7 +57,7 @@ Store and retrieve data using Solana accounts.
5757

5858
### Counter
5959

60-
Use a PDA to store global state — a counter that increments when called.
60+
Use a [PDA](https://solana.com/docs/terminology#program-derived-address-pda) to store global state — a counter that increments when called.
6161

6262
[⚓ Anchor](./basics/counter/anchor) [💫 Quasar](./basics/counter/quasar) [🤥 Pinocchio](./basics/counter/pinocchio) [🦀 Native](./basics/counter/native)
6363

@@ -69,13 +69,13 @@ Save and update per-user state, ensuring users can only modify their own data.
6969

7070
### Checking Accounts
7171

72-
Validate that accounts provided in incoming instructions meet specific criteria.
72+
Validate that accounts provided in incoming [instructions](https://solana.com/docs/terminology#instruction) meet specific criteria.
7373

7474
[⚓ Anchor](./basics/checking-accounts/anchor) [💫 Quasar](./basics/checking-accounts/quasar) [🤥 Pinocchio](./basics/checking-accounts/pinocchio) [🦀 Native](./basics/checking-accounts/native) [🧬 ASM](./basics/checking-accounts/asm)
7575

7676
### Close Account
7777

78-
Close an account and reclaim its lamports.
78+
Close an account and reclaim its [lamports](https://solana.com/docs/terminology#lamport).
7979

8080
[⚓ Anchor](./basics/close-account/anchor) [💫 Quasar](./basics/close-account/quasar) [🤥 Pinocchio](./basics/close-account/pinocchio) [🦀 Native](./basics/close-account/native)
8181

@@ -93,13 +93,13 @@ Call one program from another — the hand program invokes the lever program to
9393

9494
### PDA Rent Payer
9595

96-
Use a PDA to pay rent for creating a new account.
96+
Use a PDA to pay [rent](https://solana.com/docs/terminology#rent) for creating a new account.
9797

9898
[⚓ Anchor](./basics/pda-rent-payer/anchor) [💫 Quasar](./basics/pda-rent-payer/quasar) [🤥 Pinocchio](./basics/pda-rent-payer/pinocchio) [🦀 Native](./basics/pda-rent-payer/native)
9999

100100
### Processing Instructions
101101

102-
Add parameters to an instruction handler and use them.
102+
Add parameters to an [instruction handler](https://solana.com/docs/terminology#instruction-handler) and use them.
103103

104104
[⚓ Anchor](./basics/processing-instructions/anchor) [💫 Quasar](./basics/processing-instructions/quasar) [🤥 Pinocchio](./basics/processing-instructions/pinocchio) [🦀 Native](./basics/processing-instructions/native)
105105

@@ -155,7 +155,7 @@ Create an NFT collection, mint NFTs, and verify NFTs as part of a collection usi
155155

156156
### Token Minter
157157

158-
Mint tokens from inside your own program using the Classic Token Program.
158+
Mint tokens from inside your own program using the [Classic Token Program](https://solana.com/docs/terminology#token-program).
159159

160160
[⚓ Anchor](./tokens/token-minter/anchor) [💫 Quasar](./tokens/token-minter/quasar) [🦀 Native](./tokens/token-minter/native)
161161

@@ -181,19 +181,19 @@ Control token transfers using an external secp256k1 delegate signature.
181181

182182
### Basics
183183

184-
Create token mints, mint tokens, and transfer tokens using Token Extensions.
184+
Create token mints, mint tokens, and transfer tokens using [Token Extensions](https://solana.com/docs/terminology#token-extensions-program).
185185

186186
[⚓ Anchor](./tokens/token-extensions/basics/anchor) [💫 Quasar](./tokens/token-extensions/basics/quasar)
187187

188188
### CPI Guard
189189

190-
Prevent certain token actions from occurring within cross-program invocations.
190+
Prevent certain token actions from occurring within [cross-program invocations](https://solana.com/docs/terminology#cross-program-invocation-cpi).
191191

192192
[⚓ Anchor](./tokens/token-extensions/cpi-guard/anchor) [💫 Quasar](./tokens/token-extensions/cpi-guard/quasar)
193193

194194
### Default Account State
195195

196-
Create new token accounts that are frozen by default.
196+
Create new [token accounts](https://solana.com/docs/terminology#token-account) that are frozen by default.
197197

198198
[⚓ Anchor](./tokens/token-extensions/default-account-state/anchor) [💫 Quasar](./tokens/token-extensions/default-account-state/quasar) [🦀 Native](./tokens/token-extensions/default-account-state/native)
199199

@@ -223,7 +223,7 @@ Require all transfers to include a descriptive memo.
223223

224224
### Onchain Metadata
225225

226-
Store metadata directly inside the token mint account, without needing additional programs.
226+
Store metadata directly inside the token [mint account](https://solana.com/docs/terminology#token-mint), without needing additional programs.
227227

228228
[⚓ Anchor](./tokens/token-extensions/metadata/anchor)
229229

basics/checking-accounts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Checking Accounts
22

3-
Solana programs should check the instructions they receive to ensure security and to make sure required invariants hold.
3+
Solana [programs](https://solana.com/docs/terminology#program) should check the [instructions](https://solana.com/docs/terminology#instruction) they receive to ensure security and to make sure required invariants hold.
44

55
The exact checks depend on what the program does. Common ones include:
66

77
- Verifying that the `program_id` on the instruction matches your own program.
8-
- Verifying the order and number of accounts.
8+
- Verifying the order and number of [accounts](https://solana.com/docs/terminology#account).
99
- Checking the initialization state of an account.

basics/close-account/anchor/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Close Account
22

3-
Two instruction handlers: `create_user` initializes a PDA `UserState` account, and `close_user` closes it and returns the rent to the user.
3+
Two [instruction handlers](https://solana.com/docs/terminology#instruction-handler): `create_user` initializes a [PDA](https://solana.com/docs/terminology#program-derived-address-pda) `UserState` [account](https://solana.com/docs/terminology#account), and `close_user` closes it and returns the [rent](https://solana.com/docs/terminology#rent) to the user.
44

5-
1. `create_user` initializes the PDA with Anchor's `init` constraint:
5+
1. `create_user` initializes the PDA with [Anchor](https://solana.com/docs/terminology#anchor)'s `init` constraint:
66

77
```rust
88
#[account(
@@ -17,7 +17,7 @@ Two instruction handlers: `create_user` initializes a PDA `UserState` account, a
1717

1818
See [`programs/close-account/src/instructions/create_user.rs`](programs/close-account/src/instructions/create_user.rs).
1919

20-
2. `close_user` closes the account using Anchor's `close` constraint, which returns lamports to the given account:
20+
2. `close_user` closes the account using Anchor's `close` constraint, which returns [lamports](https://solana.com/docs/terminology#lamport) to the given account:
2121

2222
```rust
2323
#[account(
@@ -33,7 +33,7 @@ Two instruction handlers: `create_user` initializes a PDA `UserState` account, a
3333

3434
## Tests
3535

36-
Tests live in [`programs/close-account/tests/test_close_account.rs`](programs/close-account/tests/test_close_account.rs) and run against litesvm. `Anchor.toml`'s `scripts.test` is `cargo test`, so `anchor test` builds the program and runs the Rust tests:
36+
Tests live in [`programs/close-account/tests/test_close_account.rs`](programs/close-account/tests/test_close_account.rs) and run against litesvm. `Anchor.toml`'s `scripts.test` is `cargo test`, so `anchor test` builds the [program](https://solana.com/docs/terminology#program) and runs the Rust tests:
3737

3838
```bash
3939
anchor test

basics/counter/anchor/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Anchor Counter
22

3-
Anchor enforces `init` constraints that nudge you towards good programming patterns.
3+
[Anchor](https://solana.com/docs/terminology#anchor) enforces `init` constraints that nudge you towards good programming patterns.
44

5-
This program has an additional initialization handler for `Counter`s that the Solana native equivalent does not.
5+
This [program](https://solana.com/docs/terminology#program) has an additional initialization handler for `Counter`s that the Solana native equivalent does not.

basics/counter/mpl-stack/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A Solana-native counter built using the MPL (Metaplex) stack.
44

55
## Setup
66

7-
1. Build the program: `cargo build-sbf`
7+
1. Build the [program](https://solana.com/docs/terminology#program): `cargo build-sbf`
88
2. Build the IDL: `shank build`
99
3. Build the TypeScript SDK: `pnpm solita`
1010
- Temporary workaround: edit `ts/generated/accounts/Counter.ts` line 58 to

basics/counter/native/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Counter written in Solana native, using only the Solana toolchain.
44

55
## Setup
66

7-
1. Build the program: `cargo build-sbf`
7+
1. Build the [program](https://solana.com/docs/terminology#program): `cargo build-sbf`
88
2. Run the tests: `pnpm test`
99

1010
## Debugging

basics/counter/pinocchio/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Counter written using the Pinocchio framework, with only the Solana toolchain.
44

55
## Setup
66

7-
1. Build the program: `cargo build-sbf`
7+
1. Build the [program](https://solana.com/docs/terminology#program): `cargo build-sbf`
88
2. Run the tests: `pnpm test`
99

1010
## Debugging

basics/create-account/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Create Account
22

3-
Create a Solana account.
3+
Create a Solana [account](https://solana.com/docs/terminology#account).
44

55
The account is a **system account** — owned by the System Program, which means only the System Program can modify its data. In this example, the account simply holds some SOL.
66

77
The tests cover two ways to create the account:
88

9-
1. **Via cross-program invocation (CPI):** the client sends a transaction to our deployed program, which in turn calls the System Program.
9+
1. **Via [cross-program invocation](https://solana.com/docs/terminology#cross-program-invocation-cpi) (CPI):** the client sends a transaction to our deployed [program](https://solana.com/docs/terminology#program), which in turn calls the System Program.
1010
2. **Directly:** the client sends the create-account transaction straight to the System Program.
1111

1212
See [cross-program-invocation](../cross-program-invocation) for more CPI examples.

basics/cross-program-invocation/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Cross-Program Invocation (CPI)
22

3-
A cross-program invocation is calling one program from another. You use CPIs when your program needs to compose with other onchain programs to do its work.
3+
A [cross-program invocation](https://solana.com/docs/terminology#cross-program-invocation-cpi) is calling one [program](https://solana.com/docs/terminology#program) from another. You use CPIs when your program needs to compose with other [onchain](https://solana.com/docs/terminology#onchain) programs to do its work.
44

55
Whether a given operation should be done via a CPI or via separate RPC calls from the client is a design choice. The main reason to use a CPI is a **dependent operation** that must happen atomically with the rest of your logic.
66

7-
Consider this sequence in a token mint program:
7+
Consider this sequence in a token [mint](https://solana.com/docs/terminology#token-mint) program:
88

99
1. Create and initialize the mint.
10-
2. Create a metadata account for the mint.
11-
3. Create and initialize a user's token account for the mint.
10+
2. Create a metadata [account](https://solana.com/docs/terminology#account) for the mint.
11+
3. Create and initialize a user's [token account](https://solana.com/docs/terminology#token-account) for the mint.
1212
4. Mint some tokens to the user's token account.
1313

1414
You cannot create a metadata account without first having the mint. Once you decide that steps 1 and 4 must be onchain, the only sensible option is to also do steps 2 and 3 onchain — you cannot pause a program mid-flight to let the client do work.
@@ -56,4 +56,4 @@ See the [Features chapter of the Cargo Book](https://doc.rust-lang.org/cargo/ref
5656

5757
<img src="istockphoto-1303616086-612x612.jpeg" alt="lever" width="128" align="center"/>
5858

59-
The `hand` program's `pull_lever` instruction handler does a CPI into the `lever` program's `switch_power` instruction handler. Pull the lever, switch the power.
59+
The `hand` program's `pull_lever` [instruction handler](https://solana.com/docs/terminology#instruction-handler) does a CPI into the `lever` program's `switch_power` instruction handler. Pull the lever, switch the power.

basics/cross-program-invocation/quasar/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Cross-Program Invocation — Quasar
22

3-
This example contains **two separate Quasar programs** that work together:
3+
This example contains **two separate Quasar [programs](https://solana.com/docs/terminology#program)** that work together:
44

5-
- **`lever/`** — A program with onchain `PowerStatus` state and a `switch_power` instruction handler that toggles a boolean.
6-
- **`hand/`** — A program that calls the lever program's `switch_power` via CPI.
5+
- **`lever/`** — A program with [onchain](https://solana.com/docs/terminology#onchain) `PowerStatus` state and a `switch_power` [instruction handler](https://solana.com/docs/terminology#instruction-handler) that toggles a boolean.
6+
- **`hand/`** — A program that calls the lever program's `switch_power` via [CPI](https://solana.com/docs/terminology#cross-program-invocation-cpi).
77

88
## Building
99

@@ -27,10 +27,10 @@ The hand tests load **both** programs into `QuasarSvm` and verify that the CPI c
2727

2828
## CPI pattern
2929

30-
Quasar doesn't have a `declare_program!` equivalent for importing arbitrary program instruction types (unlike Anchor). Instead, the hand program:
30+
Quasar doesn't have a `declare_program!` equivalent for importing arbitrary program [instruction](https://solana.com/docs/terminology#instruction) types (unlike [Anchor](https://solana.com/docs/terminology#anchor)). Instead, the hand program:
3131

3232
1. Defines a **marker type** (`LeverProgram`) that implements the `Id` trait with the lever's program address.
33-
2. Uses `Program<LeverProgram>` in the accounts struct for compile-time address and executable validation.
33+
2. Uses `Program<LeverProgram>` in the [accounts](https://solana.com/docs/terminology#account) struct for compile-time address and executable validation.
3434
3. Builds the CPI instruction data **manually** using `BufCpiCall`, constructing the lever's wire format directly.
3535

3636
This is lower-level than Anchor's CPI pattern but gives full control and works with any program.

0 commit comments

Comments
 (0)