-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
5 changed files
with
65 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Synchronous | ||
|
||
To use the library without asyncio, we can use similar code: | ||
|
||
```python | ||
from ton.sync import TonlibClient | ||
client = TonlibClient() | ||
client.init_tonlib() | ||
|
||
# then all methods can be used without await | ||
wallet = client.create_wallet() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Troubleshooting | ||
|
||
Library functions make requests via `ton.tl.functions`. Each of the classes is a reference to the `libtonlibjson` method ([full list](https://github.com/newton-blockchain/ton/blob/master/tl/generate/scheme/tonlib\_api.tl)). | ||
|
||
To enable debugging of library actions, need to do this: | ||
|
||
```python | ||
import logging | ||
logging.getLogger('ton').disabled = False | ||
logging.getLogger('ton').setLevel(logging.DEBUG) | ||
``` | ||
|
||
But apart from visible errors, the action can simply last indefinitely in time. This means that the error occurred inside `libtonlibjson` OR the selected liteserver is not responding. In that case, we need to see what's going on inside: | ||
|
||
```python | ||
await client.set_verbosity_level(5) | ||
``` | ||
|
||
If it seems that the problem is in the lite server, you need to change it, reinitialize the library with a different ls\_index: | ||
|
||
```python | ||
client = TonlibClient(ls_index=N) | ||
await client.init_tonlib() | ||
``` |