{"id":26513668,"url":"https://github.com/ashnkumar/etn-task-ai-marketplace","last_synced_at":"2026-04-10T15:03:13.896Z","repository":{"id":281258848,"uuid":"944312343","full_name":"ashnkumar/etn-task-ai-marketplace","owner":"ashnkumar","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-07T22:20:11.000Z","size":240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-07T22:26:24.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashnkumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-07T06:08:56.000Z","updated_at":"2025-03-07T22:20:14.000Z","dependencies_parsed_at":"2025-03-07T22:36:41.766Z","dependency_job_id":null,"html_url":"https://github.com/ashnkumar/etn-task-ai-marketplace","commit_stats":null,"previous_names":["ashnkumar/etn-task-ai-marketplace"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Fetn-task-ai-marketplace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Fetn-task-ai-marketplace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Fetn-task-ai-marketplace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashnkumar%2Fetn-task-ai-marketplace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashnkumar","download_url":"https://codeload.github.com/ashnkumar/etn-task-ai-marketplace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244736924,"owners_count":20501563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-21T04:29:15.862Z","updated_at":"2025-12-30T21:32:30.895Z","avatar_url":"https://github.com/ashnkumar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ETN Task AI Marketplace\n\nA decentralized marketplace for AI services powered by Electroneum (ETN) blockchain micropayments. This platform allows users to access various AI-powered tools and services by paying small amounts of ETN cryptocurrency.\n\n## Features\n\n- **Multiple AI Services**: Access various AI tools including code assistants, image generators, text analyzers, and more\n- **Micropayments**: Pay small amounts of ETN for each service use\n- **Blockchain Integration**: Transparent, secure payment system using Electroneum blockchain\n- **Streaming Responses**: Real-time responses for text-based services\n- **Multi-environment Support**: Run on both Electroneum testnet and mainnet\n\n## Project Structure\n\n- `/frontend`: Next.js application with the marketplace UI\n- `/backend`: Node.js API server that handles payment verification and AI service execution\n- `/contracts`: Solidity smart contracts for handling ETN payments \n- `/shared`: Common files shared across services\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n- [Node.js](https://nodejs.org/) v16 or later\n- [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/)\n- [MetaMask](https://metamask.io/) browser extension\n- ETN tokens (testnet or mainnet, depending on deployment)\n\n## Installation \u0026 Setup\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/yourusername/etn-task-ai.git\ncd etn-task-ai\n```\n\n### 2. Install Dependencies\n\n```bash\n# Install root dependencies\nnpm install\n\n# Install frontend dependencies\ncd frontend\nnpm install\ncd ..\n\n# Install backend dependencies\ncd backend\nnpm install\ncd ..\n\n# Install contract dependencies\ncd contracts\nnpm install\ncd ..\n\n# Alternatively, use the script to install all dependencies at once\nnpm run install-all\n```\n\n### 3. Set Up Environment Variables\n\nThe project uses environment files to configure different deployment environments (testnet/mainnet). You'll need to set up these files:\n\n#### Backend Configuration\n\n```bash\ncd backend\ncp .env.example .env\n```\n\nEdit `.env` and set the following variables:\n- `OPENAI_API_KEY`: Your OpenAI API key\n- `CONTRACT_ADDRESS`: The deployed contract address (leave empty for now if deploying a new contract)\n- `ENVIRONMENT`: Set to \"testnet\" for development or \"mainnet\" for production\n\n#### Frontend Configuration\n\n```bash\ncd frontend\ncp .env.example .env.local\n```\n\nEdit `.env.local` and set the following variables:\n- `NEXT_PUBLIC_CONTRACT_ADDRESS`: The deployed contract address (leave empty for now if deploying a new contract)\n- `NEXT_PUBLIC_ELECTRONEUM_CHAIN_ID`: 5201420 for testnet, 52014 for mainnet\n- `NEXT_PUBLIC_ENV`: Set to \"testnet\" for development or \"mainnet\" for production\n\n#### Contracts Configuration\n\n```bash\ncd contracts\ncp .env.example .env\n```\n\nEdit `.env` and set the following variables:\n- `PRIVATE_KEY`: Your wallet's private key (for contract deployment)\n- `PROVIDER_ADDRESS`: The wallet address that will receive service fees\n- `ENVIRONMENT`: Set to \"testnet\" for development or \"mainnet\" for production\n\n### 4. Deploy Smart Contract\n\nYou need to deploy the smart contract to the Electroneum blockchain:\n\n```bash\ncd contracts\n\n# Compile the contract\nnpx hardhat compile\n\n# Deploy to testnet (default)\nnpx hardhat run scripts/deploy.js --network electroneum\n\n# Or deploy to mainnet (make sure ENVIRONMENT=mainnet in .env)\n# npx hardhat run scripts/deploy.js --network electroneum\n```\n\nAfter deployment, save the contract address and update all `.env` files.\n\n### 5. Register Services\n\nOnce the contract is deployed, register the available services:\n\n```bash\ncd contracts\nnpx hardhat run scripts/register-services.js --network electroneum\n```\n\nVerify the services were registered successfully:\n\n```bash\nnpx hardhat run scripts/check-services.js --network electroneum\n```\n\n### 6. Start Development Servers\n\nIn separate terminal windows, start the backend and frontend servers:\n\n```bash\n# Start backend server (http://localhost:4000)\ncd backend\nnpm run dev\n\n# Start frontend server (http://localhost:3000)\ncd frontend\nnpm run dev\n\n# Or use the combined script from the root directory\nnpm run dev\n```\n\nNow, you can access the marketplace at [http://localhost:3000](http://localhost:3000)\n\n## Using the ETN Task AI Marketplace\n\n### 1. Connect Your Wallet\n\n1. Visit [http://localhost:3000](http://localhost:3000)\n2. Click \"Connect Wallet\" in the top right corner\n3. Approve the connection in MetaMask\n4. If prompted, switch to the Electroneum network\n\n### 2. Set Up Electroneum Network in MetaMask\n\nIf you haven't added the Electroneum network to MetaMask, the app will prompt you to add it. Alternatively, you can add it manually:\n\n#### Electroneum Testnet\n- Network Name: Electroneum Testnet\n- RPC URL: https://rpc.ankr.com/electroneum_testnet\n- Chain ID: 5201420\n- Currency Symbol: ETN\n- Block Explorer URL: https://testnet-blockexplorer.electroneum.com\n\n#### Electroneum Mainnet\n- Network Name: Electroneum Mainnet\n- RPC URL: https://rpc.ankr.com/electroneum\n- Chain ID: 52014\n- Currency Symbol: ETN\n- Block Explorer URL: https://blockexplorer.electroneum.com\n\n### 3. Getting Testnet ETN\n\nFor testing on testnet, you can get free testnet ETN from:\n- Electroneum Testnet Faucet (if available)\n- Contact the Electroneum community or team for testnet tokens\n\n### 4. Using AI Services\n\n1. Browse the available services on the marketplace homepage\n2. Click on a service to view details\n3. Enter your input or upload a file (if supported)\n4. Click \"Process\" and confirm the ETN payment in MetaMask\n5. Wait for the transaction to be confirmed on the blockchain\n6. View your results and download if applicable\n\n## Deployment Options\n\n### Testnet vs. Mainnet\n\nThe project supports both testnet and mainnet deployment. For a testnet deployment, make sure all environment files use:\n- `ENVIRONMENT=testnet`\n- `NEXT_PUBLIC_ENV=testnet`\n- `NEXT_PUBLIC_ELECTRONEUM_CHAIN_ID=5201420`\n\nFor mainnet, use:\n- `ENVIRONMENT=mainnet`\n- `NEXT_PUBLIC_ENV=mainnet`\n- `NEXT_PUBLIC_ELECTRONEUM_CHAIN_ID=52014`\n\n### Quick Deployment Script\n\nThe repository includes a script to streamline deployment:\n\n```bash\n./deploy.sh [testnet|mainnet]\n```\n\nThis script:\n1. Sets up the appropriate environment\n2. Deploys the contract\n3. Updates configuration files with the deployed contract address\n4. Registers services\n\n## Troubleshooting\n\n### MetaMask Connection Issues\n\n- Ensure MetaMask is unlocked\n- Check that you're connected to the correct Electroneum network\n- Try refreshing the page or disconnecting and reconnecting\n\n### Transaction Failures\n\n- Ensure you have enough ETN for gas fees plus the service cost\n- Check that the contract address in your environment files matches the deployed contract\n- Verify that services were properly registered on the contract\n\n### Backend API Errors\n\n- Check that your OpenAI API key is valid\n- Ensure the backend is running and accessible from the frontend\n- Verify that the contract address matches between frontend and backend\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Electroneum for the blockchain platform\n- OpenAI for the AI APIs\n- shadcn/ui for the UI components\n- Hardhat for the smart contract development framework","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashnkumar%2Fetn-task-ai-marketplace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashnkumar%2Fetn-task-ai-marketplace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashnkumar%2Fetn-task-ai-marketplace/lists"}