Use Google Cloud
Go to Google Cloud, setup an account.Setup a default small VM
Create a new VM with all default settings. Note the IP. This will be running Debian by default with 4GB of RAM. Add your SSH key so you can login and connect to your server.Install Docker
- SSH into your machine and run:
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker $USER
exit
# log in again
Preconfigure your node
mkdir ~/.chainlink-kovan
echo "ROOT=/chainlink
LOG_LEVEL=debug
ETH_CHAIN_ID=42
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
ALLOW_ORIGINS=*" > ~/.chainlink-kovan/.env
Setup Alchemy for Blockchain Access
- Visit Alchemy and set up an account. Click on "Create App".
- Name it "Chainlink Node" and pick
Kovan
as your network. - Click on "View Key" and copy the WEBSOCKETS url (
wss://eth-kovan.alchemyapi.io/v2/...
) - echo "ETHURL=wss://..." >> ~/.chainlink-kovan/.env
Setup PostgreSQL for storage
- Visit the Cloud SQL Home Page.
- "Create Instance"
- "PostgreSQL"
- Fill out the form. Generate and save a password
- Save yourself some money for now by choosing
Single zone
- Create your instance
- Visit "Databases" and create a "chainlink" database
- (optional) setup a new username & password for your DB
- Under
Connections
, add an Authorized Network with the IP of your VM. eg. (10.0.0.39/32)
Give your node access to your PostgreSQL database
echo "DATABASE_URL=postgresql://postgres:<YOURPASSWORD>@YOURDATABASEIPADDRESS/chainlink" >> ~/.chainlink-kovan/.env
Start the node
cd ~/.chainlink-kovan && docker run -p 6688:6688 -v ~/.chainlink-kovan:/chainlink -it --env-file=.env smartcontract/chainlink:1.1.0 local n
Choose a secure key store password with 3 numbers and 3 symbols.
Choose an email and password which you will use to login to the GUI.
Connect and login to your node
Use an SSH tunnel to get access to your node securelyssh -L 6688:localhost:6688 <NODE IP>
Then visit localhost:6688 on your computer.
If you are able to login, your node is running! Wohoo!
Click on the gear in the upper right, click
Key Management
then save your account address. You'll need this later.Setup your Oracle Node
In order for your node to do anything, you'll have to- Deploy the Operator contract
Fix the imports so you can load it on Remix:
import "@chainlink/contracts/src/v0.7/AuthorizedReceiver.sol";
import "@chainlink/contracts/src/v0.7/LinkTokenReceiver.sol";
import "@chainlink/contracts/src/v0.7/ConfirmedOwner.sol";
import "@chainlink/contracts/src/v0.7/interfaces/LinkTokenInterface.sol";
import "@chainlink/contracts/src/v0.7/interfaces/OperatorInterface.sol";
import "@chainlink/contracts/src/v0.7/interfaces/OwnableInterface.sol";
import "@chainlink/contracts/src/v0.7/interfaces/WithdrawalInterface.sol";
import "@chainlink/contracts/src/v0.7/vendor/Address.sol";
import "@chainlink/contracts/src/v0.7/vendor/SafeMathChainlink.sol";
Deploy in Remix to Kovan with the LINK token and your wallet address for ownership:
0xa36085F69e2889c224210F603D836748e7dC0088,<wallet address>
.Save the address of your Operator contract once deployed.
setAuthorizedSenders
with your node address.