Skip to content

ngocban284/vrf-survey-time

Repository files navigation

VRF SUVERY TIME

This is a time statistics application that returns a random number of the vrf contract on the blockchain binance smart chain network.

Contract :

  • VRFv2DirectFundingConsumer.sol : This is a contract that provides a function to find random numbers based on chainlink

Call transaction and listen event to calculate response time :

scripts folder:

  • Request.js : get the contract address and make a call to a large number of transactions and save the requestId in mongoDB
  • Listen.js : get the contract address and listen to the event that generates a random number and then update the response time into mongodb. However, terminating the listening must be done manually.

Schema :

  • requestId : last requestId of smart contract
  • requestTimeStamp : timestamp when calling random number function
  • responseTimestamp : timestamp when event was heard

scatterplot analyst

Get data from mongodb for scatterplot analyst

Ảnh chụp Màn hình 2022-10-21 lúc 09 43 35

Build With

  • Solidity
  • Javascript
  • MongoDB
  • Python
  • Hardhat
  • Git
  • Github

Installation

  1. Clone the repo
    https://github.com/ngocban284/vrf-survey-time.git
  1. Install NPM packages
    npm install
  1. You must enter your Environment variables
    VRF_ADDRESS = vrf contract address in bsc testnet
    MONGO_URI = your mongodb uri
  1. Request and Listen event
    npx hardhat run ./scripts/Request.js --network bscTestnet
    npx hardhat run ./scripts/Listen.js --network bscTestnet
  1. scatterplot analyst
    python3 ./analysis/index.py

Note

You must make sure vrf contract has LINK token and your wallet address must have BNB testnet

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published