Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pinax-network/substreams-sink-telegram
Pipes data extracted from a blockchain to Telegram
https://github.com/pinax-network/substreams-sink-telegram
Last synced: about 1 month ago
JSON representation
Pipes data extracted from a blockchain to Telegram
- Host: GitHub
- URL: https://github.com/pinax-network/substreams-sink-telegram
- Owner: pinax-network
- License: apache-2.0
- Created: 2023-03-21T14:49:10.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-22T08:23:38.000Z (over 1 year ago)
- Last Synced: 2024-05-13T00:13:41.127Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 797 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-substreams - Telegram Sink
README
# [`Substreams`](https://substreams.streamingfast.io/) [Telegram](https://telegram.org/) CLI `Node.js`
> `substreams-sink-telegram` is a tool that allows developers to pipe data extracted from a blockchain to the Telegram messaging social platform.
## 📖 Documentation
### Further resources
- [**Substreams** documentation](https://substreams.streamingfast.io)
- [**Telegram** Bot API documentation](https://core.telegram.org/bots/api)
- [**Telegram** MarkdownV2 specifications](https://core.telegram.org/bots/api#markdownv2-style)
- [**Telegram** HTML specifications](https://core.telegram.org/bots/api#html-style)### Protobuf
- [`sf.substreams.entity.v1.EntityChanges`](https://github.com/streamingfast/substreams-entity-change/blob/develop/proto/entity/v1/entity.proto)
## CLI
[**Use pre-built binaries**](https://github.com/pinax-network/substreams-sink-telegram/releases)
- [x] MacOS
- [x] Linux
- [x] Windows**Install** globally via npm
```
$ npm install -g substreams-sink-telegram
```**Run**
```
$ substreams-sink-telegram run [options]
```### Formatting
Supports `JSON` and `YAML` format for configuration file. Example of `config.json` format configuration file:```json
[
{
"entity": "Transfer",
"chat_ids": [
"@some_chat_id",
"@some_other_chat_id"
],
"message": "This *{user_id}* made a transaction with id [{trx_id}](https://someblockexplorer.com/transactions/{trx_id})"
},
{
"entity": "Transfer",
"parse_mode": "HTML",
"chat_ids": [
"@some_chat_id"
],
"message": "PRIVATE GROUP: This {user_id} made a transaction with id {trx_id}"
},
{
"entity": "OtherEntity",
"chat_ids": [
"@some_chat_id"
],
"message": "This {other_field}"
}
]
```Text between `{}` are field names and are used as labels for message templating. In the example above, all `EntityChanges` messages coming from the substream with `entity` key having `Transfer` as value, will be sent to [Telegram](https://telegram.org/) chats with id `@some_chat_id` and `@some_other_chat_id`, as specified in the first and second json object.
## Features
### Substreams
- Consume `*.spkg` from:
- [x] Load URL or IPFS
- [ ] Read from `*.spkg` local filesystem
- [ ] Read from `substreams.yaml` local filesystem
- [x] Handle `cursor` restart### Telegram
- [x] Handle rate limit
- [x] HTML message parsing
- [x] MarkdownV2 message parsing (by default)