Guess The Weather is an engaging and interactive app developed for the Nillion Tinybin bounty challenge. This app allows users to forecast the temperature for the following day in Da Nang and then compare their predictions with the actual temperature retrieved from a weather API. Additionally, the app demonstrates secure data comparison using Nillion's Nada programs.
Utilizing the Nada program, the app ensures that all temperature predictions are securely encrypted and protected from unauthorized access. This maintains the confidentiality of each user's forecast for Da Nang's weather the next day.
Utilizing Nillion's innovative technology, the app securely computes and compares users' temperature predictions while ensuring the privacy of each participant is maintained.
You can forecast the temperature in Da Nang for the following day and compare your prediction with data from Open-Meteo.
Before you begin, you need to install the following tools:
-
nilup
, an installer and version manager for the Nillion SDK tools. Install nilup:For the security-conscious, please download the
install.sh
script, so that you can inspect how it works, before piping it tobash
.curl https://nilup.nilogy.xyz/install.sh | bash
- Confirm
nilup
installationnilup -V
- Confirm
-
Nillion SDK tools Use
nilup
to install these:nilup install latest nilup use latest nilup init
- Confirm global Nillion tool installation
nillion -V
- Confirm global Nillion tool installation
-
- Check version with
node -v
- Check version with
-
python3 version 3.11 or higher with a working pip installed
- Confirm that you have python3 (version >=3.11) and pip installed:
python3 --version python3 -m pip --version
- Confirm that you have python3 (version >=3.11) and pip installed:
-
- Check version with
yarn -v
- Check version with
To use this app, you need to have the MetaMask Flask browser extension installed and to store your Nillion user key in MetaMask Snaps
- Install the MetaMask Flask browser extension that will let you work with experimental snaps.
- Create a new test wallet in MetaMask Flask
- Temporarily disable any other wallet browser extensions (Classic MetaMask, Rainbow Wallet, etc.) while using MetaMask Flask
- Visit the Nillion Key Management UI to generate a user key and store it in MetaMask Snaps - this saves your user key within MetaMask so it can be used by other Nillion web apps
- This quickstart will ask you to "Connect to Snap" to use your Nillion user key
To get started, follow the steps below:
git clone https://github.com/thu142857/tinybin-nillion-blind-app.git
cd tinybin-nillion-blind-app
yarn install
This bootstraps Nillion devnet, a local network of nodes and adds cluster info to your NextJS app .env file and blockchain info to your Hardhat .env file
yarn nillion-devnet
yarn chain
This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in hardhat.config.ts
.
yarn deploy
This command deploys a test smart contract to the local network. The contract is located in packages/hardhat/contracts
and can be modified to suit your needs. The yarn deploy
command uses the deploy script located in packages/hardhat/deploy
to deploy the contract to the network. You can also customize the deploy script.
cd packages/nextjs
Install nextjs app
pnpm install
Run app
pnpm dev
Visit your app on: http://localhost:3000
.