{"id":27732760,"url":"https://github.com/yungwine/ton-mempool","last_synced_at":"2025-04-28T11:42:27.058Z","repository":{"id":225337749,"uuid":"722136832","full_name":"yungwine/ton-mempool","owner":"yungwine","description":"TON Blockchain mempool listener","archived":false,"fork":false,"pushed_at":"2024-04-26T12:47:29.000Z","size":19,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-26T13:44:35.527Z","etag":null,"topics":["mempool","python","ton"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yungwine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-22T14:10:04.000Z","updated_at":"2024-04-26T13:25:35.000Z","dependencies_parsed_at":"2024-04-25T06:44:50.657Z","dependency_job_id":null,"html_url":"https://github.com/yungwine/ton-mempool","commit_stats":null,"previous_names":["yungwine/ton-mempool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yungwine%2Fton-mempool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yungwine%2Fton-mempool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yungwine%2Fton-mempool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yungwine%2Fton-mempool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yungwine","download_url":"https://codeload.github.com/yungwine/ton-mempool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251307013,"owners_count":21568378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mempool","python","ton"],"created_at":"2025-04-28T11:42:26.373Z","updated_at":"2025-04-28T11:42:27.050Z","avatar_url":"https://github.com/yungwine.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TON-mempool\n\n## Very experimental version\n\nTON Blockchain MemPool listener is a simple tool that runs a websocket server which allows you to\n* send [external messages](https://docs.ton.org/develop/smart-contracts/guidelines/external-messages)\ndirectly to the [overlay](https://docs.ton.org/learn/networking/overlay-subnetworks)\n* listen to external messages coming to the blockchain\n* listen to new blocks before their application (will be implemented soon).\n\n## Installation\n\nYou can run either in Docker or locally.\n\n### Env\n\n* WS_PORT - port for WebSocket server, must be provided for using in Docker\n* NETWORK - network name (`mainnet`, `testnet`, or `ownnet`), default is `mainnet`\n* ZERO_STATE_FILE_HASH - zero state file hash hex, must be provided for using with `ownnet`\n* WORKCHAIN - workchain id, default is `0`\n\n### Run in Docker\n\nClone the repository and configure `.env` file.\n\nExample:\n\n```\n#.env\nWS_PORT=8765\nWORKCHAIN=0\nNETWORK=testnet\n```\n\nAfter that build and run docker-compose\n\n```commandline\n$ docker-compose up --build -d\n```\n\n### Run locally\n\nExport `env` variables and install requirements\n\n```commandline\n$ pip install -r requirements.txt\n```\n\nAfter that run the server\n\n```commandline\n$ python3 -m src\n```\n\n## Usage\n\nAfter you ran the server, wait 15 seconds, and then you will be able to connect to it using any WebSocket client ([python example](examples/listener.py)).\nThen you need to wait until the `Overlay Client` find the peers and connect to them. This process can take from 10 seconds to a few minutes.\n\n### Methods\n\n* `{'type': 'get_peers_amount'}` - get peers amount server knows. \n* `{'type': 'subscribe', 'data': 'external'}` - subscribe to external messages. \n* `{'type': 'send_external', 'data': hex_boc}` - send external message to the network.\n\n### Receive messages\n\n* `{\"type\": \"get_peers_amount\", \"answer\": {\"amount\": peers_amount}}` - amount of peers.\n* `{'type': 'external', 'data': hex_boc}` - new external message found in mempool.\n\n### What can I do with messages I receive?\n\nThe server sends you `external messages` as bocs. After deserializing you will get a Cell serialized as `Message Any` TL-b scheme.\nThis structure contains message info and body. Most likely you want to know what events will be triggered by this message, \nso you can emulate it locally using [pytvm](https://github.com/yungwine/pytvm) or some APIs (find examples in [process_external.py](examples/process_external.py)).\n\n### Examples\n\nFind Python examples in the [examples](examples/) folder. \n\n## Donation\n\nTON wallet: `EQBvW8Z5huBkMJYdnfAEM5JqTNkuWX3diqYENkWsIL0XggGG`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyungwine%2Fton-mempool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyungwine%2Fton-mempool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyungwine%2Fton-mempool/lists"}