# Setup Feed Guide
*Disclaimer: These instructions are made for Ubuntu 20.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.*
# Set Up A New VPS
Please create a fresh VPS and do not attempt to update your existing VPS. Please also don't wipe the VPS running your current Feed because we need to run both networks in parallel to ensure a smooth transition. If this is not possible for you due to unique infra setups like running a home server please reach out to @master_chief on Keybase for further guidance.
**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`
# Transfer Ethereum Keys
You will need to use the exact same keys on your new Feed as your previous Feed. Keep in mind your Feeds Ethereum keys are extremely sensitive. If anyone were to obtain it, they could launch an Oracle attack impersonating your Feed. If you don't know the location of your keys you can do `cat /etc/omnia.conf` and get the path from the ethereum.keystore and ethereum.password fields.
YOU SHOULD NOT RE-USE THE SAME SSB KEY SECRET OR GOSSIP.JSON FILE
New node
`mkdir ~/keys`
From your existing node:
`scp keystore.json <USER>@<NEWVPS>:keys/`
`scp password.txt <USER>@<NEWVPS>:keys/`
# Install Feed
**Install Nix**
```
curl -L 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": "lOgzm/3YuiRJEXNkrx+G719g/NlpKUc/+m5enTao8bg=",
"sign": "ZSQrMHhtH6sb2r92o/7s85m87Jbkl/7tcRXm3DVtN0w="
}
```
**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>
```
^keep in mind this is a new VPS so your external IP will be different than what you're used to pasting 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`
These MUST be the same keys you use on your current Feed.
*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 Codes
Generate an invite code with 100 users and send it to @master_chief or @marcandu on Keybase. They will then post the invite code on your behalf on the keybase channels, which will help protect your privacy.
`ssb-server invite.create 100`
**Accept invite**
As you see invites posted in the Keybase channel please be sure to accept them by doing the following:
`ssb-server invite.accept “invite_code_here”`
If the invite code does not work or you run into any error, please notify the Keybase channel so we can troubleshoot.