hardhat-starter-kit | boilerplate code for testing , deploying , and shipping | Blockchain library
kandi X-RAY | hardhat-starter-kit Summary
kandi X-RAY | hardhat-starter-kit Summary
A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- read current price
hardhat-starter-kit Key Features
hardhat-starter-kit Examples and Code Snippets
Community Discussions
Trending Discussions on hardhat-starter-kit
QUESTION
While trying to set up a basic self-hosted unit testing environment (and CI) that tests this Chainlink VRF random number contract, I am experiencing slight difficulties in how to simulate any relevant blockchains/testnets locally.
For example, I found this repository that tests Chainlinks VRF. However, for default deployment it suggests/requires a free KOVAN_RPC_URL
e.g. from Infura's site and even for "local deployment" it suggests/requires a free MAINNET_RPC_URL
from e.g. Alchemy's site.
I adopted a unit test environment from the waffle framework which is described as:
Filestructure ...ANSWER
Answered 2021-Sep-09 at 04:35to test locally you need to make use of mocks which can simulate having an oracle network. Because you're working locally, a Chainlink node doesn't know about your local blockchain, so you can't actually do proper VRF requests. Note you can try deploy a local Chainlink node and a local blockchain and have them talk, but it isn't fully supported yet so you may get mixed results. Anyway, as per the hardhat starter kit that you linked, you can set the defaultNetwork to be 'hardhat' in the hardhat.config.js file, then when you deploy and run the integration tests (yarn test-integration), it will use mocks to mock up the VRF node, and to test the requesting of a random number. See the test here, and the mock contracts and linktoken get deployed here
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hardhat-starter-kit
After installing all the requirements, run the following:.
Clone and install dependencies
You can now do stuff!
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page