Getting started with Cardano testnets
To get started and join Cardano testnets, you should install and configure the Cardano node and the command line interface (CLI), configure your testing environment, and generate payment keys and addresses. Note, that you will also need to get some test ada to test your transactions.
System requirements
The Cardano node can run on the following platforms:
- Linux Ubuntu 19.10 (Eoan Ermine) or later
- Linux Mint 19.3 (Tricia) or later
- Linux Debian 10.3 (Buster) or later
- MacOSX 10.14.0 (Mojave) or later
- Windows 10.
Installing the node
Download the latest version of the node:
Check your executables. The latest versions of the Cardano node and CLI can be found here:
There are a number of ways to install and run a Cardano node on testnet. The choice of the best-matching method depends on the operating system, level of technical expertise, and personal preferences.
For more information on the various options, see:
Configurations
To start working with the node, it is essential to ensure that the node configuration, genesis, and topology files are correctly set up. In addition, the node will need the configuration files specific to each era that the Cardano network has experienced thus far.
These configurations tell the node how to handle the updates that come with each era (ie, Mary, Alonzo, Babbage, etc). Each new era (implemented using the hard fork combinator technology) introduces protocol changes and new ledger rules. While old configurations are still valid, the new configurations and features offer new rules and improvements. In the Babbage era, for example, Plutus V2 scripts work better than Plutus V1 scripts. Plutus V1 scripts, however, are still supported.
For more details, see:
Working with the Cardano testnets
Note that mainnet and testnet commands are very similar except for the flag
usage. For example, when interacting with cardano-cli on mainnet, you should add
the --mainnet
flag. However, to use the same commands on testnets, you should
use the --testnet-magic INTEGER
flag instead.
INTEGER
indicates the number of the testnet:
- Preview integer is
2
- Pre-production integer is
1
Creating keys and addresses
To send and receive transactions, you should first create the payment key pair:
cardano-cli address key-gen \
--verification-key-file payment.vkey \
--signing-key-file payment.skey
This creates two files: payment.vkey
(the public verification key) and
payment.skey
(the private signing key).
Both verification keys (payment.vkey and stake.vkey) are used to build the address and the resulting payment address is associated with these keys.
To build the address, run:
cardano-cli address build \
--payment-verification-key-file payment.vkey \
--stake-verification-key-file stake.vkey \
--out-file payment.addr \
--testnet-magic INTEGER
To query the balance of the address, run:
cardano-cli query utxo \
--address $(cat payment.addr) \
--testnet-magic INTEGER
For more commands, see:
Note to use the --testnet-magic INTEGER
flag instead of --mainnet
.
Funding the address using a faucet
To fund your testnet address, go to the testnets faucet and request some test ada:
If you're working in a pre-production environment and have an API key, you can run the following command to fund your address:
curl -X POST -s 'https://faucet.preprod.world.dev.cardano.org/send-money/YOURADDRESS?api_key=YOURAPIKEY'
Creating, signing, and submitting transactions
You’re now ready to create, sign, and submit transactions on testnets. See the tutorials: