Pytoniq, a Python Software Development Kit (SDK) for the TON Blockchain (The Open Network), extends its core functionalities with native LiteClient
and ADNL
components, providing developers with a robust toolset for blockchain operations. For further details, contributors and users can join the Python - TON developers chat .
Key Features and Installation 
- PyPI Version:
- Supported Python Versions:
- Downloads:
|
- TON Integration:
To get started, simply run:
pip install pytoniq
Comprehensive Documentation 
For an in-depth understanding and additional resources, visit the GitBook Documentation.
Installation & Usage Examples 
From initializing the LiteClient
to leveraging the LiteBalancer
for optimized query handling, Pytoniq offers extensive functionalities. Check out the examples directory for practical applications.
LiteClient 
The LiteClient
enables direct interaction with the TON Blockchain, offering functionalities such as block transactions scanning and masterchain information retrieval.
Usage:
-
Client Initialization:
- Establish connection with the TON network specifying the configuration (mainnet, testnet, or custom).
- Retrieve masterchain information and manage connection lifecycle.
-
Blocks Transactions Scanning:
- Implement
BlockScanner
to navigate through block transactions, filtering by workchain ID.
- Implement
LiteBalancer 
LiteBalancer
ensures efficient management of LiteServer connections by monitoring peer availability and directing requests to the optimal server based on response times and block sequence numbers.
Special Features:
- Retry mechanism on timeout errors.
- Archival LiteServer detection for historical data requests.
Blockstore 
Pytoniq ensures data integrity through blockstore verification, allowing zero trust level operations with block data provenance.
Advanced Network Layer (ADNL) & Distributed Hash Table (DHT) 
ADNL provides a decentralized networking protocol for efficient peer-to-peer interactions, while DHT extends capabilities with distributed storage solutions.
Key Operations:
- Start ADNL server and manage peer connections.
- Utilize DHT for distributed storage and retrieval of network information.
Conclusion
Pytoniq stands as a comprehensive toolkit for Python developers working with the TON Blockchain, offering a range of functionalities from basic blockchain interactions to advanced networking protocols. With its easy installation, detailed documentation, and robust SDK, Pytoniq fosters a supportive environment for developers to build, innovate, and contribute to the TON ecosystem.
For a hands-on experience and to explore the full potential of Pytoniq, refer to the provided examples and join the vibrant developer community.