了解 Solana 的运作方式,无需任何经验。在 devnet(Solana 的免费测试网络)上,通过五个简短步骤,你将创建钱包并发送测试美元(USDC),然后创建资产(例如股份或货币),将其发送给他人,并冻结对方的账户。
Try it in your browserIt runs on devnet from your Playground wallet, with nothing to install. If the wallet needs devnet SOL, Playground links you to the free faucet first.
Run in Playground (opens in a new tab)
Playground 可运行第 1、3、4、5 步。第 2 步“发送美元”需要下方的本地环境设置。
在本地跟着操作
Start with an agent
Follow along manually
npx add-mcp https://mcp.solana.com/mcp -n solana-mcp -g -y
让你的智能体和你一起完成本快速入门。一条命令即可安装 Rust、Solana CLI、Anchor CLI、Surfpool CLI、Node.js 和 Yarn,以及适用于 AI 编程智能体的 Solana agent skills(全局安装):在终端中运行安装程序:curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash
在终端中运行安装程序。它还会通过你的包管理器安装系统依赖项。curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash
这些工具在 Windows 上的 Linux(WSL)中运行。
-
在 Windows PowerShell 中安装 WSL,如有提示,请重启 Windows:
-
打开 Ubuntu 终端,并在其中运行安装程序:
curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash
完整的 WSL 设置请参阅安装依赖项。 运行前,你可以查看安装程序源码。安装结束时会显示已安装内容的摘要(你的版本号可能有所不同):Installed Versions:
Rust: rustc x.y.z (...)
Solana CLI: solana-cli x.y.z (..., client:Agave)
Anchor CLI: anchor-cli x.y.z
Surfpool CLI: surfpool x.y.z
Node.js: vx.y.z
Yarn: x.y.z
安装程序可能会输出以下两行:[ERROR] Surfpool version x.y.z installed, but 1.4.0 was requested.
[ERROR] Failed to install Surfpool.
它会安装最新的 Surfpool 版本,随后因该版本与其固定的版本不一致而报错。如果 surfpool --version 能输出版本号,说明 Surfpool 可正常使用,你可以忽略这两行。 然后重启终端,使新命令加入你的 PATH,并检查每个工具。每条命令都会输出其版本号,例如 solana-cli x.y.z (..., client:Agave) 或 anchor-cli x.y.z:rustc --version
solana --version
anchor --version
surfpool --version
node --version
yarn --version
安装程序失败或找不到某个命令? 请参阅安装依赖项,单独安装各个工具或排查问题。 然后继续第 1 步 →
你将完成的内容
代码使用 TypeScript,搭配 @solana/kit 及其插件。每个步骤都是一个简短的文件,使用 npx tsx 运行。CLI 标签页则使用 Solana CLI 和 spl-token 完成相同的操作。