-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Development Setup Guide
Thomas edited this page Jun 27, 2018
·
43 revisions
Debian-based Linux (Ubuntu, Mint, etc.)
$ sudo apt install -y git build-essential python curl golang-goRed Hat-based Linux (CentOS, Fedora, etc.)
$ sudo yum groupinstall -y 'C Development Tools and Libraries'
$ sudo yum install -y git python curl golang-goMac OSX
$ brew install git curl golangWindows-based environments can follow the instructions here.
After this point, instructions should be general for any *nix flavored operating system.
Install Node.JS
$ npm install -g truffle
$ npm install -g yarnInstall Docker for Mac or Docker CE (follow instructions on site)
$ sudo gpasswd -a $USER docker
$ su $USER # Or log out and log back inEnsure you have the latest Go
$ mkdir ~/go
$ export GOPATH=~/go
$ export PATH=$PATH:/usr/local/go/bin:~/go/bin$ echo "GOPATH=$GOPATH" >> ~/.bashrc
$ echo "PATH=$PATH" >> ~/.bashrc$ go get -u github.com/golang/dep/cmd/dep$ go get -d github.com/smartcontractkit/chainlink
$ cd $GOPATH/src/github.com/smartcontractkit/chainlink$ make installAt this point, you can import a keystore file if you need.
$ ./internal/bin/devnet$ yarn install
$ cd solidity
$ truffle migrate --network development$ truffle console --network developmentYou can use the Truffle Console to interact with the deployed contracts:
truffle(Development)> GetterSetter.deployed().then(con => con.getUint256())
truffle(Development)> GetterSetter.deployed().then(con => con.setUint256(45))
truffle(Development)> GetterSetter.deployed().then(con => con.getUint256())$ ./internal/bin/cldevWhen interacting with the running node, you will need to have your USERNAME and PASSWORD environment variables set. We use direnv to automatically set these per-directory.
You can manually set them by running
$ export USERNAME=chainlink
$ export PASSWORD=twochainsYou can now add JobSpecs
$ chainlink c internal/fixtures/web/hello_world_job.jsonView JobSpecs
$ chainlink s $JOBIDStart JobRuns
$ chainlink r $JOBID