Rust-Calculator-in-Solana

A simple Rust DApp Calculator in Solana 🦀

Stars
7

This Calculator written Rust using Anchor âš“

Setting up the Environment:

  • Rust Installation:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup component add rustfmt
  • Solana Installation:
sh -c "$(curl -sSfL https://release.solana.com/v1.8.0/install)"

Please update your PATH environment variable to include the solana programs

npm i -g @project-serum/anchor-cli
  • And we can use Cargo to install CLI:
cargo install --git https://github.com/project-serum/anchor --tag v0.17.0 anchor-cli --locked

Configurations on Solana CLI

solana config get

Configure RPC URL

solana config set --url localhost

Wallet address and airdrop some SOL

solana address
  • For more comprehensive details of your account
solana account <your address from the last command>

Build project from scratch

  • Setting up anchor project
anchor init <your project name>

cd <your project directory>
  • Compile the project
anchor build
  • To run tests
anchor test