solana
БесплатноБез исполняемых скриптовНе проверенSolana is a high-throughput blockchain with 400 ms slots and sub-cent fees. Use this skill to write on-chain programs in Rust with the Anchor framework, talk…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Solana
Overview
Solana programs are compiled Rust (usually written with Anchor) that run on validators and own no state themselves: state lives in separate accounts that each transaction lists up front, which is what allows parallel execution. Checked here (October 2026): Anchor 1.2.1 (anchor-lang, CLI anchor-cli, TypeScript client @anchor-lang/core), Agave validator and Solana CLI 4.3.2, @solana/kit 8.5.0, @solana/web3.js 3.1.1, @solana/spl-token 0.4.15.
JavaScript SDK choice: @solana/kit is the renamed 2.x rewrite of web3.js (functional, tree-shakable, bigint lamports). @solana/web3.js 3.x keeps the old class-based API (Connection, PublicKey) on top of Kit; the 1.x line gets critical fixes only. Use Kit for new code. The Anchor TypeScript client still depends on web3.js 1.x types.
Instructions
Install the toolchain
Follow the official installation page (https://solana.com/docs/intro/installation): Rust through rustup, the Solana CLI through Anza's installer, then Anchor through AVM. Do not pipe a downloaded script into a shell on the user's behalf; download the installer, read it, then run it, or use a system that already has the tools. Linux needs build-essential pkg-config libudev-dev llvm libclang-dev protobuf-compiler libssl-dev.
cargo install --git https://github.com/otter-sec/anchor avm --force
avm install 1.2.1 && avm use 1.2.1
anchor --version # anchor-cli 1.2.1
solana config set --url devnet # also -ul localhost, -um mainnet-beta
solana-keygen new # writes ~/.config/solana/id.json, never commit it
solana airdrop 2 && solana balance
Anchor project
anchor init counter # Rust tests with LiteSVM by default; --test-template mocha for TypeScript tests
cd counter
anchor keys sync # make declare_id! and Anchor.toml match the program keypair
anchor build # outputs target/deploy/*.so and target/idl, target/types
anchor test
anchor deploy # to the cluster set in Anchor.toml
anchor init generates a modular layout by default (separate instruction, state and error files); --template single gives one lib.rs. The program below is written as a single file. The generated test targets the template program, so replace or delete it (in programs/counter/tests/, or tests/ with --test-template mocha) before anchor test on this program:
use anchor_lang::prelude::*;
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); // replaced by `anchor keys sync`
#[program]
pub mod counter {
use super::*;
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
let counter = &mut ctx.accounts.counter;
counter.count = 0;
counter.authority = ctx.accounts.authority.key();
counter.bump = ctx.bumps.counter;
Ok(())
}
pub fn increment(ctx: Context<Increment>) -> Result<()> {
let counter = &mut ctx.accounts.counter;
counter.count = counter.count.checked_add(1).ok_or(ErrorCode::Overflow)?;
emit!(CounterIncremented { count: counter.count, authority: ctx.accounts.authority.key() });
Ok(())
}
}
#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(init, payer = authority, space = 8 + Counter::INIT_SPACE,
seeds = [b"counter", authority.key().as_ref()], bump)]
pub counter: Account<'info, Counter>,
#[account(mut)]
pub authority: Signer<'info>,
pub system_program: Program<'info, System>,
}
#[derive(Accounts)]
pub struct Increment<'info> {
#[account(mut, seeds = [b"counter", authority.key().as_ref()], bump = counter.bump, has_one = authority)]
pub counter: Account<'info, Counter>,
pub authority: Signer<'info>,
}
#[account]
#[derive(InitSpace)]
pub struct Counter { pub count: u64, pub authority: Pubkey, pub bump: u8 }
#[event]
pub struct CounterIncremented { pub count: u64, pub authority: Pubkey }
#[error_code]
pub enum ErrorCode { #[msg("Counter overflow")] Overflow }
Client with @solana/kit
npm install @solana/kit @solana-program/system @solana-program/token
import {
address, appendTransactionMessageInstruction, assertIsTransactionWithBlockhashLifetime, createSolanaRpc, createSolanaRpcSubscriptions,
createTransactionMessage, generateKeyPairSigner, getSignatureFromTransaction, lamports, pipe,
sendAndConfirmTransactionFactory, setTransactionMessageFeePayerSigner,
setTransactionMessageLifetimeUsingBlockhash, signTransactionMessageWithSigners,
} from "@solana/kit";
import { getTransferSolInstruction } from "@solana-program/system";
const rpc = createSolanaRpc("https://api.devnet.solana.com");
const rpcSubscriptions = createSolanaRpcSubscriptions("wss://api.devnet.solana.com");
const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions });
const payer = await generateKeyPairSigner(); // load a real signer from a fi
Установить solana в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл solana?
Solana is a high-throughput blockchain with 400 ms slots and sub-cent fees. Use this skill to write on-chain programs in Rust with the Anchor framework, talk to the network from TypeScript with @solana/kit, create SPL tokens with the Solana CLI, and test and deploy to devnet. Trigger words: solana, anchor, smart contract, spl token, program derived address, solana web3.js, devnet.
Как установить скилл solana?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл solana запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic