Wave Layer Blog

Crypto Friendly Dedicated Servers Located In 50+ Countries!
World Class 24×7 Support:

Top 10 Useful Solana CLI Commands

Solana CLI (Command Line Interface) commands are critical tools for dealing with the Solana blockchain, allowing users to manage accounts, create programs, and conduct transactions effectively. These instructions make it easier to configure and verify balances, as well as sign and send transactions. Understanding these commands is critical for developers and consumers wishing to fully use Solana’s capabilities.

solana-keygen new

Your Solana account will receive a fresh set of keys created by “solana-keygen new.” It offers a private key that is necessary for signing transactions in addition to a public key that functions as your account address on the blockchain. The command will show the recovery phrase that is secret as well as the public key. Keep in mind that this secret phrase functions similarly to a master password; if something goes wrong, you’ll need to be able to retrieve it by writing it down safely.

				
					solana-keygen new
				
			

solana config set [provider.url] [RPC endpoint URL]

You can set the default JSON RPC URL and network, among other configurations in your Solana CLI, with the solana config set command. It lets users set factors like the RPC URL, the data directory, or the default signer to tailor their CLI environment to their tastes or unique network requirements. By running the command, the Solana CLI is set up to communicate with a certain network (devnet, mainnet-beta, etc.).

				
					solana config set --url devnet.solana.com

				
			

solana balance [wallet address]

On the Solana blockchain, the solana balance command obtains the current SOL balance for a given wallet address. Without requiring a blockchain explorer or other tools, it gives consumers a simple way to find out how many SOL tokens are held in a specific wallet.

				
					solana balance 7Vxq3GZnLkkpiuJHdsXnP2qM3yc8h9sZMUCeeFoLR6vf
				
			

solana airdrop [amount] [wallet address] [--faucet-host FAUCET_HOST]

The solana airdrop command, which is mostly used for testing or development, transfers a predetermined number of SOL tokens to a specified wallet address. It facilitates rapid and simple access to funds for Solana network testing by allowing users to fund a wallet with SOL tokens from a faucet server, which may be optionally given with the –faucet-host parameter.

				
					solana airdrop 1.0 LAMPBD [YOUR_WALLET_ADDRESS] --faucet-host https://faucet.solana.com
				
			

solana accounts

All accounts that are currently accessible on the Solana blockchain are listed via the solana accounts command. It offers thorough details about every account, including as the address, balance, and ownership status, giving users insight into the condition of the blockchain and its users. For monitoring and debugging purposes, developers and validators will find this command especially helpful.

				
					solana accounts
				
			

solana program deploy [program.so path]

A Solana program included in a.so file is deployed to the blockchain using the solana program deploy command. The program’s binary is assembled and uploaded to the network so that users or smart contracts can run it. When implementing bespoke smart contracts or decentralized apps (dApps) on the Solana blockchain, this is an essential step.

				
					solana program deploy ./my_program.so
				
			

solana program show [program key]

Using its program key as identification, the solana program show command provides details about a deployed program on the Solana blockchain. It gives users the ability to examine the attributes and state of a deployed program by supplying information about the program, including its account address, authority, and data size. This command can be used to troubleshoot interactions with smart contracts and validate program implementation.

				
					solana program show 4pMWh9hMfytF2XoChFJhNvTEQ3k5cnBb9B1qrgNx4bn
				
			

solana transaction create [KEYPAIR.json] [RECEIVER_ADDRESS] [AMOUNT]

The solana transaction create command creates a new transaction from a specified keypair JSON file, sending a certain amount of SOL to a receiver address. It constructs the transaction data necessary for transferring SOL tokens on the Solana blockchain, ready for signing and submission to the network. This command facilitates the initiation of transactions directly from the command line interface.

				
					solana transaction create my_keypair.json 7Vxq3GZnLkkpiuJHdsXnPqM3yC8h9sZMUceeFoLR6vf 10
				
			

solana transaction sign [KEYPAIR.json] [TRANSACTION_FILE_PATH]

Using the private key kept in the designated keypair JSON file, the solana transaction sign command signs a transaction file. It prepares the transaction for submission to the Solana blockchain network by adding the necessary digital signature to authorize the transaction. Before the transaction is broadcast to the network, this stage verifies its authenticity and security.

				
					solana transaction sign my_keypair.json my_transaction.json

				
			

solana transaction send [TRANSACTION_FILE_PATH]

Using the supplied transaction file, the solana transaction send command broadcasts a signed transaction to the Solana blockchain network. By submitting the transaction for processing, it starts the SOL transfer or the smart contract’s specified procedures to be carried out. By completing the transaction, this operation makes it possible to communicate with the Solana blockchain.

				
					solana transaction send my_signed_transaction.json
				
			

Conclusion

Mastering Solana CLI commands enables users to fully leverage the Solana blockchain, allowing for smooth development, testing, and engagement with decentralized applications. Using these commands, customers may guarantee that their blockchain operations are managed efficiently and securely, improving their overall experience on the Solana network.

Share the Post:

Related Posts

How to install Kryptex Miner on Ubuntu

/*! elementor – v3.19.0 – 07-02-2024 */ .elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px} Kryptex Miner Kryptex Miner is a

Read More