Skip to content

KaiStryker/Lottery_UsingChainLink

Repository files navigation

Lottery Contract using Chainlink

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.

Requirements

  • NPM
  • TRUFFLE

Installation

  1. Install truffle
npm install truffle -g
  1. clone repo
git clone https://github.com/KaiStryker/Lottery_UsingChainLink.git
  1. Install dependencies by running:
npm install

# OR...

yarn install

Test

truffle test

Deploy

For 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:kovan

You can also run:

truffle migrate --network kovan --reset

If you want to use truffle commands.

Local Blockchain

⚠️ 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

About

Lottery contract that uses Chainlink's oracle network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published