This project uses hardhat and chainlink data feeds to retrieve the real-time prices for BTC/USD, ETH/USD, GOLD/USD, and DAI/USD. Users can also input a value for any of these currencies and get the equivalent amount in USD.
To use this project, you will need the following:
- Node.js and npm (included with Node.js)
- Hardhat
- Chainlink
git clone https://github.com/Patrick-Ehimen/Chainlink-PriceFeeds
cd Chainlink-PriceFeeds
npm install
To use this project, follow these steps:
-
Start the Hardhat development environment:
npx hardhat
-
Setup environment variables You'll want to set your
GOERLI_RPC_URL
andPRIVATE_KEY
as environment variables. You can create and add them to a.env
file. -
PRIVATE_KEY
: The private key of your account (like from metamask). NOTE: FOR DEVELOPMENT, PLEASE USE A KEY THAT DOESN'T HAVE ANY REAL FUNDS ASSOCIATED WITH IT. -
GOERLI_RPC_URL
: This is url of the goerli testnet node you're working with. You can get setup with one for free from Alchemy. -
Get testnet ETH Head over to faucets.chain.link and get some tesnet ETH.
-
Compile and deploy the contracts to the Goerli testnet.
npx hardhat compile
npx hardhat run scripts/deploy.js --network goerli
Here's the address of the deployed contract. 0xfd1B7282C7D457a28B4F3177c6a8b1C7B6D2c20F