GitHub - ATM-Developer/pagerank-service · GitHub
Skip to content

ATM-Developer/pagerank-service

Folders and files

Repository files navigation

ATM-PageRank-Node-Decentralized

1.Environments

Server minimum configuration:

2 CPU cores
16Gb RAM
5Mb/s public access network
50Gb disk space.

Installation process example under Ubuntu:

1.Update packages

sudo apt update

2.Install python >= 3.10

sudo apt install python3.10

3.Install pip >= 21.0.0

sudo apt install python3-pip

4.Install gunicorn >= 20.1.0

sudo apt install gunicorn

5.Enter the root directory of the project

cd pagerank-service

6.Install requirements

sudo pip install -r requirements.txt

7.set password

export ATMPD="your password"

8.install nodejs\npm

node.js version 18 or higher and npm version 7 or higher is required. Check your local versions like this: node --version && npm --version. Install nodejs by referring to NODESOURCE and distributions. npm will be installed synchronously.

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 list nodejs -a
sudo apt-get install nodejs -y

9.install and configure storacha

Reference website Storacha.

install: sudo npm install -g @storacha/cli

authorization: storacha login {email}
list spaces: storacha space ls # if there is no space, use command 'storacha space create' to create
select space: storacha space use {space_id}

10.Set the Coingecko API Key

Coingecko requires that all API requests include an API Key. Please refer to the official documentation: Coingecko set API Key, and follow these steps:

a. Register for a Coingecko account: https://www.coingecko.com/

b. After logging in, go to the Developer Dashboard (https://www.coingecko.com/en/developers/dashboard), apply for and obtain a free API Key.

c. Set the environment variable in your terminal so the system can access the API:
    export CG_API_KEY="Your API Key"

2.Create your account

Generate your account according to the script we provide(pagerank-service/generate_address.py), remember the key file path, your address and your password.

python generate_address.py

You must transfer some BNB to your account. PR Node needs to interact with smart contracts, it will cost you about 1 BNB a year.

3.Modify configuration

Please use text editor to edit project/settings.cfg

sudo vim project/settings.cfg

3rd row: PRIVATE_PATH, fill in the path of the key file

4.Run the service

Enter the root dir of project and run:

export ATMPD="your password"
gunicorn -w 4 -t 90 -b 0.0.0.0:5000 manage:app -D

[-b 0.0.0.0:5000]:5000 is the port, please ensure external access to port 5000.

5.Check the service

a. Check if the service exists

ps -aux | grep gunicorn

b. You can verify whether the service is running through the HTTP GET request

curl --location --request GET 'http://your_domain:your_port/prod'

c. Further confirm the operation of the service by viewing various files in the log directory

i. log/data_job.log, the main process for generating revenue is recorded, with no error messages in the log. The log includes information such as the current time and the next revenue calculation time, as shown in the following figure: Local Image

ii. log/binance_pledge.log, the process of retrieving event data from the blockchain is recorded, fetching data every 2 minutes. There are no errors in the log, and a single data retrieval is completed, as illustrated in the following example: Local Image

6.Register PR server

You need to register the server at ATM official website.

7.Continue to follow our project and keep using the latest version of code

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages