A decentralized counter app that keeps count of the number of dogs and the number of cats in a batch of uploaded pictures.
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.
-
Node.js - It's recommended that you install a LTS version of Node using nvm
-
Solana Tool Suite - You can see the installation instructions here.
-
Anchor - You can find the installation instructions here.
-
Solana browser wallet - The recommended wallet is Phantom.
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:
- Install the dependencies
npm install
- Start a local Solana node
solana-test-validator
- Build the anchor project
anchor build
- Fetch the project ID for the build:
solana address -k target/deploy/<programname>-keypair.json
-
Update the project ID in the Rust program located at myepicproject/programs/src/lib.rs with the output from above.
-
Run the tests
anchor test
- Change into the frontend directory and install the dependencies:
cd app && npm install
- Run the client-side app
npm start
- If you need to you can airdrop solana to your address using:
solana airdrop 2 <YOURPUBKEY>
Have fun!