Blockchain

Blockchain of the Month – Solana: Wallets and Smart Contracts



Explore Solana’s ecosystem in our Blockchain of the Month feature, focusing on setting up Phantom wallets and crafting smart contracts for beginners.

Missed part one? Catch up here: https://youtu.be/9PUoWW-1Hfg

#Solana #BlockchainTechnology #CryptoInnovation #kba #kbaiiitmk #blockchain

Welcome back everyone to blockchain of the month Solana today we are going to explore wallets and smart contracts for the wallet I picked the Phantom wallet which is also the community pick for Solana but there are other wallets out there let us take a look at setting up

The wallet first let us add it to our browser good we are done with the installation now we will create a new wallet set a wallet password back up the secret recovery phrase and we are done let us pin it so we can easily access it Now by default

The Phantom wet is connected to Solana ethereum and polygon maintenance but for development purpose we need to connect to the test networks to do so open the menu and go to settings if we look at the Active networks we can only see the connection to main Nets go back and

Scroll down select developer settings and enable test mode which allows us to connect to various test networks we go with Solana devet now both testet and devet are Solana’s test networks with devet confered for C development and debugging while the test net is config to resemble the Solana main

Net now as you can see we are in testnet mode and we are connected to devet with zero SW let us change that by getting some sols from the faucet sites we can use soul faucet.com copy the address from the wallet and use it to request devet test Sol and confirm

The airdrop in the Solana Explorer and Phantom wallet the same can be done with faucet. sol.com now we can do the same for test net but the address is different from devet in the Phantom wallet so first we switch to testnet then copy the address and request Sol for the testnet then confirm

That in Explorer and the vallot now we are done with the wallot let me introduce you to Solano playground which is an an onine ID that enable us to code Solana smart contracts build them and deploy them to Dev test net or main net then interact with it we can either

Create a project or we can pick a tutorial and go with the flow I’ll choose the hello Solana tutorial which is writing a hello world smart contract and interacting with it this will give us a minimal project setup as here we can see it has already imported the necessary module for us it

Has account inform module for accessing the account informations entry point module for setting up the entry point to the program and program output message module for logging out messages and P key module for identity of the smart contract first let us start by creating starting point for our contract every

Interaction within the contract is going to start from the process instruction function which takes in three arguments the program ID which is the contract address account related to the contract any input parameters when calling the function all these are made available by the Sol run time at the time of executing this

Function now for the function body we’ll log out the message hello world and gracefully exit the function let’s try building the contract we got a warning and that’s because we forgot to set the process instruction function as the entry point to our contract let us build again great everything is good now let

Us deploy the contract first connect to the playground wallet which usually will give us some sol to use but to some reason I’m not getting it we can also connect to the Phantom wallet from playground but it will only allow us to deploy from the playground wallet so let

Us send some soul to the playground wallet copy the wallet address from the bottom section first let me switch back to devnet then let us send some so to the playground wallot let us confirm the transaction in Explorer and in the playground finally deploy the contract and confirm the deployment in the

Explorer now now we need to create a client file to interact with the deployed contract to do that just go to the client section in the tutorial which will int generate the file for us we can also manually create it but I like the lazy way so this is the typescript we can

Start by logging out the program ID aka the contract address now to create our own transaction to interact with the contract we need to provide the latest block has information with that we’ll create an in of transaction then add instructions to call the function to Output the Hello message for which we

Need to pass in the program ID any accounts associated with our execution and any input data both of which are empty for this particular operation sign the transaction with our wallet send the transaction and console log the transaction hash let us run the script using the Run button in the file

Explorer copy the transaction hash and use the command Solana confirm minus V to get the transaction Lo here we can see the transaction received and hello world message now that was a peak into the development of desized application in Solana tune in next Saturday to see more in-depth walkth through on decentralized

Application development in Solana blockchain ecosystem thank you for your time and attention I look forward to continue our conversation next Saturday

Write A Comment

Share via