Update README.md

This commit is contained in:
tripathyr 2024-11-27 09:28:04 +05:30 committed by GitHub
parent 46bcd30252
commit 28b3a9902a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,11 +11,24 @@
HOST = localhost
DATABASE_PREFIX = rm
```
## How to run (setup the venv first)
## Setup setps
1. python3.7 tracktokens-smartcontracts.py --reset
2. python3.7 tracktokens-smartcontracts.py --rebuild
3. python3.7 tracktokens-smartcontracts.py --rebuild usd# tokenroom#
1. Setup the Python Virtual Environment first with atleast python3.7 at least. Look below for exact instructions
2. Install setup.sh to install all dependencies. Give it execute permissions first `chmod +x pyflosetup.sh`, and then `./setup.sh`
3. Install MYSQL and create MySQL user and password
4. Add all the data in confg.ini
5. Then run the command as per one of the options below
## How to run
1. python3.7 tracktokens-smartcontracts.py
2. python3.7 tracktokens-smartcontracts.py --reset
3. python3.7 tracktokens-smartcontracts.py --rebuild
4. python3.7 tracktokens-smartcontracts.py --rebuild usd# tokenroom#
1. python3.7 tracktokens-smartcontracts.py => To run normally
2. python3.7 tracktokens-smartcontracts.py --reset => To remove all data and start from scratch
3. python3.7 tracktokens-smartcontracts.py --rebuild => To reprocess existing blockchain data for ALL TOKENS as stored in latestBlocks table of rm_latestCache_db database
4. python3.7 tracktokens-smartcontracts.py --rebuild usd# tokenroom# => To reprocess existing blockchain data for USD# TOKENROOM# as stored in latestBlocks table of rm_latestCache_db database
# FLO Token & Smart Contract System
[![Test flodata parsing](https://github.com/ranchimall/flo-token-tracking/actions/workflows/test_parsing.yml/badge.svg?branch=swap-statef-testing)](https://github.com/ranchimall/flo-token-tracking/actions/workflows/test_parsing.yml)
@ -86,3 +99,72 @@ Docker-compatibility branch is needed right now because Docker image made for fl
5. If running for the first time, run `python3.7 tracktokens-smartcontracts.py --reset` otherwise run `python3.7 tracktokens-smartcontracts.py`
## How to setup a virtual environment
To set up a virtual environment that uses Python 3.7 while keeping Python 3.10 as the default system version, follow these steps:
Step 1: Make Sure Python 3.7 is Installed
Ensure Python 3.7 is installed on your system:
Add the deadsnakes PPA (if not already done):
bash
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
Install Python 3.7 and the venv module for Python 3.7:
bash
sudo apt install python3.7 python3.7-venv
Step 2: Create a Virtual Environment with Python 3.7
Since you want your virtual environment to specifically use Python 3.7, you need to use Python 3.7 explicitly to create the venv, while keeping Python 3.10 as the system's default Python:
Create the virtual environment using Python 3.7:
bash
/usr/bin/python3.7 -m venv myenv
This command creates a virtual environment named myenv using Python 3.7 located at /usr/bin/python3.7. Replace myenv with your desired environment name.
Step 3: Activate the Virtual Environment
Activate the virtual environment to switch to Python 3.7 within the environment:
On Linux or macOS:
bash
source myenv/bin/activate
On Windows:
bash
.\myenv\Scripts\activate
After activation, your shell prompt should indicate that the virtual environment is active.
Step 4: Verify the Python Version in the Virtual Environment
To confirm that the virtual environment is using Python 3.7, run:
bash
python --version
You should see output indicating that Python 3.7 is being used:
Python 3.7.x
Step 5: Deactivate the Virtual Environment When Done
When you are finished, deactivate the virtual environment to return to the base Python 3.10:
bash
deactivate