Avatar
Fernando Vásquez is an electronics engineer and software developer currently based in the world. He occasionally blogs about Python and Android programming.

Solana Cheat Sheet

Solana Cheatsheet

Install

  • Linux
sh -c "$(curl -sSfL https://release.solana.com/v1.18.4/install)"
  • Windows
cmd /c "curl https://release.solana.com/v1.18.4/solana-install-init-x86_64-pc-windows-msvc.exe --output D:\tmp\solana-install-init.exe --create-dirs"
  • Check with
solana --version

Running

  • On devnet
solana config set --url devnet
  • Local
solana config set --url localhost
solana-test-validator
  • Check config
solana config get
  • Create key, check balance and get some tokens
solana-keygen new -o ~/.config/solana/id.json
solana balance
solana airdrop 2

Program

solana address -k target/deploy/myepicproject-keypair.json

deploy

cargo build-bpf
solana program deploy target/deploy/break_solana_program.so --url localhost

Anchor

Install

cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
anchor --version

Create a new project

anchor init solana-twitter
cd solana-twitter
anchor build
anchor deploy

References

  • https://lorisleiva.com/create-a-solana-dapp-from-scratch/getting-started-with-solana-and-anchor
  • https://lorisleiva.com/owning-digital-assets-in-solana/how-nfts-are-represented-in-solana#x-discussions

all tags