pyTHON - Python API for light client libtonlibjson


Команда форума
Python API for libtonlibjson (Telegram Open Network Light Client)

There are functions for getting account states, transactions, sending messages to blockchain, and running getmethods. Also, there is embedded webserver, and now you can run your own local analog or via two commands:

pip3 install pyTON
python3 -m pyTON

(python 3.7+ is required)

While we keep web server API close to presented on, our service is more functional. For instance, there are no limits for requested transactions, and it is possible to request all transactions which happened after the known one. Also, you may send BOC's to network both as serialized cell and in object format: {"data": {"b64": "...", "len": int }, "refs": [...subcells...]}. It is also possible to turn on API for running getMethods (although we do not recommend to open this API for public servers since it is possible to crash liteclient by maliciously constructed getMethod).

Running as a webserver

python3 -m pyTON

  1. --port - default 8000 - webserver port
  2. --getmethods - default False - allow runGetMethod endpoint. Note, that generally it is unsafe to allow arbitrary method executions since maliciously constructed getMethod may crash liteclient.