# Guide: How to Upload a Smart Contract on the Juno Chain

{% embed url="<https://youtu.be/e_-xxpfQfwU>" %}

## **Preparation:**

**Required Materials:** A computer with an internet connection, familiarity with GitHub, and basic knowledge of smart contracts.

## **Steps:**

1. **Find an Example Smart Contract:**

(Note: The steps here mainly involve browsing, no specific bash commands.)

In this tutorial we will be using [https://github.com/Reecepbcups/cw-clock-exampl](https://github.com/Reecepbcups/cw-clock-example)

2. **Connect to the Juno Testnet:**

Check out our new video that shows you how to deploy a local env

<https://github.com/Reecepbcups/cw-clock-example>

3. **Create a Juno Wallet:**

```json
bash junod keys add MyWalletName
```

**5. Claim junox Test Tokens:**

Head to Juno Discord <https://discord.com/invite/caEBtA4QDb> and find FAUCET section. In there you can get some using the API provided and inputting the wallet address you created in the previous step. <https://faucet.reece.sh/uni-6/JUNO_ADDRESS_HERE>

**6. Verify Token Receipt:**

```
junod query bank balances [YOUR_WALLET_ADDRESS]
```

**7. Configure the Juno Command Line:**

```json
bash junod config node [NODE_URL] 
junod config chain-id [CHAIN_ID] 
junod config gas auto 
junod config gas-prices 0.025ujuno
```

**8. Deploy the Smart Contract:**

Assuming you've downloaded clock\_example.wasm to your current directory

```
junod tx wasm store clock_example.wasm --from MyWalletName --gas 1500000 --chain-id [CHAIN_ID]
```

**9. Instantiate the Smart Contract:**

Replace \[CODE\_ID] with the code ID obtained from the previous step e.g 3785

```json
 junod tx wasm instantiate [CODE_ID] '{"count": 0}' --label "my-clock-instance" --from MyWalletName --amount 100ujuno
```

**10. Interact with the Smart Contract:**

Query the smart contract (replace \[CONTRACT\_ADDRESS] with the address from instantiation) junod query wasm contract \[CONTRACT\_ADDRESS]

```json

junod tx wasm execute [CONTRACT_ADDRESS] '{"increment": {}}' --from MyWalletName --amount 10ujuno
```

### **Conclusion:**

* You've now successfully uploaded, instantiated, and interacted with a smart contract on the Juno testnet.
* If you have further questions or ideas, join the Juno community on Discord, particularly the "developer lounge".

***

**Note:** Adjust the bash commands to fit your specific situation, and always double-check them, especially when working with real tokens or live environments.\\


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.junonetwork.io/developer-guides/cosmwasm-contracts/guide-how-to-upload-a-smart-contract-on-the-juno-chain.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
