This repository showcases the application presented in the 'Hathor Network' webinar. The application comprises two APIs: an Image API that utilizes OpenAI to generate images based on prompts, and a Token API that leverages the Image API, uploads images to IPFS, and utilizes the Headless Hathor Wallet API to create NFTs.
Before getting started, ensure you have the following prerequisites installed:
- Docker: Install Docker
- Node.js: Install Node.js
The application consists of the following APIs:
- Image API: This API utilizes the OpenAI API to generate images from prompts.
- Token API: This API exposes an endpoint for creating NFTs. The Token API calls the Image API, providing the NFT metadata description as the prompt. It retrieves the generated image and uploads it to IPFS using the Infura IPFS API. Finally, it calls the Hathor Headless Wallet API to create a new NFT.
The repository is organized into the following folders:
- apis: Contains the "Token API" and "Image API" implementations.
- scripts: Provides scripts for setting up the Hathor Wallet Headless using Docker.
- collections: Includes Postman collections for interacting with the application.
Feel free to explore each folder for more detailed information.
To set up the project locally, follow these steps:
-
Run the Hathor Headless Wallet and start a wallet.
- Instructions to start the Headless Hathor Wallet API can be found in the
scripts
directory.
- Instructions to start the Headless Hathor Wallet API can be found in the
-
Run the Image API.
- Instructions to start the Image API can be found in the
apis/image-api
directory.
- Instructions to start the Image API can be found in the
-
Run the Token API.
- Instructions to start the Token API can be found in the
apis/token-api
directory.
- Instructions to start the Token API can be found in the
Once the above steps are completed, you will be able to create NFTs with images based on their metadata description.
Below is a diagram illustrating the final solution:
Thank you for your interest in the Hathor Network webinar material! We hope you find them useful.
This project is licensed under the MIT License. You are free to use, modify, and distribute this code.