You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/ccip/tutorials/svm/cross-chain-tokens/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ metadata:
7
7
description: "Master cross-chain SPL token, Token-2022 development on Solana with Chainlink CCIP. Step-by-step tutorials from basic setup to production-ready multisig governance."
Copy file name to clipboardExpand all lines: src/features/ccip/SvmCrossChainTokenPrerequisites.mdx
+87-47Lines changed: 87 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,101 +2,141 @@ import { Aside } from "@components"
2
2
3
3
## Prerequisites
4
4
5
-
This tutorial requires setting up two different repositories in separate terminal windows. Follow the setup instructions for both environments before proceeding.
5
+
This tutorial uses a **two-terminal workflow** across two repositories. Install the system tools below, clone both repos, then complete environment setup before starting Phase 1.
6
6
7
-
### Development Environment Requirements
7
+
### System Requirements
8
8
9
-
**System Requirements:**
10
-
11
-
-**Anchor and Solana CLI Tools**: Install following the [installation guide](https://www.anchor-lang.com/docs/installation). Requires Rust to be installed.
12
-
-**Node.js v20 or higher**: Use the [nvm package](https://www.npmjs.com/package/nvm) to install and manage versions. Verify with `node -v`
13
-
-**Yarn**: For dependency management
9
+
-**Node.js v22 or higher**: Verify with `node -v` ([nvm](https://www.npmjs.com/package/nvm) recommended)
10
+
-**pnpm**: Required for the BS58 generator (`npm install -g pnpm`)
First, check whether your environment is already set up:
44
45
45
46
```bash
46
-
# Get your wallet address
47
+
solana config get
47
48
solana address
48
-
49
-
# Request SOL from the devnet faucet
50
-
solana airdrop 2
49
+
solana balance
51
50
```
52
51
53
-
**Verify your setup:**
52
+
If the RPC URL is already `https://api.devnet.solana.com`, your keypair path is correct, and you have sufficient SOL, skip to [Terminal 2 setup](#terminal-2-smart-contract-examples-hardhat) below.
53
+
54
+
Otherwise, run only the steps you need:
54
55
55
56
```bash
56
-
#Check your SOL balance
57
-
solana balance
57
+
#Set devnet (skip if config get already shows devnet)
58
+
solana config set --url https://api.devnet.solana.com
58
59
59
-
# Verify you are on devnet
60
-
solana config get
60
+
# Point to your keypair (skip if config get already shows the path you want)
61
+
solana config set --keypair ~/.config/solana/id.json
62
+
63
+
# Create a keypair only if the file does not exist yet
64
+
solana-keygen new --outfile ~/.config/solana/id.json
65
+
66
+
# Fund your wallet if balance is low
67
+
solana airdrop 2
68
+
solana balance
61
69
```
62
70
63
-
### Terminal 2: Smart Contract Examples Setup
71
+
<Asidetype="note"title="Direct Execution">
72
+
Append `--execute` to **mutating**`pnpm bs58` commands in Terminal 1 so your local wallet signs and sends
73
+
transactions. **Read-only** commands (`get-state`, `get-chain-config`, `derive-accounts`) omit `--execute`. See the
74
+
[CCIP Solana BS58 Generator
75
+
README](https://github.com/smartcontractkit/ccip-solana-bs58-generator/blob/main/README.md) for command syntax.
76
+
</Aside>
77
+
78
+
### Terminal 2: Smart Contract Examples (Hardhat)
64
79
65
-
**Clone the repository and navigate to the Hardhat project:**
80
+
**Clone, install, and compile** (skip `git clone` if you already have the repo):
# Verify existing variables (skip npx env-enc set if all required vars are already configured)
96
+
npx env-enc view
97
+
98
+
# Add or update variables only if missing
86
99
npx env-enc set
87
100
```
88
101
89
-
**Required environment variables for Ethereum Sepolia:**
102
+
**Required variables for Ethereum Sepolia:**
90
103
91
104
-`ETHEREUM_SEPOLIA_RPC_URL`: RPC endpoint from [Alchemy](https://www.alchemy.com/) or [Infura](https://www.infura.io/)
92
105
-`PRIVATE_KEY`: Your testnet wallet private key ([MetaMask export guide](https://support.metamask.io/managing-my-wallet/secret-recovery-phrase-and-private-keys/how-to-export-an-accounts-private-key/))
93
106
-`ETHERSCAN_API_KEY`: API key from [Etherscan](https://docs.etherscan.io/getting-started/viewing-api-usage-statistics)
94
107
95
-
**Fund your wallet:**
108
+
**Fund your EVM wallet:**
109
+
110
+
- Acquire **ETH** on Ethereum Sepolia for transaction gas and CCIP fees ([Chainlink faucet](https://faucets.chain.link/) or [Google Cloud Faucet](https://cloud.google.com/application/web3/faucet/ethereum/sepolia))
111
+
-**LINK** is optional — use `--fee-token LINK` on EVM → Solana sends if you prefer paying CCIP fees in LINK
112
+
113
+
### Cross-Chain Transfers (CCIP CLI)
114
+
115
+
The final tutorial phase uses globally installed `ccip-cli` (not the BS58 generator):
116
+
117
+
-**Solana → EVM**: Run from Terminal 1 with `--wallet ~/.config/solana/id.json`
118
+
-**EVM → Solana**: Run from Terminal 2 (Hardhat directory). Prefer `--wallet hardhat:<name>` ([Hardhat keystore](https://hardhat.org/docs/plugins/hardhat-keystore)) so the signing key stays encrypted. Hardhat tasks load env-enc automatically; `ccip-cli` does not. As an alternative, view the same key with `npx env-enc view` and export `PRIVATE_KEY` manually for the send command.
119
+
120
+
**RPC endpoints** (required for source and destination chains). You can provide them any of these ways — see [CCIP CLI configuration](https://docs.chain.link/ccip/tools/cli/configuration):
121
+
122
+
-**Command line:** pass `--rpc` on each command (repeat for multiple networks), or `--rpcs` with comma-separated URLs
123
+
-**Environment variables:** export `RPC_*` variables (e.g., `RPC_SEPOLIA`, `RPC_SOLANA_DEVNET`) or the tutorial's `SOLANA_DEVNET_RPC` and `ETHEREUM_SEPOLIA_RPC_URL` exports
124
+
-**File:** create a `.env` file in the directory where you run `ccip-cli` (default `--rpcs-file`, one URL per line)
125
+
126
+
See the tutorial's **Configure CCIP CLI** section for the recommended `--rpc` examples.
127
+
128
+
### Environment Variables
129
+
130
+
Variables use prefixes to prevent confusion across repositories and tools:
96
131
97
-
- Acquire LINK and ETH on Ethereum Sepolia using [Chainlink faucets](https://faucets.chain.link/)
0 commit comments