Setting up medium soda solana with upolling code Visual Studio
Solana – this is the popular, fast and scale platform of the blockchain, which is a significant signal in the sprouting of cryptocurrency. In addition to his medical work, he becomes more wicked, setting the medium for development on your car can be a fallen for the back. In this state, we conduct the process of setting the medical work solana with the use of the Visual Studio code (against the code), which is a prolonic election for the deuters from it, and it is easily and striking the character.
PROVIDERS
In front of us we will start, beate what you have the following predisposing:
- Contemporary operative system (Windows, Macos or Linux)
- Inaccessible Version Node.js (LTS or Last Version Recommended)
- Solana Cli (Dispatcher Packets Halls) Install on Your Machine
- A sign with git and basal coding coding
Shag 1: Install unusual packages
To set up the medium -cutting solana, using the VS code, you need to install the following packages:
SOLANA-CLI
- Vscode-Solana ‘
You can install these packets npm or the adjacent:
`Bash
NPM Install -g Solana -Cli @vscode/Soolana
`
or
`Bash
Yarn Global Add Solana-Cli @vscode/Solana
`
Shag 2: Submit New Project Solana
Submit a new folder for your project and plow into your tag. Put the new catalog into the project with your election (for example, my_solana_project
).
`Bash
My_solana_project mkdir
CD My_solana_project
`
Shag 3: Initialize Solana Cli
Initialize Solan CLI for download and management packages:
`Bash
Solana Init
`
This Commonde is a new structure of catalogs for your project, included in the incoming files for CLI SOLANA.
Shag 4: Install the PROVICE
Installation of any non -existent expansion, dusk the following Commond:
`Bash
NPM Install -Save @Solana/Web3.js
`
or
`Bash
Add @solana/web3.js
`
Shag 5: Settings Setting code
Read the VS code settings to include solana cli. You can make this, the new file with the name .
JSON
{
"Display": ["Typescript"],
"Solonoversia": "1.9.0",
"Solananodepath": "/Usr/Bin/Node"
}
This configuration is affiliated with the vs -code to use node.js veria 1.9.0, which is a recommended version for the cutting of solana.
Shag 6: Submit the new SOLANA directory
Submit the new catalog with the src
in the Popka project:
`Bash
Mkdir src
CD SRC
`
Shag 7: Submit the new file of solidnost
Submit the new file with the name Main.Sol
in Catalog SRC/Contracts, which will serve our main contraction:
Pragma Polidy ^0.8,0;
MYContract {
Uint256 Social counts;
Function of Involtage () Public {
Count ++;
}
Function GetCount () Public View Return (Uint256) {
Vurati will be cut;
}
}
`
This Solidnost Code protects the simple contract with the function Urcrement
and getcount.
Shag 8: Set up and comply the project
Affordable and assert your project solan, using the follow -ups:
`Bash
NPM Run Build: Dev
NPM Run Compilation
`
or
`Bash
Stright of the Outline: Drawing
Straiting
`
Komanda Build: Dev
Shag 9: Take off your new project B V -Code
Otkat your new SOLANA project in VS. You have a new structure of the Pope with a few files and folders, included:
- Main.Sol
: Your Home Course Course
- Contractname.json
: Metadnogo JSON for your counteract
- Contract.abi`: abbi (two interface to come) your contract
Shag 10: Write Code B V Code
Now you can write the code unwavering in the editor or to open the right file.