Note: This repo is archived due to some nodes not being live anymore.
This is a repo to work with and use Chainlink smart contracts with the google weather node. If you're brand new to Chainlink, check out the beginner walkthroughs in remix to learn the basics.
You can also check out the more advanced Chainlink tutorials there as well.
- Prerequisites
- Installation
- Testnet Development
- Local Development
- Running Scripts and Deployment
- Resources
- License
Please install or have installed the following:
- Install Brownie, if you haven't already. Here is a simple way to install brownie.
python3 -m pip install --user pipx
python3 -m pipx ensurepath
# restart your terminal
pipx install eth-brownie
Or, if that doesn't work, via pip
pip install eth-brownie
- Download the mix and install dependancies.
git clone https://github.com/PatrickAlphaC/gcp-weather
cd gcp-weather
pip install -r requirements.txt
This will open up a new Chainlink project. Or, you can clone from source:
git clone https://github.com/PatrickAlphaC/chainlink-mix
cd chainlink-mix
If you want to be able to deploy to testnets, do the following.
Set your WEB3_INFURA_PROJECT_ID
, and PRIVATE_KEY
environment variables.
You can get a WEB3_INFURA_PROJECT_ID
by getting a free trial of Infura. At the moment, it does need to be infura with brownie. If you get lost, you can follow this guide to getting a project key. You can find your PRIVATE_KEY
from your ethereum wallet like metamask.
You'll also need testnet ETH and LINK. You can get LINK and ETH into your wallet by using the faucets located here. If you're new to this, watch this video.. Look at the rinkeby
and kovan
sections for those specific testnet faucets.
You can add your environment variables to a .env
file. You can use the .env.exmple as a template, just fill in the values and rename it to '.env'. Then, uncomment the line # dotenv: .env
in brownie-config.yaml
Here is what your .env
should look like:
export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>
AND THEN RUN source .env
TO ACTIVATE THE ENV VARIABLES
(You'll need to do this everytime you open a new terminal, or learn how to set them easier)
DO NOT SEND YOUR PRIVATE KEY WITH FUNDS IN IT ONTO GITHUB
Otherwise, you can build, test, and deploy on your local environment.
For local testing install ganache-cli
npm install -g ganache-cli
or
yarn add global ganache-cli
All the scripts are designed to work locally or on a testnet. You can add a ganache-cli or ganache UI chain like so:
brownie networks add Ethereum ganache host=http://localhost:8545 chainid=1337
And update the brownie config accordingly. There is a deploy_mocks
script that will launch and deploy mock Oracles, VRFCoordinators, Link Tokens, and Price Feeds on a Local Blockchain.
brownie run scripts/deploy.py --network kovan
To get started with Brownie:
- Chainlink Documentation
- Check out the Chainlink documentation to get started from any level of smart contract engineering.
- Check out the other Brownie mixes that can be used as a starting point for your own contracts. They also provide example code to help you get started.
- "Getting Started with Brownie" is a good tutorial to help you familiarize yourself with Brownie.
- For more in-depth information, read the Brownie documentation.
Any questions? Join our Discord
This project is licensed under the MIT license.