DataNexus is a decentralized, peer-to-peer market that enables average, everyday people to control their data. Businesses are able to securely purchase personal data generated from web APIs. Using Chainlink functions along with a streamlined encryption scheme, user secrets and personal data are never revealed publicly. The data is only revealed to the purchaser upon transfer of funds.
- Install dependencies:
yarn install
- Compile Contracts:
yarn hardhat compile
To run the following tests, you have to have a .env
file configured. Copy the .env.example
and fill in the require environemnt variables.
- You can create RPC URL using Alchemy or Chainlist for testnet.
- Get your private key from Metamask ** MAKE SURE YOU'RE USING A TEST ACOCUNT WITH NO REAL FUNDS **
- Get Coinmarketcap API Key
- Follow the instructions here to generate a Github API token
- Use the Google OAuth 2.0 Playground to generate a temporary access token (these only last an hour).
- Get a NFT.storage API Key
- Clone frontend repo in the same root directory
git clone https://github.com/DataMineMarket/Frontend.git
- Set
UPDATE_FRONT_END=true
in.env
- Now, upon deployment, the frontend will be updated with the relevant contract addresses and ABIs.
The local tests use Chainlink's functions toolkit to simulate functions executions localy.
- Create a file
test/helper/secrets.json
, this will be populated with a local private key after running the test command below. - Run
yarn hardhat test
to run the local tests
This test will run on mumbai testnet, and will use real testnet funds.
Prerequisite: Get USDC from the AAVE Faucet. You will need to enable testnet mode at the top right.
- Run
yarn hardhat deploy --network mumbai
- The deploy script will automatically update your subscription with a newly created consumer.
- Make sure your subscription Id is configured in
functionsSubscriptionId
inhelper-hardhat-config.ts
- Make sure your subscription Id is configured in
- Run
yarn hardhat test --network mumbai