Try   HackMD

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 @marcandu on Keybase for further guidance.

Hardware requirements:

  • 4GB ram (2GB will work, but requires some tweaks when installing and upgrading)
  • 1 vCPU. 2 recommended.
  • 10 GB storage for current needs. In the future, 30 GB will be required.

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!

If you can, setup Two-factor authentication. Here are some options:

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": "r1/JHSyQu/V2/t66H2eCseNwZcf+N7s5/gdYeJVyYXc=",
    "sign": "W5bQi2v4SWH+a9sC+9MvnjCfT3DpU1ZiI+iFq0TugeE="
}

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 -feu ssb-server

Check Omnia logs
sudo journalctl -feu 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 @marcandu on Keybase. They will then post the invite code on your behalf on the keybase channels, which will help protecting 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 you get an error, this usually means the other peer already accepted your invite.