Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Logs a custom greeting passed as instruction data.
use solana_program::{account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, msg, pubkey::Pubkey};
entrypoint!(process_instruction);
fn process_instruction(_program_id: &Pubkey, _accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResult {
let greeting = std::str::from_utf8(instruction_data).unwrap()
msg!("Greeting: {}", greeting)
Ok(())
}Solana Rust is the primary language used to write smart contracts (called programs) on the Solana blockchain. It leverages Rust’s safety and performance features to build high-throughput, low-latency decentralized applications.
Origin & Creator
Rust-based smart contracts on Solana were promoted by Solana Labs around 2017-2018, adopting Rust for its safety, concurrency, and performance benefits.
Industrial Note
Solana Rust programs are preferred in projects requiring high TPS (transactions per second), low fees, and efficient on-chain computation like decentralized exchanges, NFT marketplaces, and real-time gaming.