# Aleo deploy contract

By [Mikhail](https://paragraph.com/@mikhail-2) · 2023-04-10

---

### SnarkOS

    sudo apt-get update -y
    sudo apt-get upgrade -y
    sudo apt-get install -y
    
    # screen session
    screen -S contract
    
    # Proceed with installation (default)
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
    git clone https://github.com/AleoHQ/snarkOS.git --depth 1
    cd snarkOS
    ./build_ubuntu.sh
    
    source $HOME/.cargo/env
    cargo install --path .
    

### Leo language

    cd
    git clone https://github.com/AleoHQ/leo
    cd leo
    cargo install --path .
    

### Test tokens

*   Generate wallet [Aleo](https://aleo.tools/) and copy `Private Key`, `View Key`, `Address`
    
*   Twitter Tokens
    

    @AleoFaucet send 10 credits to Your_Wallet_Address
    

![](https://storage.googleapis.com/papyrus_images/c66e4a709bce95f007481ed2fc8e2632bf8b242ebbea80f603dee738511feb06.png)

    # Cli Tokens: Edit Your_Wallet_Address Your_Privat_Key
    snarkos developer execute credits.aleo mint Your_Wallet_Address 100000000u64 \
    --private-key Your_Privat_Key \
    --query "https://vm.aleo.org/api" \
    --broadcast "https://vm.aleo.org/api/testnet3/transaction/broadcast"
    

### Install extension in browser [JSON Beautifier & Editor](https://chrome.google.com/webstore/detail/json-beautifier-editor/lpopeocbeepakdnipejhlpcmifheolpl/related)

*   Add transaction number from terminal to link and paste into browser.
    
*   Copy value
    
*   Add `value`, `View Key` to [Aleo](https://aleo.tools/) and copy `Record`
    

    https://vm.aleo.org/api/testnet3/transaction/at1......ynt
    

![](https://storage.googleapis.com/papyrus_images/8eb17e3879dda41de29c0029c649ab78607f94148d48e3734bed9aa9e0a23393.png)

### Deploy app

    cd $HOME
    mkdir deploy && cd deploy
    
    # Edit Your_Wallet_Address, Your_App_Name, Your_Privat_Key, Your_Record
    Wallet_Address="Your_Wallet_Address"
    App_Name=Your_App_Name_"${Wallet_Address:4:6}"
    echo $App_Name
    
    leo new "${App_Name}"
    cd "${App_Name}" && leo run && cd -
    
    Path_to_app=$(realpath -q $App_Name)
    echo $Path_to_app
    
    Privat_Key="Your_Privat_Key"
    
    Record="Your_Record"
    

    snarkos developer deploy "${App_Name}.aleo" \
    --private-key "${Privat_Key}" \
    --query "https://vm.aleo.org/api" \
    --path "./${App_Name}/build/" \
    --broadcast "https://vm.aleo.org/api/testnet3/transaction/broadcast" \
    --fee 600000 --record "${Record}"
    

    # Close screen session
    ctrl+a d
    
    # View running screen sessions
    screen -ls
    
    # Open screen session
    screen -r id_session

---

*Originally published on [Mikhail](https://paragraph.com/@mikhail-2/aleo-deploy-contract)*
