🕵️ SicherheitslückenCVE-2023-4751 | vim up to 9.0.1247 heap-based overflow(18.09.2026 um 00:34 Uhr)
🕵️ SicherheitslückenCVE-2023-5535 | vim up to 9.0.1969 use after free(18.09.2026 um 00:34 Uhr)
🕵️ SicherheitslückenCVE-2023-4751 | vim up to 9.0.1247 heap-based overflow(18.09.2026 um 00:34 Uhr)
🕵️ SicherheitslückenCVE-2023-5535 | vim up to 9.0.1969 use after free(18.09.2026 um 00:34 Uhr)
🔧 Programmierung 🕛 vor 1 Jahr 4 Min Lesezeit
0

Running Your First Solana Project with Anchor

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In this post, we’ll continue from where we left off in the last guide .









Step 2: Install Remote - WSL Extension



The Remote - WSL extension allows you to seamlessly work with files and folders inside your WSL Ubuntu environment.




  1. Open VS Code.

  2. Go to the Extensions view by clicking the Extensions icon on the left-hand side or pressing Ctrl+Shift+X.

  3. Search for Remote - WSL and click Install.






VS Code






Step 3: Connect VS Code to WSL Ubuntu



After installing the extension, connect to the Ubuntu environment we created in the previous guide:




  1. Open the Command Palette (Ctrl+Shift+P) in VS Code.

  2. Search for and select Remote-WSL: New Window.

  3. This opens a new VS Code window connected to your WSL environment.






Remote - WSL






Step 4: Install Rust Analyzer Extension



Rust Analyzer provides powerful features like syntax highlighting, autocompletion, and inline documentation for Rust projects.




  1. In the Extensions view (Ctrl+Shift+X), search for Rust Analyzer.

  2. Click Install.






Rust Analyzer






Step 5: Generate a Default Anchor Project



Anchor provides a boilerplate project to help you start coding quickly. Follow these steps to create your first Solana program:




  1. Open the WSL terminal in VS Code or launch it from your Ubuntu environment.

  2. Run the following commands to initialize a new project:




CODE
   anchor init my_solana_project
cd my_solana_project






This creates a new directory with a basic Solana program scaffold.









Step 6: Build the Anchor Project



Before deploying, we need to build the program:




  1. Navigate to the project directory if you're not already there:




CODE
   cd my_solana_project







  1. Build the project:




CODE
   anchor build






This compiles the Rust code into a Solana-compatible program.









Step 7: Run Solana Test Validator



solana-test-validator starts a local Solana network on your machine, which allows you to deploy and test your Anchor program without relying on the Solana devnet or mainnet.



We will run the below command




CODE
solana-test-validator






If you encounter an error with the above command run




CODE
solana-test-validator --log






If you encounter errors like "AVX2 not supported", refer to the Solana GitHub repository for instructions on building Solana from source.






Step 8: Get Sol for Gas Fees



To deploy your program, you’ll need some SOL to cover transaction fees. Let’s request SOL from the Devnet faucet:




  1. Set your Solana CLI to use the Devnet:




CODE
   solana config set --url https://api.devnet.solana.com







  1. Generate a new Solana wallet:




CODE
   solana-keygen new --outfile ~/.config/solana/id.json







  1. Fund your wallet with Devnet SOL:




CODE
   solana airdrop 2







  1. Confirm your balance:




CODE
   solana balance












Step 9: Deploy the Anchor Program



Now that everything is ready, deploy the program to the Devnet:




  1. Run the deployment command:




CODE
   anchor deploy







  1. After a successful deployment, you’ll see the program ID in the output. Save this ID for later use.









Step 10: Interact with Your Deployed Program (Optional)



Anchor provides a test suite for interacting with your program. To test the default code:




  1. Run the test command:




CODE
   anchor test







  1. This executes the default program logic on the Devnet and returns the results.









Additional Tips:





  • Use .env Files: Store your program ID, RPC URL, and other secrets in a .env file to keep your project organized.


  • Debugging: If you run into errors, check the target/deploy folder for compiled artifacts and logs.


  • Read the Docs: Explore Anchor’s official documentation for advanced topics like program state and cross-program invocations.


  • Error Handling: If you encounter deployment errors, check the logs in the target/deploy/ folder.


  • Local vs. Devnet: Use solana-test-validator for local testing. Switch to Devnet when interacting with real wallets or external users.


  • Documentation: Explore Anchor's official docs for advanced features like program state and cross-program invocations.









Conclusion



Congratulations! You’ve successfully run your first Solana project using Anchor. From setting up VS Code to deploying on Devnet, you’ve completed the essential steps to get started with Solana development.



If you have questions or want to learn more, subscribe and stay tuned for the next guide where we’ll dive deeper into customizing Anchor programs.

Vollständiger Original-Artikel
Den kompletten Beitrag mit allen Details direkt auf dev.to lesen.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
CVE-2012-5825 | Horde Kronolith 3.0.17 Portal Blocks input validation (ID 349780 / XFDB-80084)
1 Quelle
Windows-Update: Machine Identity Isolation sperrt Unternehmens-PCs - Börse Express
1 Quelle
CVE-2023-4751 | vim up to 9.0.1247 heap-based overflow
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Running Your First Solana Project with Anchor

Thematisch verwandte Begriffe: Running, Your, First, Solana · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...