-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Windows Development Setup
This guide is meant to give developers on Windows a starting point for Chainlink development.
Install Chocolatey
Chocolatey allows for simple package management on Windows (similar to apt and yum for Linux). In an elevated PowerShell prompt, run:
C:\> choco install -y mingw make git python2 curl nodejs golang yarn
After this point, Windows commands should be ran from a normal (non-administrative) PowerShell prompt.
Install and Configure Docker
Setting up Docker on Windows is out of scope for this guide. Docker requires Windows 10 Pro or Enterprise to install.
Alternatively, you can run Parity directly in an elevated PowerShell prompt, but you will need to invoke it as parity.exe --config miner.toml
, and you will need the required DevNet files.
C:\> mkdir $env:USERPROFILE\go\bin
C:\> [Environment]::SetEnvironmentVariable("GOPATH", "$env:USERPROFILE\go", "User")
C:\> [Environment]::SetEnvironmentVariable("PATH", "C:\tools\mingw64\bin;$env:ProgramFiles\Docker\Docker\Resources\bin;$env:USERPROFILE\go\bin;$env:APPDATA\npm;$env:Path", "User")
Close and re-open Powershell.
C:\> npm install -g truffle
C:\> go get -u github.com/golang/dep/cmd/dep
C:\> go get -d github.com/smartcontractkit/chainlink
C:\> cd $env:GOPATH\src\github.com\smartcontractkit\chainlink
C:\> dep ensure
C:\> go install
At this point, you can import a keystore file if you need.
C:\> docker run -p 18545:8545 -p 18546:8546 smartcontract/devnet:latest
C:\> cd solidity
C:\> yarn install
C:\> truffle migrate --network devnet
C:\> truffle console --network devnet
You can use the Truffle Console to interact with the deployed contracts:
truffle(devnet)> GetterSetter.deployed().then(con => con.getUint256())
truffle(devnet)> GetterSetter.deployed().then(con => con.setUint256(45))
truffle(devnet)> GetterSetter.deployed().then(con => con.getUint256())
Go to System > Advanced system settings > Environment Variables
Add the following variables under System Variables
Variable name | Variable value |
---|---|
LOG_LEVEL | debug |
ROOT | $env:GOPATH\src\github.com\smartcontractkit\chainlink\internal\devnet |
ETH_URL | ws://localhost:18546 |
ETH_CHAIN_ID | 17 |
TX_MIN_CONFIRMATIONS | 2 |
USERNAME | chainlink |
PASSWORD | twochains |
C:\> chainlink node -d -p "T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ"
You can now add JobSpecs (after setting the $USERNAME and $PASSWORD variables in the other window)
C:\> chainlink c internal/fixtures/web/hello_world_job.json
View JobSpecs
C:\> chainlink s $JOBID
Start JobRuns
C:\> chainlink r $JOBID