This library fully implements the specification protocol of ltc-20.
Report Bug
·
Request Feature
Table of Contents
The present indexer is heavily dependent on ord-litecoin, which possesses incomplete SAT calculations. We will release next-version indexer based on binary witness decoding supported by Gate.io soon.
Developers can integrate this library in the code according to their needs.
When the main/Updater.py
program is running, it will analyze and index the latest data based on the input data, and output a detailed list of all Token information and holder balances in postgreSQL database.
To get a local copy up and running follow these simple example steps.
- Install PostgreSQL locally.
- postgreSQL (Linux)
The Linux system can directly switch to the Postgres user to start the command line tool.
sudo apt-get install postgresql postgresql-client
Install python-postgresqlsudo -u postgres psql
Modify postgreSQL passwordpip3 install psycopg2-binary
sudo -u postgres psql \\password
- postgreSQL (Mac)
Mac start the server:
brew install postgresql
brew services start postgresql
- Set up your own env file in
config/.env
.DB_IDX_NAME = 'postgres' #the default db name. use to login the postgres system for the first time. DB_IDX_USER = 'postgres' #the default user. DB_IDX_PASSWORD = 'your_password' #the default user password DB_IDX_APPUSER = 'unilitioapp' #the application user for pgbouncer DB_IDX_APPUSER_PWD = 'ULDBXQ_Auns0oP' #the application user password for pgbouncer DB_IDX_HOST = '127.0.0.1' #host DB_IDX_PORT = '5432' #port DB_NAME = 'unilit_idx' #name of the db TB_FILE = '../config/IDX_tables.yml' #table structure file. SP_FILE = '../config/Snapshots.yml' #snapshot details file
-
Clone the repo
git clone https://github.com/unilit-io/libltc20-indexer.git
-
Download Litecoin core 0.21.2.2 from official website https://litecoin.org/
tar -zxvf litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz sudo install -m 0755 -o root -g root -t /usr/local/bin ~/litecoin-0.21.2.2/bin/*
-
Now start litecoin node with daemon
litecoind
-
Edit
litecoin.conf
the full node settings to make sure ordinals synccd ~/.litecoin vi litecoin.conf
fill the content and save
txindex=1 rpcserialversion=1
-
Run the Litecoin full node until fully sync (depend on your network, generally it takes serveral hours to a day. You need to prepare an empty space over 150GB)
-
Set up ord-litecoin server (Optional using ordinalslite.com). Download
ord-litecoin 0.5.2
from release for your platform. -
Sync the full ordinals with sats.
./ord --index-sats index
-
Compile another
ord-litecoin
api branch with Cargo. After the compile, run the local server../ord server
-
run
main/Updater.py
pip install psycopg2-binary tqdm python-dotenv pyyaml
# use which full-node and ord server. # If you have your own server, change it to url_base = 'https://ordinalslite.com' #the mode. # if mode==UPDATE_BLK_BY_BLK. It can be slow but it is easy for you to understand how indexer works # if mode==FAST_CATCHUP, then you need download all tx_pairs and all inscription history first mode = 'UPDATE_BLK_BY_BLK' # you need change the biggest height in the database in the fast catchup setting fast_catchup_target_height = 2467872
- Add Changelog
- Python version 1.0.0
- Two running modes (Vectorized/Block-by-block)
- Shared litecoin full-node data
- Shared ord-litecoin .redb data
- Updated Golang version
- Indexer directly from Litecoin-full-node binary info in transactions
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
UniLit - @unilit_io - admin@unilit.io
Project Link: https://github.com/unilit-io/libltc20-indexer.git