open-libra-devops/README.md

111 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2021-11-17 12:09:49 +01:00
### Setup
```bash
# ---------------------------
# 1. Environment setup (Ubuntu 20.04)
2021-11-17 17:11:56 +01:00
# - assumes the account name is "deployer"
2021-11-17 12:09:49 +01:00
# ---------------------------
# install deps
sudo apt install tmux git make jq --yes
# download latest release
2021-11-18 09:10:05 +01:00
mkdir libra-release && cd libra-release
2021-11-17 12:09:49 +01:00
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
2021-11-18 09:10:05 +01:00
export PATH=$HOME/libra-release:$PATH
2021-11-17 12:09:49 +01:00
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
2021-11-18 09:05:39 +01:00
# - patched version needs to run in tmux since it requires mnemonic from STDIN prompt
# - you can use the below config if you want to run with the -o flag
2021-11-17 12:09:49 +01:00
# ---------------------------
# 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
2021-11-17 17:11:56 +01:00
# Enable systemd persistence
loginctl enable-linger deployer
2021-11-18 07:35:40 +01:00
2021-11-18 09:10:05 +01:00
# see backlog submission patch below
2021-11-17 12:09:49 +01:00
```
### Debug
```bash
2021-11-18 07:35:40 +01:00
# logs
2021-11-17 12:09:49 +01:00
tail -n 100 -f ~/logs/node.log
tail -n 100 -f ~/logs/tower.log
2021-11-18 07:35:40 +01:00
2021-11-18 09:10:05 +01:00
# install diem cli
cd libra
git checkout master
make client
mv target/debug/cli ~/libra-release/diem-cli
# dm commands
2021-11-18 07:35:40 +01:00
# check vdf proof height
node ms $ADDRESS
# check balance
query balance $ADDRESS
```
### Backlog Submission Patch
```bash
# clone the main repo
git clone https://github.com/OLSF/libra.git
cd libra
# add the remote with the fix
git remote add mortonbits https://github.com/mortonbits/libra.git
# fetch the branch with the fix
git fetch mortonbits submit-initial-vdf-proof
# move to thta brach
git checkout submit-initial-vdf-proof
# Config dependencies as hard mode documentation
make deps
# Build the source and install binaries
make bins
2021-11-18 09:10:05 +01:00
mv ~/libra-release/tower ~/libra-release/towerold
mv target/release/tower ~/libra-release/tower
tmux new -s tower
tower start
2021-11-17 17:11:56 +01:00
```