Skip to content

Latest commit

 

History

History
101 lines (70 loc) · 2.04 KB

INSTALL.brc20.sqlite.ubuntu.md

File metadata and controls

101 lines (70 loc) · 2.04 KB

Detailed Installation Guide for OPI Light Client on Ubuntu 22.04

Installing Python Libraries

  1. Install pip if you don't have it. guide.
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
rm get-pip.py

or

sudo apt update
sudo apt install python3-pip
  1. Install dependencies
python3 -m pip install python-dotenv;
python3 -m pip install buidl;

On some systems, requests is not installed by default. If you get "requests" not found error while running the client, run this:

python3 -m pip install requests;

Install uncompress dependency for backup restore

sudo apt update
sudo apt install bzip2

Setup Light Client

  1. Clone repository, restore DB from last backup
git clone https://github.com/bestinslot-xyz/OPI-LC.git
cd OPI-LC/brc20/sqlite
wget http://s3.opi.network:9000/opi-light-client-files/db_4/light_client_brc20_sqlite_last.sqlite3.tar.bz2
tar -xvf light_client_brc20_sqlite_last.sqlite3.tar.bz2
rm light_client_brc20_sqlite_last.sqlite3.tar.bz2
  1. Run initialise_sqlite.py to initialise .env config
python3 initialise_sqlite.py

Run OPI Light-Client

python3 brc20_light_client_sqlite.py

(Optional) Setup API

Installing NodeJS

These steps are following the guide at here.

sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

sudo apt-get update
sudo apt-get install nodejs -y

Installing node modules

cd OPI-LC/brc20/api; npm install;

Setup API

Run initialise_api.py to initialise .env config

python3 initialise_api.py

Run API

node api.js