Getting Started with Cardano Testnets and dApp Testings

Brave Dogs
4 min readApr 8, 2023

--

Developing a decentralized application (dApp) is a cumbersome process that involves multiple phases such as designing, developing, testing, integration, and deployment.

In this article, we will discuss dApp testing on Cardano as it’s one of the most crucial phases for any dApp. Sending a user many tokens by mistake is the last thing you want to do as a BlockChain dev.

Why is testing so important? Let’s assume you are building a Messaging app on Cardano where anyone can connect their wallet and send some ADA to another wallet with a message. You have to ensure that you are building the transaction correctly; setting up rollback in case of tx failure, making sure there was no protocol violation, such as the min utxo rule, and so on.

All of these will require intensive testing during development and before the final production deployment.

But how would you test something on BlockChain, where every transaction includes a transaction fee? If you are to perform 100 transactions during development, you will lose 100*0.2 = 20 ADA just for the transaction fee. Not to mention, things will get more expensive as you go deeper such as Minting or Burning FT/NFT or interacting with smart contracts. This is where Cardano Testnet comes in handy.

What is Cardano Testnet?

The testnet is a separate parallel network on which anyone can make a transaction with tAda (not ADA), and test their application before the application is deployed on the mainnet. The testnet ADA, also known as tAda (t₳) is free to claim, and we will show you how to get some.

But first, we have to make some adjustments in our Browser wallet. By default, all browser wallets (Nami, Typhon, Eternl, et c) are set to mainnet and interact with the real ADA. We have to switch the wallet to a testnet network for our testing purpose.

Switch Cardano Wallets to Testnet

Each Cardano wallet has different ways to switch networks. This article will demonstrate the process for Nami, Eternl, and Typhon wallets only. Let’s start with the Nami wallet first.

Nami Wallet:

  • Click on the avatar from the top right corner
  • Go to Settings => Network
  • Change the network from “Mainnet” to “Preprod”.

Cardano has three different testnets. Preview, Preprod, and the legacy testnet. You can learn more about them here — https://developers.cardano.org/docs/get-started/testnets-and-devnets/

Eternl:

  • Click on the “mainnet” text on the bottom right side of the wallet.
  • A popup window will appear, select “Pre-Production Testnet”
  • You might have to open a new wallet with seed-phase for testnet. But don’t worry, your mainnet wallet is safe and you will be able to switch back again at any time without having to enter the seed-phase again.

Typhon

Typhon Wallet is really easy to switch. Just click on the “Cardano Mainnet” dropdown and change this to “Cardano Testnet”. That’s it.

Get Some Free tAda

Now that we have our testnet wallet setup, we will need some tAda to make a payment or test something. Let’s get some free tAda then.

First, let’s go to Cardano Testnet Faucet from here — https://docs.cardano.org/cardano-testnet/tools/faucet

Then scroll down to the bottom of the page and you will find a form like this.

  • Select the environment as “Preprod Testnet”.
  • Select action “Receive test ADA”
  • Enter your testnet address
  • Leave the API Key empty
  • Click Request Funds.

That’s it. Your funds should arrive in your wallet within a few minutes.

Useful Links:-

--

--

Brave Dogs

Brave Dogs are here to establish a brand within the Cardano ecosystem, created and driven by a community of creators, developers, and innovators.