# Feed Setup Guide
*Disclaimer: These instructions are made for Ubuntu 18.04. The commands may not match 100% on other distros, nor is there any guarantee that it will work. Avoid using containerization software like Docker if possible as these cause networking issues.*
# Comms
All Oracle related communications happen via Keybase in the Light Feeds channel. This includes alerts to:
* update your Oracle client
* accept invite codes
* warnings if your Feed goes down
* Feed Stipend distributions
* general notifications
Please make sure this Keybase account is being actively monitored for notifications.
Ping @master_chief on Keybase to be added to the Light Feeds channel.
# Generate Ethereum Key
You will need to generate a new Ethereum key. This key serves as your Feed's identity and is used to sign price messages. **This key is extremely sensitive**. If anyone were to obtain it, they could launch an Oracle attack from your Feed. It is critically important that this key is backed up in a secure manner.
It is highly recommended to use a client-side method of generating a key. Anything generated server-side is NOT secure. Ideally this key is generated through an Ethereum client like Geth.
**Create Wallet with Geth**
`geth account new`
**Requirements:**
- The generated key credentials should be in the form of a keystore and password.
- The first byte (0x$$) of the public key must be unique from every existing Feed.
**Current Feed Public Keys:**
```
0xaC8519b3495d8A3E3E44c041521cF7aC3f8F63B3
0x4f95d9B4D842B2E2B1d1AC3f2Cf548B93Fd77c67
0xE6367a7Da2b20ecB94A25Ef06F3b551baB2682e6
0x238A3F4C923B75F3eF8cA3473A503073f0530801
0xFbaF3a7eB4Ec2962bd1847687E56aAEE855F5D00
0x16655369Eb59F3e1cAFBCfAC6D3Dd4001328f747
0xC9508E9E3Ccf319F5333A5B8c825418ABeC688BA
0xA8EB82456ed9bAE55841529888cDE9152468635A
0x83e23C207a67a9f9cB680ce84869B91473403e7d
0xDA1d2961Da837891f43235FddF66BAD26f41368b
0x4b0E327C08e23dD08cb87Ec994915a5375619aa2
0xfeEd00AA3F0845AFE52Df9ECFE372549B74C69D2
0x8aFBD9c3D794eD8DF903b3468f4c4Ea85be953FB
0x8de9c5F1AC1D4d02bbfC25fD178f5DAA4D5B26dC
0xd94BBe83b4a68940839cD151478852d16B3eF891
0xa580BBCB1Cee2BCec4De2Ea870D20a12A964819e
0xc00584B271F378A0169dd9e5b165c0945B4fE498
0x75ef8432566A79C86BBF207A47df3963B8Cf0753
0xD27Fa2361bC2CfB9A591fb289244C538E190684B
0x60da93D9903cb7d3eD450D4F81D402f7C4F71dd9
0x71eCFF5261bAA115dcB1D9335c88678324b8A987
0x77eb6cf8d732fe4d92c427fcdd83142db3b742f7
0xD09506dAC64aaA718b45346a032F934602e29cca
0x8ff6a38A1CD6a42cAac45F08eB0c802253f68dfD
```
**Sign and Publish Keys:**
Once you've generated a key, please sign a message saying:
```We are MyCrypto and our Feed key is <address>```
And publish the message and signature on the Maker Forum thread containing your application.
# Setting Up Your VPS
**Login to VPS as root:**
`ssh root@<PEER_IP>`
**Patch system:**
`apt-get update && apt-get upgrade -y`
**Create a new user:**
```
adduser <USER>
usermod -aG sudo <USER>
```
*do NOT make your username contain the word omnia!*
**Sync ssh permissions to new user:**
`rsync --archive --chown=<USER>:<USER> ~/.ssh /home/<USER>`
**Ensure .ssh permissions are set correctly**
```
chmod 700 /home/<USER>/.ssh
chmod 644 /home/<USER>/.ssh/authorized_keys
```
**Save login to Env on Workstation**
**Logout of VPS**
`logout`
**Append to .profile configuration on your workstation**
```
echo 'export MYFEED=”<USER>@<PEER_IP>” ' >>~/.profile
source ~/.profile
```
**Login to VPS as user**
`ssh $MYFEED`
# Install Feed
**Install Nix**
```
curl https://nixos.org/nix/install | sh
. /home/<USER>/.nix-profile/etc/profile.d/nix.sh
```
**Configure Feed Environment**
```
vim ~/caps.json
```
**Paste the following snippet into caps config and save the file:**
```
{
"shs": "GJFglKL+yGTDOGareRQ94KCOahWxweZHlCa/mGydb04=",
"sign": "aN1TlR7OLxDaGbGsyPzH7Pqasv0WfX9Yvpht7KuB2K8="
}
```
**Install Omnia and Dependencies**
`nix-env -i --verbose -f https://github.com/makerdao/oracles-v2/tarball/stable`
Go make a coffee, this will take some time
**Configure Scuttlebot and Omnia**
```
install-omnia feed --ssb-caps ~/caps.json --ssb-external <your external ip here>
```
**Configure Omnia Config File**
*install-omnia will have copied the omnia configuration file to /etc/omnia.conf
Three fields will need to be changed ethereum.(from, keystore, and password)*
`sudo vim /etc/omnia.conf`
*Replace `ethereum.from` with you ethereum public key*
*Replace `ethereum.keystore` with the path to the directory containing your keystore*
*Replace `ethereum.password` with the path to the file containing the password to unlock your keystore*
**Set Scuttlebot and Omnia as systemd services and schedule to run on system boot**
```
sudo systemctl daemon-reload
sudo systemctl enable --now ssb-server
sudo systemctl enable --now omnia
```
**[fyi] To stop running Omnia and Scuttlebot**
```
sudo systemctl stop ssb-server
sudo systemctl stop omnia
```
**[fyi] To stop Omnia and Scuttlebot from starting on system boot**
```
sudo systemctl disable --now ssb-server
sudo systemctl disable --now omnia
```
# Logging and Monitoring
**Check Status of Omnia and Scuttlebot**
```
sudo systemctl status ssb-server
sudo systemctl status omnia
```
**Check Scuttlebot logs**
`sudo journalctl -u ssb-server`
**Check Omnia logs**
`sudo journalctl -u omnia`
# Verify Configuration
**Verify that ssb-server is running on ports 8007 and 8988.**
If these ports are not correct, your Feed will not function correctly!
`sudo lsof -i -P -n | grep LISTEN | grep ssb-serve`
# Generate Invite Code
*Send invite code to @master_chief on Keybase:*
`ssb-server invite.create 100`
# Accept Invite Code
*Request a set of invite codes from @master_chief on Keybase:*
**Accept invite**
`ssb-server invite.accept “invite_code_here”`
This will connect you to the other peers in Oracle Scuttelbot network. It may take a while for your scuttlebot client to sync the entire backlog of messages. This last step is important as without peer connections your Feed is just broadcasting price updates into the void.