-
Notifications
You must be signed in to change notification settings - Fork 15
Setting up a Hub
We recommend a server running Ubuntu 20.04 LTS with 16 vCPU, 32G RAM, and a 500GB SSD drive. As a benchmark, on Jan 2023 this setup costs about $100 a month and uses about 400GB of disk space.
For the setup below we used a c5.4xlarge
AWS instance, but we've also used this same setup on OVH servers. Most providers should work.
sudo adduser lbry --disabled-password --gecos ""
sudo -H -u lbry bash -c 'mkdir -p /home/lbry/.ssh && echo "YOUR-SSH-KEY" >> /home/lbry/.ssh/authorized_keys'
sudo -H -u root bash -c 'echo "lbry ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo service docker start
sudo usermod -aG docker $USER
newgrp docker
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
mkdir -p /home/lbry/docker-volumes/lbcd /home/lbry/docker-volumes/rocksdb
# sudo chown -R 999:999 /home/lbry/docker-volumes ## not needed unless you encounter problems
docker volume create --driver local --opt type=none --opt device=/home/lbry/docker-volumes/lbcd --opt o=bind lbry_lbcd
docker volume create --driver local --opt type=none --opt device=/home/lbry/docker-volumes/rocksdb --opt o=bind lbry_rocksdb
sudo apt install -y zstd
cd /home/lbry/docker-volumes/lbcd
wget -c https://snapshots.lbry.com/blockchain/lbcd_snapshot_1238238_v0.22.116_2022-10-07.tar.zst -O - | tar --zstd -x
sudo chown -R 999:999 .
cd ~
https://github.com/lbryio/hub/wiki/docker-compose.yml
remember to remove markdown if downloading directly from that url
docker compose up -d lbcd
wait for it to sync fully (how will they know?)
cd /home/lbry/docker-volumes/rocksdb
wget -c https://snapshots.lbry.com/hub/block_1288882/lbry-rocksdb.tar -O - | tar -x
sudo chown -R 999:999 .
cd ~
scribe sync takes about a week if you sync from scratch, or an hour or two if you use a recent snapshot
docker compose up -d scribe
wait for it to sync
docker compose up -d scribe_elastic_sync
wait for it to sync
start prometheus and grafana
do this to check that everything is working