5

In an idiomatic sense, what is the best way to understand the purpose of Devnet, Testnet, and Mainnet for someone completely new to the ecosystem?

Which one is usually best for building and testing a new application?

Are there any other *net's out there besides Devnet, Testnet, and Mainnet?

Is there a way to create your own *net on your local machine for local testing and development, or is that not normally good practice for app development? And if not for app development, when might one want to do this?

From a generic standpoint, how do you technically distinguish between which of the *net's you are "connecting" to whenever performing operations against Solana network systems?

1 Answer 1

8

Regarding the question if there are more networks available: Yes, there is also localhost which allows you to run a validator locally for dev purposes.

Mainnet-beta: This is the production environment. If you're just testing or developing an app you typically want to avoid using this as it will cost you real money to deploy. You only use this one when you want to deploy your program to "production".

Devnet: This is the network you'll be using the most. Devnet serves as a playground for anyone who wants to take Solana for a test drive, as a user, token holder, app developer, or validator. It's essentially the same as Mainnet with the key difference that the tokens are not real. This being the case, you can airdrop yourself tokens either using the Solana CLI or using sites like SolFaucet

Testnet: Testnet is where the Solana core contributors stress test recent release features on a live cluster, particularly focused on network performance, stability and validator behaviour.

You can read a bit more about the clusters in the Solana Docs.


CLI commands

To see which Cluster you're currently targeting:

solana config get

Changing cluster:

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

The example will change solana CLI to target devnet. By changing the URI you can target testnet, localhost, or mainnet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.