Chainlink VRF (random number) example
See https://docs.chain.link/docs/get-a-random-number/
Set up
- Clone repo =P
npm i
cp .env.sample .env
- Populate .env with a Kovan provider and a private key that has Kovan ETH
Testing
- Run
npx hardhat run scripts/deploy.js
- Get your deployed contract some LINK: https://faucets.chain.link/kovan
- Run
npx hardhat run scripts/get-random-number.js
- (in another terminal) Run
npx hardhat run scripts/monitor-random-numbers.js
- Repeat 2 ad infinitum