Everything You Need to Know About Solana's Devnet (2024)

Everything You Need to Know About Solana's Devnet (1)

Written by Alchemy

Everything You Need to Know About Solana's Devnet (2)

Reviewed by Brady Werkheiser

Published on July 21, 20224 min read

Solana’s fast transaction speeds, low transaction costs, and developer-friendly environment make it an excellent chain for both dApp developers and users.If you're looking to start building on Solana, this article explains Solana's Devnet, an essential developer resource for testing smart contracts on a test network that mimics Solana's mainnet.

A cluster is a set of nodes which are responsible for evaluating the validity of incoming transactions to be added to the blockchain.

In each cluster one node is designated the ‘leader’ (the leader changes roughly every two days), which suggests which transactions should be added to the blockchain’s ledger and signs the suggested transactions with their signature. The other nodes within the cluster are ‘validators’, who double check whether the transactions are valid.

What is the Solana Devnet?

The Solana Devnet is an environment that replicates the actual Solana network (i.e. Mainnet) environment, but uses test SOL tokens to complete transactions so web3 developers don’t need to spend actual money to test their smart contracts.

The Solana Devnet is a safe playground for developers, users, and validators to test applications at no risk.

What is a Solana Devnet faucet?

To prevent network congestion from malicious actors while keeping the network free to use, the Solana Devnet uses a different token than mainnet.

Devnet tokens can be acquired either through the Solana Devnet faucet or from the following airdrop command you can enter in the Command Line Interface (CLI).

Copied

solana airdrop 2--url https://api.devnet.solana.com

What is the Solana Devnet Explorer?

The Solana Devnet explorer allows web3 developers to search for any block, transaction, program, or token on the devnet. This tool helps developers get information about their transactions, debug transactions that aren’t working properly, and explore program details.

What is the difference between Solana’s testnet and devnet?

The difference between Solana’s Devnet and the Solana Testnet is that the testnet is a network meant to be used by Solana’s core developer team to test planned updates to the main network while Devnet is a testing environment for the general public to use.

How to Connect to Solana's Devnet

Before connecting to Solana's Devnet, it's important to make sure you install the essential Solana developer tools in your local environment. If you're starting from scratch, you can install the basic tools using the following instructions.

1. Install the Solana Tool Suite

First, will need the Solana Tool Suite to connect to the Devnet. How you install the tool suite will depend on whether or not you're running a MacOS, Linux, or Windows operating system. Here are instructions for each development environment.

Mac Users

If your operating system is MacOS or Linux, open your favorite terminal application and copy-paste the below command.

Copied

sh -c "$(curl -sSfL https://release.solana.com/v1.10.31/install)"

The version number can be replaced with any version which you wish to install

Windows Users

If Windows is your operating system, copy paste the below into Command Prompt instead.

Copied

curl https://release.solana.com/v1.10.31/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs

Run this command to install the Tool Suite:

Copied

C:\solana-install-tmp\solana-install-init.exe v1.10.31

2. Check Your Version of Solana

Afterwards for all operating systems, run this to double check you have the desired version of Solana.

Copied

solana --version

3. Connect to the Devnet Cluster

Lastly, execute this command to connect to the Devnet cluster, and you will have connected to Devnet.

Copied

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

How to Deploy a Solana Smart Contract to Devnet

In this tutorial we’re going to deploy the HelloWorld program that the Solana team developed. It creates a count for the account it is called on which represents the number of times that this program has been called on this account historically.

For example, the first execution will increase the count to 1 but return a count of 0. The second will return a count of 1 and increase it to 2.

Because we have already installed the Solana Tool Suite, we just need to install the following dependencies:

  1. NodeJS

  2. Rust

  3. Git

Once the dependencies are installed, we'll clone the HelloWorld repo and follow the required steps to deploy it on Solana's Devnet.

1. Install NodeJS

To install NodeJS (you’ll need v14 or higher for this tutorial) - select the installer that matches your operating system.

After following the steps shown from running the installer NodeJS will automatically execute the node commands below in your terminal.

2. Install Rust

To install Rust, run this command if your operating system is MacOS, Linux, or other Unix-like operating systems, and your command line is ready.

Copied

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

On Windows, download and install rustup-init.exe.

3. Install Git

To install Git on Windows, select an installer to match your Windows version and follow the instructions.

To install Git on MacOS and Linux, first install Homebrew with the following command in your terminal of choice.

Copied

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then run the following command in the terminal to install Git with Homebrew.

Copied

$ brew install git

4. Clone the Solana HelloWorld Repo

With the dependencies installed, next, clone the HelloWorld repository in your environment.

Copied

git clone https://github.com/solana-labs/example-helloworldcd example-helloworld

5. Connect to Devnet

Double-check if you are connected to the Devnet cluster by running the following command.

Copied

solana config get

If you are not connected to the Devnet cluster, connect to the Devnet using this command:

Copied

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

6. Generate a Keypair

Now, generate a keypair, which consists of a public key (your wallet address) and a private seed phrase. This keypair allows you to create an account on-chain and interact with Solana programs.

Copied

solana-keygen new --force

7. Get Devnet SOL Tokens

You’re going to need Devnet SOL tokens in order to run our program on the Devnet. You can request tokens through the following command.

Copied

solana airdrop 2--url https://api.devnet.solana.com

8. Build and Deploy it to Devnet

Now, build the program and deploy it to Devnet.

Copied

npm run build:program-rust

At the bottom of the output that the console provides from building the program should be the command for deploying the program.

If you can’t find it, copy paste the command below to deploy the program to Solana’s Devnet.

Copied

solana program deploy dist/program/helloworld.so

Using the Solana Devnet, web3 developers can build dApps on one of the highest performance layer 1 blockchains in the world. To start building, signup for access to Alchemy's Solana API.

Everything You Need to Know About Solana's Devnet (2024)

FAQs

Is devnet solana real? ›

Devnet tokens are not real. Devnet includes a token faucet for airdrops for application testing. Devnet may be subject to ledger resets. Devnet typically runs the same software release branch version as Mainnet Beta, but may run a newer minor release version than Mainnet Beta.

What is Devnet in Solana? ›

WHAT IS DEVNET SOLANA. Devnet is the abbreviation for "Developer Network". It is a "test" network based on solana' s mainnet in which developers can work with tokens and NFTs that do not exist in the mainnet, so they have no "real" value. There is also the Testnet network.

What is the difference between DevNet and TestNet Solana? ›

Tokens on Devnet are not real assets and cannot be transferred over to mainnet in any way. Testnet is similar to Devnet, but focuses on network performance and stability, it is oriented to be used by validators. Tokens on Testnet are not real assets and cannot be transferred over to mainnet in any way.

What do you need to know about Solana? ›

What is Solana (SOL)? Solana is an open infrastructure for building scalable crypto apps. The architecture is censorship resistant, fast, and secure, and designed to facilitate global adoption. To keep time on the blockchain, Solana employs an innovative process known as Proof of History.

What does Devnet mean crypto? ›

What Is a Devnet? Blockchain Development Network. Similar to the testnet, the development network or devnet operates independently of the mainnet. Although not every blockchain protocol utilizes both a devnet and a testnet, some differentiate these environments based on their intended use.

What is DevNet used for? ›

DevNet = Development + Networking

and network troubleshooting. These skills have allowed network engineers configure and troubleshoot complex networking environments. But these complex networks take time and a fair amount of work to develop and implement.

How do I change to Devnet Solana? ›

Executing a straightforward command in the terminal signals Solana to switch to the devnet cluster. The command solana config set --url devnet reconfigures the execution environment, ensuring that every subsequent Solana command is directed to the devnet cluster.

How to airdrop DevNet Solana using JavaScript? ›

Setting up your environment
  1. npm init -y. ...
  2. npm install --save @solana/web3.js. ...
  3. const { Connection, PublicKey, clusterApiUrl, Keypair, LAMPORTS_PER_SOL, Transaction, Account, } = require("@solana/web3.js"); ...
  4. const newPair = new Keypair(); ...
  5. const publicKey = new PublicKey(newPair. ...
  6. const secretKey = newPair._keypair.secretKey.

How to deploy Solana program to DevNet? ›

To deploy a program, use the Solana tools to interact with the on-chain loader to:
  1. Initialize a program account.
  2. Upload the program's shared object (the program binary . so ) to the program account's data buffer.
  3. (optional) Verify the uploaded program.
  4. Finalize the program by marking the program account executable.

Is testnet real money? ›

Testnet coins are distinct from actual coins, and testnet coins do not have any monetary value.

Is Devnet same as mainnet? ›

Devnets serve as playgrounds for developers to experiment with new ideas, features and upgrades before deploying them on testnets or mainnets. Similar to testnets, devnets provide a controlled environment for testing and refining blockchain applications.

What problem does Solana solve? ›

Solana is a blockchain network that aims to solve for the blockchain trilema of balancing security, scalability and decentralization.

What enables Solana to be fast? ›

Solana is designed to be highly scalable, capable of processing thousands of transactions per second. Its unique consensus mechanism, Proof of History (PoH), combined with a network of nodes running parallel processing, enables Solana to handle a high throughput of transactions efficiently.

What are the cons of Solana? ›

Cons of Solana
  • Centralization Concerns. One of the main criticisms of Solana is its perceived centralization. ...
  • Security Risks. While Solana has implemented various security measures to protect its network from potential attacks, no system is completely immune to security risks. ...
  • Network Congestion. ...
  • Dependency on Solana Team.
Jul 15, 2024

Is Solana a real project? ›

Solana comes in to tackle this drawback with an open-source project that deploys a high-speed, permissionless layer-1 blockchain. It is highly functional and scalable, processing significantly more transactions per second at much lower costs to solve Ethereum's scalability issues.

Is Solana real money? ›

Like Ethereum, Solana is both a cryptocurrency and a flexible platform for running decentralized apps (dapps) or minting NFTs, with its cryptocurrency (SOL) available to buy and sell via exchanges like Coinbase.

What is the Devnet address of Usdc Solana? ›

Import the Solana Devnet USDC token contract into your origin wallet to enable it to read the token balance. Note the contract address: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU.

Top Articles
How to Identify Imbalance in the Markets with Order Flow Trading
XRP Price Today - XRP Price Chart & Market Cap | CoinCodex
Uhauldealer.com Login Page
Nehemiah 4:1–23
Ghosted Imdb Parents Guide
Atvs For Sale By Owner Craigslist
Meer klaarheid bij toewijzing rechter
Steamy Afternoon With Handsome Fernando
Toyota gebraucht kaufen in tacoma_ - AutoScout24
Free Robux Without Downloading Apps
Camstreams Download
Craigslist Alabama Montgomery
Nebraska Furniture Tables
Tracking Your Shipments with Maher Terminal
Nick Pulos Height, Age, Net Worth, Girlfriend, Stunt Actor
Sulfur - Element information, properties and uses
Transactions (zipForm Edition) | Lone Wolf | Real Estate Forms Software
Ice Dodo Unblocked 76
Xfinity Outage Map Fredericksburg Va
Seeking Arrangements Boston
Litter Robot 3 RED SOLID LIGHT
Regal Amc Near Me
Panola County Busted Newspaper
Lexus Credit Card Login
The 15 Best Sites to Watch Movies for Free (Legally!)
Bfsfcu Truecar
WPoS's Content - Page 34
Meowiarty Puzzle
Ewg Eucerin
Plasma Donation Racine Wi
Everything You Need to Know About Ñ in Spanish | FluentU Spanish Blog
What does wym mean?
Kids and Adult Dinosaur Costume
Workboy Kennel
Craigslist Ludington Michigan
Morlan Chevrolet Sikeston
Craigslist Org Sf
Glossytightsglamour
Dadeclerk
888-333-4026
How much does Painttool SAI costs?
Flags Half Staff Today Wisconsin
Sound Of Freedom Showtimes Near Lewisburg Cinema 8
Thothd Download
Squalicum Family Medicine
Best Haircut Shop Near Me
Matt Brickman Wikipedia
Lebron James Name Soundalikes
Turok: Dinosaur Hunter
How To Win The Race In Sneaky Sasquatch
Pulpo Yonke Houston Tx
Obituaries in Westchester, NY | The Journal News
Latest Posts
Article information

Author: Kareem Mueller DO

Last Updated:

Views: 5660

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Kareem Mueller DO

Birthday: 1997-01-04

Address: Apt. 156 12935 Runolfsdottir Mission, Greenfort, MN 74384-6749

Phone: +16704982844747

Job: Corporate Administration Planner

Hobby: Mountain biking, Jewelry making, Stone skipping, Lacemaking, Knife making, Scrapbooking, Letterboxing

Introduction: My name is Kareem Mueller DO, I am a vivacious, super, thoughtful, excited, handsome, beautiful, combative person who loves writing and wants to share my knowledge and understanding with you.