This contract uses Chainlink's oracle network to conduct a lottery game. This was a fun build that showed me the power of using Chainlink to get off-chain data. What I have learned will enhance my smart contracts signifiacntly going forward.
- NPM
- TRUFFLE
- Install truffle
npm install truffle -g- clone repo
git clone https://github.com/KaiStryker/Lottery_UsingChainLink.git- Install dependencies by running:
npm install
# OR...
yarn installtruffle testFor deploying to the kovan network, Truffle will use truffle-hdwallet-provider for your mnemonic and an RPC URL. Set your environment variables $RPC_URL and $MNEMONIC before running:
npm run migrate:kovanYou can also run:
truffle migrate --network kovan --resetIf you want to use truffle commands.
⚠️ Without a Chainlink node deployed locally, requests from smart contracts will not be responded to. It is recommended that you deploy to the Kovan network.
If needed, edit the truffle-config.js config file to set the desired network to a different port. It assumes any network is running the RPC port on 8545.
npm run migrate:dev