Skip to content

UPCodersEEBE/Blockchain-AI-Pet-Counter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Anchor Counter

A decentralized counter app that keeps count of the number of dogs and the number of cats in a batch of uploaded pictures.

Description

This program is an entry to the MLH Fellowship Orientation Hackathon. It runs on a Solana smart contract written with the Anchor framework in Rust and Javascript + React for the frontend.

It takes a link to the picture in the frontend, identifies the number of dogs and cats in the picture using code written in Tensorflow.js, and sends the results to the Rust backend. The backend code iteratively updates its own dog count and cat count values each time and displays the count to the user.

Prerequisites

  1. Node.js - It's recommended that you install a LTS version of Node using nvm

  2. Solana Tool Suite - You can see the installation instructions here.

  3. Anchor - You can find the installation instructions here.

  4. Solana browser wallet - The recommended wallet is Phantom.

Build

Welcome to our Anchor Counter App made at MLH Fellowship ^_^ !

You would probably need to install Solana, Anchor and Rust to make it run. If you haven't already, install those dependencies by following this tutorial : https://project-serum.github.io/anchor/getting-started/installation.html or the steps in the prerequisites section above.

When you are set up, you can clone the repo and run the App by changing into the project directory and running the following commands:

  1. Install the dependencies
npm install
  1. Start a local Solana node
solana-test-validator
  1. Build the anchor project
anchor build
  1. Fetch the project ID for the build:
solana address -k target/deploy/<programname>-keypair.json
  1. Update the project ID in the Rust program located at myepicproject/programs/src/lib.rs with the output from above.

  2. Run the tests

anchor test
  1. Change into the frontend directory and install the dependencies:
cd app && npm install
  1. Run the client-side app
npm start
  1. If you need to you can airdrop solana to your address using:
solana airdrop 2 <YOURPUBKEY>

Have fun!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 58.5%
  • CSS 14.4%
  • HTML 14.2%
  • Rust 12.9%