# Setup Feed 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.* # 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. # 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` # Accept Invite Code *Request a set of invite codes from @nik on Rocket Chat* **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.