Cardano Academy

Generating Payment Keys and Address

Make sure you have configured your cardano-cli, if you haven't, check the previous chapter.

Load environment variables

You need to run this every time you open a new terminal to load environment variables :
cd cli-workspace/testnet

Generate payment keys and address

Generate Payment Signing Key and Payment Verification Key:
cardano-cli address key-gen \
--verification-key-file ./verification-key \
--signing-key-file ./signing-key
Generate Payment Address and store it in ./address file:
cardano-cli address build \
--payment-verification-key-file ./verification-key \
--testnet-magic $TESTNET_MAGIC \
> ./address
To see your address, you can run:
cat ./address
Your address should start with addr_test.

Fund your address

If you already have ADA tokens on testnet, you can send some to the address generated above. If you don't have any, you can request some on this page.
To check funds in your address, you can run:
cardano-cli query utxo \
--address $(< ./address) \
--testnet-magic $TESTNET_MAGIC
You should get something like this:
TxHash TxIx Amount
1c7e8dd3bd6e463099e99bb104020435fcf5fe83579b7d9c3fb6b836e5b47c3a 0 1000000000 lovelace
It means I have 1,000,000,000 lovelace in my address, which equals to 1,000 ADA.