From adcd7a4aba11b0940a76fe53550c3c3f669cef9e Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Wed, 17 Nov 2021 14:09:49 +0300 Subject: [PATCH] init: libra instructions --- README.md | 61 +++++++++++++++++++++++++++++++++++++++++++ diem-node.service | 20 ++++++++++++++ libra-monitor.service | 15 +++++++++++ tower.service | 18 +++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 README.md create mode 100644 diem-node.service create mode 100644 libra-monitor.service create mode 100644 tower.service diff --git a/README.md b/README.md new file mode 100644 index 0000000..3eb5213 --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +### Setup + +```bash +# --------------------------- +# 1. Environment setup (Ubuntu 20.04) +# --------------------------- + +# install deps +sudo apt install tmux git make jq --yes + +# download latest release +curl -sL https://api.github.com/repos/OLSF/libra/releases/latest | jq -r '.assets[].browser_download_url' | wget -i - + +# make binaries executable +chmod +x ... + +# extract web-monitor +tar -xf web-monitor.tar.gz --directory ~/.0L/web-monitor/ + +# add to .bashrc +export PATH=$HOME/libra:$PATH +source ~/.bashrc + +# --------------------------- +# 2. Onboarding +# --------------------------- + +# create blockchain account +onboard keygen + +# mine genesis proof +onboard val -u $IP +mkdir init-backup && cp -r ~/.0L/* ~/init-backup/ + +# --------------------------- +# 3. Diem Node +# --------------------------- + +# create systemd service and copy contents +sudo nano /etc/systemd/system/diem-node.service +sudo systemctl daemon-reload +sudo systemctl start diem-node.service +sudo systemctl enable diem-node.service + +# --------------------------- +# 4. Tower +# --------------------------- + +# create systemd service and copy content +sudo nano /etc/systemd/user/tower.service +sudo systemctl daemon-reload +systemctl --user start tower.service +systemctl --user enable tower.service +``` + +### Debug + +```bash +tail -n 100 -f ~/logs/node.log +tail -n 100 -f ~/logs/tower.log +``` \ No newline at end of file diff --git a/diem-node.service b/diem-node.service new file mode 100644 index 0000000..46bac1e --- /dev/null +++ b/diem-node.service @@ -0,0 +1,20 @@ +[Unit] +Description=0L Node Service + +[Service] +LimitNOFILE=200000 + +# Point the config to either full node or validator node +WorkingDirectory=/home/deployer/.0L +ExecStart=/home/deployer/libra-release/diem-node --config /home/deployer/.0L/validator.node.yaml + +Restart=always +RestartSec=10s + +# Make sure you CREATE the directory and file for your node.log +StandardOutput=file:/home/deployer/logs/node.log +StandardError=file:/home/deployer/logs/node.log + +[Install] +WantedBy=multi-user.target +Alias=diem-node.service \ No newline at end of file diff --git a/libra-monitor.service b/libra-monitor.service new file mode 100644 index 0000000..7fd20fb --- /dev/null +++ b/libra-monitor.service @@ -0,0 +1,15 @@ +[Unit] +Description=0L Monitor Service + +ExecStart=/home/deployer/libra-release/ol serve + +Restart=always +RestartSec=10s + +# Make sure you CREATE the directory and file for your node.log +StandardOutput=file:/home/deployer/logs/monitor.log +StandardError=file:/home/deployer/logs/monitor.log + +[Install] +WantedBy=multi-user.target +Alias=libra-monitor.service \ No newline at end of file diff --git a/tower.service b/tower.service new file mode 100644 index 0000000..94a6e32 --- /dev/null +++ b/tower.service @@ -0,0 +1,18 @@ +[Unit] +Description=0L Tower Service + +[Service] +# Point the config to either full node or validator node +WorkingDirectory=/home/deployer/.0L +ExecStart=/home/deployer/libra-release/tower -o start + +Restart=always +RestartSec=10s + +# Make sure you CREATE the directory and file for your node.log +StandardOutput=file:/home/deployer/logs/tower.log +StandardError=file:/home/deployer/logs/tower.log + +[Install] +WantedBy=multi-user.target +Alias=diem-tower.service \ No newline at end of file