Deploying the contract in the Aleo test network
Tags: aleo, deploying, devjournal, testing
Published: 2023-04-02 20:26:10

Video Tutorial: https://youtu.be/EkNk7MnzA8s
Developer documentation: https://developer.aleo.org/testnet/getting_started/deploy_execute

**1. Installing Leo according to the official tutorial:** https://github.com/AleoHQ/leo
**2. Installing Leo according to the official tutorial:** https://github.com/AleoHQ/snarkOS
**3. Install JSON Beautifier & Editor:** https://chrome.google.com/webstore/detail/json-beautifier-editor/lpopeocbeepakdnipejhlpcmifheolpl
**4. Generate Key**
Go here https://aleo.tools/ and click Generate, copy Address separately. Be sure to save all the data!
Now you have a private key!
**5. Go to the Faucet for test tokens** https://twitter.com/AleoFaucet and request them
see the format "@AleoFaucet send 10 credits to $YOUR_WALLET_ADDRESS" below in the screenshot

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmxhymr47xix1kzubgq6.png)
**6. Creating a Leo program**
In the terminal we enter

```javascript
cd $HOME/Desktop
mkdir demo_deploy_Leo_app && cd demo_deploy_Leo_app
```
**7. WALLETADDRESS**
The wallet you copied in step 4

```javascript
WALLETADDRESS=”Here's the wallet address”
```
**8. Creating a program name**

```javascript
APPNAME=helloworld_”${WALLETADDRESS:4:6}”
```
**9. Creating a Leo test application.**

```javascript
leo new “${APPNAME}”
```
Leo new will automatically create a basic **hello world** program.

**10. Launching the Leo app**

```javascript
cd “${APPNAME}” && leo run && cd -
```
**11. Save the program path**

```javascript
PATHTOAPP=$(realpath -q $APPNAME)
```
**12. Faucet Link**
The https://twitter.com/AleoFaucet will retweet your request, you will see the link "vm.aleo.org/api/testnet3/... "and you will get the encrypted text record value.

**13. Click the link retweeted by** https://twitter.com/AleoFaucet. JSON should appear in a new window.

**14. Select `object.execution.transitions[0].outputs[0].value` and copy the saved encrypted text.**

**15. Getting your notes in plain text**
- Go to https://aleo.tools/ and click the "Record" button on the navigation bar at the top of the page.
- Place the encrypted text you copied in step 14 in the Record (Ciphertext) field.
- Place the view key in the View Key field.
- Copy the plaintext entry.
- Save the record of the plaintext!

**16. Deploying a test program**
Open the terminal
Go to the path of your application from step 11

```javascript
cd $PATHTOAPP && cd ..
```
**17. Assign $PRIVATEKEY to the private address from step 4**

```javascript
PRIVATEKEY=”Here is the private key”
```
**18. Assign $RECORD to the open text entry you saved earlier**

**19. Deploy Leo**

```javascript
snarkos developer deploy "${APPNAME}.aleo" --private-key "${PRIVATEKEY}" --query "https://vm.aleo.org/api" --path "./${APPNAME}/build/" --broadcast "https://vm.aleo.org/api/testnet3/transaction/broadcast" --fee 600000 --record "${RECORD}"
```

**20. Check**
Go to https://aleo.tools/ and type in the program name.

You will see that your program is now successfully deployed.

**If you still have questions, join the Aleo community**
- Discord: https://discord.gg/aleohq
- Twitter: https://twitter.com/AleoHQ
- GitHub: https://github.com/AleoHQ