CAFECA-IO / BAIFA-web-crawling

BAIFA conducts web crawling from iSunCloud in frequence
0 stars 0 forks source link

調整 .env.sample 及 README.md #70

Closed gibbs-shih closed 3 months ago

gibbs-shih commented 3 months ago

調整 .env.sample 調整 README.md 將chain info 設定至於 .env 重新部署

gibbs-shih commented 3 months ago

chain info 資訊分別放入 .env CleanShot 2024-07-09 at 14 21 37

.env.sample 範例 CleanShot 2024-07-09 at 14 22 24

gibbs-shih commented 3 months ago

在 main.ts 中載入 .env 中關於 chain info 的資訊, 組合成 chainInfo, 並 export 出去 預設是 iSunCoin chain CleanShot 2024-07-09 at 14 45 18

gibbs-shih commented 3 months ago

修改原本使用 CHAIN_INFO 的地方及來源

-block.ts CleanShot 2024-07-09 at 14 51 33 CleanShot 2024-07-09 at 14 52 27 CleanShot 2024-07-09 at 14 52 52

gibbs-shih commented 3 months ago
gibbs-shih commented 3 months ago
gibbs-shih commented 3 months ago
gibbs-shih commented 3 months ago
gibbs-shih commented 3 months ago

拿掉原來的constants / chain_info.ts 因放在 main.ts 中會讀取不到, 故從 main.ts 移出放入 lib / chain_info 並調整.env 設置確保能讀取到 將所有路徑 import 自 lib / chain_info CleanShot 2024-07-09 at 15 38 34 CleanShot 2024-07-09 at 17 33 48

CleanShot 2024-07-09 at 15 44 28

gibbs-shih commented 3 months ago

BAIFA Web Crawler Setup Guide

This guide will walk you through the steps to set up the BAIFA web crawler on a remote server.

Deploy crawler - remote server

Environment

Steps

Here are the main steps to set up the compilation environment and run the crawler:

  1. Set up the environment

  2. Clone the repository and configure files

  3. Install dependencies and set up the database

  4. Run the crawler using PM2


Set up the compilation environment

Connect to the remote server and open the terminal

Create a directory under root using sudo

Change the owner of /workspace to ${user}

Go to the workspace directory

Clone the repository from GitHub

Go to the BAIFA-web-crawling directory

Set up the .env file

Install packages

Push the database schema to the remote server

Install PM2

Use pm2 to run the crawler

(If needed) Terminate the pm2 process

(If needed) Continuously observe the process log

gibbs-shih commented 3 months ago

take 3 hr