Skip to content

Latest commit

 

History

History
76 lines (48 loc) · 2.62 KB

README.md

File metadata and controls

76 lines (48 loc) · 2.62 KB

Solana Token Project

This project showcases the creation of a token on the Solana blockchain, utilizing Rust for both the smart contract development and client-side interactions. The smart contract implemented in Rust offers fundamental token functionalities akin to those found in Ethereum tokens, including minting, transferring, and balance inquiries. On the client side, the Rust application demonstrates robust interactions with the blockchain, managing tasks such as token minting and facilitating token transfers between accounts. This dual use of Rust highlights its efficiency and suitability for blockchain development, underscoring its performance capabilities in handling both contract logic and client interactions.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Setting Up the Development Environment

  1. Clone the Repository:

Clone the desired repository to your local machine using the following command in your terminal or command prompt:

git clone https://github.com/Parikalp-Bhardwaj/Solana-Contract-Token.git
  1. Start Solana Test Validator

This will start a Solana test validator on your local machine for development purposes.

solana-test-validator 
  1. Configure Solana CLI to Use Local Validator:

Before deploying the smart contract or running client scripts, make sure your Solana CLI is configured to communicate with your local test validator. Run the following command to set the Solana CLI to use the local network:

solana config set --url http://localhost:8899
  1. Build and Deploy the Smart Contract:

Navigate to the smart contract directory and build the contract.

cd ./Solana-Contract-Token
  1. Build and Deploy the Smart Contract:

Navigate to the smart contract directory and build the contract.

make contract-build

Deploy the contract to the local Solana test validator after deployment we will get PROGRAM_ID.

solana program deploy ./contract/program/solana_deploy_token.so

View Logs To see the logs generated by the Solana program, use the Solana logs comman

solana logs | grep "${PROGRAM_ID} invoke" -A 3
  1. Set Up the Client:

Navigate to the client directory and install the dependencies and Run the client script to mint tokens and transfer them between accounts.

make rust-client-start