Bild96 / Smart-Agent

😎 Smart Agent. AI image generator app - using Galadriel - the first Layer 1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

😎 Smart Agent. AI image generator app - using Galadriel - the first Layer 1

SmartAgent-coverImage

🏁 Quickstart

This quickstart covers two things:

  • Deploying an AI app to the Galadriel devnet
  • Calling your deployed AI app and viewing the results

πŸ”₯ Prerequisites

A Galadriel devnet account. We recommend creating a new EVM account for development purposes. Some devnet tokens on the account you are using. node and npm installed on your machine.

Deploying a contract on Galadriel devnet:

  1. devnet tokens Get yourself some devnet tokens from the faucet.
  2. Clone repository Clone the repo that contains Galadriel example contracts and the oracle implementation.
git clone https://github.com/bild96/smart-agent.git
cd smart-agent/contracts
  1. Setup environment Use the ||template.env|| file to create a ||.env|| file:
# Starting in repo root
cp template.env .env

Then, modify the ||.env|| file:

  • Set ||PRIVATE_KEY_GALADRIEL|| to the private key of the account you want to use for deploying the contracts to Galadriel devnet.
  • Set ||ORACLE_ADDRESS|| to the current devnet oracle address provided by Galadriel team: 0x4168668812C94a3167FCd41D12014c5498D74d7e.
  1. Install dependencies Install the dependencies using npm:
   # In repo root -> /contracts
   npm install
  1. Deploy contract to devnet The quickstart contract can be deployed with a simple script:
npm run deployQuickstart

The output of the script will show the deployed contract address. Store this and export it in terminal to call the contract later:

# Replace with your own contract address
export QUICKSTART_CONTRACT_ADDRESS=0x...

πŸ’‘ Calling your contract

Prerequisites:

  • You’ve deployed the quickstart contract in the previous step, and stored the contract address. Execute the following command to run a script that calls the deployed contract:

    npm run callQuickstart
    

The script will interactively ask for the input (DALL-E prompt: what image should be generated) and then call the contract with the input. The output, when ready, will be printed to the console. If this step fails, make sure you have set the ||QUICKSTART_CONTRACT_ADDRESS|| environment variable to the address of your deployed contract.

πŸŽ‰ You’re done! You’ve successfully created and called your own on-chain AI app.

🀳 Screenshots

galadriel Image URL

7c749d04-737b-40c2-b0f4-3a9b266eb9c3

⛏️ Built With

pythonTypescript

✍️ Authors

πŸ§‘β€πŸ’» Bild96

πŸŽ‰ Acknowledgments

πŸ—οΈ ETHGlobal HackFS Β© 2024

Join Discord

πŸͺ™ Want to show support? Just spread the word and smash the ⭐ star button

Donate ETH: 0xfd7a470001364d707c81074142b6aC9248B0b0cc

About

😎 Smart Agent. AI image generator app - using Galadriel - the first Layer 1

License:MIT License


Languages

Language:Python 38.6%Language:TypeScript 32.7%Language:Solidity 28.5%Language:Dockerfile 0.1%