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

Basic Solana Operations

Introduction to Solana CLI and Basic Wallet Operations

Overview

  • This article introduces Solana CLI for basic operations like wallet creation and fund transfers.

Setup & Installation

  • Solana CLI Installation:
sh -c "$(curl -sSfL https://release.solana.com/v1.8.0/install)"
  • Rust Installation (Solana’s primary language):
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustup component add rustfmt

Wallet Basics

A wallet consists of a public key (account address) and a private key (signature authorization).

  • Solana wallet types:
    • Paper Wallet
    • Hardware Wallet
    • File System Wallet (covered in this guide).

Creating a File System Wallet

  • Generate a new wallet:

    solana-keygen new
    

    or

    solana-keygen new --outfile /root/solana/my_wallet.json
    
  • Retrieve the public key:

    solana-keygen pubkey ~/solana/my_wallet.json
    
  • Verify the wallet:

    solana-keygen verify <PUBKEY> /root/solana/my_wallet.json
    

Solana CLI Configuration

  • Check current config:
    solana config get
    
  • Set a custom wallet path:
    solana config set --keypair /root/solana/my_wallet.json
    
  • Switch to Solana Testnet (for testing):
    solana config set --url https://api.devnet.solana.com
    

Testnet Operations

  • Airdrop SOL (free test tokens):
    solana airdrop 2
    
  • Transfer SOL between wallets:
    solana transfer <RECIPIENT_PUBKEY> 1 --allow-unfunded-recipient
    
  • Check balances:
    solana balance <PUBKEY>
    
  • Transaction fees are deducted from the sender’s balance.

Next Steps

  • The next article will cover minting custom tokens on Solana.

This guide provides a foundation for Solana CLI usage, enabling users to manage wallets and execute transactions on the Testnet.

all tags