Odak modu

Smart Contract development on Solana using Rust

Programs

Smart contracts on other blockchains are called Programs on Solana. 

Solana, unlike other blockchains, divides code and data into two different components: Programs and Accounts. That means, rather than keeping data internally in variables, Programs interact with external data saved in Accounts with the ability to change them. Solana's design enables a program to work across several accounts without extra deployments.

There are 3 ways to create Programs on Solana as we mentioned earlier:

  • Using native programs
  • Using existing libraries on Solana(eg. Solana SPL)
  • Developing your own code from scratch on Solana

Per Solana Cookbook Rust-based programs(developed from scratch) adhere to the following architecture:

  • Lib.rs: Registering modules
  • Entrypoint.rs: Entrypoint to the program
  • Instruction.rs: Program API, (de)serializing instruction data
  • Processor.rs: Program logic
  • State.rs: Program objects, (de)serializing state
  • Error.rs: Program-specific errors

Programs can be deployed via Solana CLI or other Solana compatible CLI’s like Anchor. Loaded into the Solana cluster when a program is deployed via compiling into an object containing BPF byte code. Programs live in accounts and once invoked, they are executed by the Solana Runtime.

You can find further information from Solana Cookbook: https://solanacookbook.com/core-concepts/programs.html 

Resources:

https://medium.com/coinmonks/solana-internals-part-2-how-is-a-solana-deployed-and-upgraded-d0ae52601b99 

Background Pattern
Birlikte öğrenelim

Sektörde en çok aranan yazılım becerilerini kazan

Yapay zeka desteği, birebir mentörlük saatleri, canlı dersler ve senin için özel hazırlanmış içeriklerle eksiklerini tamamla, düzenli geri bildirimler al ve öğrenme sürecini en verimli hale getir.

Yunus Emre Kabakcı

Patika+ mezunu

Patika+ Fullstack Web Development Bootcamp mezunumuz Yunus Emre,

3 ay içinde Katar’dan aldığı teklif ile, global bir şirket olan Pavo Group’da işe başladı!


“İçerik zenginliği, mentor desteği, ileriye dönük bir network sağlaması ve dünyada en çok tercih edilen frameworkler üzerinden bir eğitim veriyor olması Patika+’ı tercih etmemin temel sebepleri oldu!“

Yorumlar

Yorum yapabilmek için derse kayıt olmalısın!