DEV Community

EgorMajj
EgorMajj

Posted on

Deploying the contract in the Aleo test network

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
6. Creating a Leo program
In the terminal we enter

cd $HOME/Desktop
mkdir demo_deploy_Leo_app && cd demo_deploy_Leo_app
Enter fullscreen mode Exit fullscreen mode

7. WALLETADDRESS
The wallet you copied in step 4

WALLETADDRESS=Here's the wallet address”
Enter fullscreen mode Exit fullscreen mode

8. Creating a program name

APPNAME=helloworld_${WALLETADDRESS:4:6}
Enter fullscreen mode Exit fullscreen mode

9. Creating a Leo test application.

leo new ${APPNAME}
Enter fullscreen mode Exit fullscreen mode

Leo new will automatically create a basic hello world program.

10. Launching the Leo app

cd ${APPNAME} && leo run && cd -
Enter fullscreen mode Exit fullscreen mode

11. Save the program path

PATHTOAPP=$(realpath -q $APPNAME)
Enter fullscreen mode Exit fullscreen mode

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

cd $PATHTOAPP && cd ..
Enter fullscreen mode Exit fullscreen mode

17. Assign $PRIVATEKEY to the private address from step 4

PRIVATEKEY=Here is the private key
Enter fullscreen mode Exit fullscreen mode

18. Assign $RECORD to the open text entry you saved earlier

19. Deploy Leo

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}"
Enter fullscreen mode Exit fullscreen mode

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

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay