Sign inSign up

mintlayer/telegram-bot

By mintlayer

•Updated almost 2 years ago

[BETA] Telegram bot that notifies users about changes on the Mintlayer Blockchain.

Image
Monitoring & observability
0

339

mintlayer/telegram-bot repository overview

⁠Mintlayer Telegram Bot

The mintlayer/telegram-bot Docker image runs a Telegram bot that notifies users about changes on the Mintlayer blockchain. The bot can be run standalone or as part of a Docker Compose setup, enabling seamless integration with other Mintlayer services.

⁠Features

  • Notifications: Receive updates about blockchain events directly in Telegram.
  • Integration: Works with the Mintlayer API server to fetch blockchain data.
  • Easy Deployment: Containerized application for quick setup and deployment.

⁠Quick Start

⁠Running the Bot Standalone

To run the bot independently, you need to provide the Telegram bot token and the API server URL.

  1. Pull the Docker Image

    docker pull mintlayer/telegram-bot:latest
    
  2. Run the Docker Container

    Replace the placeholders with your actual bot token and API server URL.

    docker run -d --name mintlayer_bot \
      -e BOT_TOKEN=<your_telegram_bot_token> \
      -e API_SERVER=<your_api_server_url> \
      mintlayer/telegram-bot:latest
    

    Environment Variables

    • BOT_TOKEN: Your Telegram bot token obtained from BotFather⁠.
    • API_SERVER: The URL of the Mintlayer API server. For example: https://api-server.mintlayer.org
  3. Verify the Bot is Running

    Check the logs to ensure the bot started successfully.

    docker logs mintlayer_bot
    
⁠Running the Bot with Docker Compose

To integrate the bot with other Mintlayer services, use Docker Compose.

  1. Create a docker-compose.yml File

    
    services:
      telegram-bot:
        image: mintlayer/telegram-bot:latest
        container_name: mintlayer_bot
        environment:
          BOT_TOKEN: <your_telegram_bot_token>
          API_SERVER: http://api-web-server:3000
        depends_on:
          - api-web-server
        networks:
          - mintlayer_network
    
      api-web-server:
        image: mintlayer/api-web-server:latest
        container_name: api_web_server
        environment:
          # Add required environment variables for the API server
        networks:
          - mintlayer_network
    
    networks:
      mintlayer_network:
        driver: bridge
    
  2. Set Up Environment Variables

    Replace <your_telegram_bot_token> with your actual bot token.

  3. Start the Services

    docker-compose up -d
    
  4. Check the Services

    List the running containers to verify all services are up.

    docker-compose ps
    
  5. Monitor Logs

    View the logs of the bot to ensure it's functioning correctly.

    docker-compose logs telegram-bot
    

⁠Configuration

⁠Environment Variables
  • BOT_TOKEN (Required): Your Telegram bot token.
  • API_SERVER : The URL of the Mintlayer API server the bot will interact with (default to official api server).
⁠Additional Configuration

If your bot requires additional configurations, you can set them via environment variables or configuration files as needed.

⁠Security Considerations

  • Sensitive Information: Avoid hardcoding sensitive data like bot tokens in configuration files if they are stored in version control. Use environment variables or Docker secrets instead.
  • Network Access: Ensure that the bot has network access to the API server and any other services it depends on.

⁠Updating the Bot

To update the bot to the latest version:

  1. Pull the Latest Image

    docker pull mintlayer/telegram-bot:latest
    
  2. Restart the Container

    If running standalone:

    docker stop mintlayer_bot
    docker rm mintlayer_bot
    docker run -d --name mintlayer_bot \
      -e BOT_TOKEN=<your_telegram_bot_token> \
      -e API_SERVER=<your_api_server_url> \
      mintlayer/telegram-bot:latest
    

    If using Docker Compose:

    docker-compose down
    docker-compose pull
    docker-compose up -d
    

⁠Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on our GitHub repository⁠.

⁠License

This project is licensed under the MIT License.

⁠Contact

For support or inquiries, please contact the Mintlayer team at [email protected]⁠.

Tag summary

Content type

Image

Digest

sha256:e19761102…

Size

38.3 MB

Last updated

almost 2 years ago

docker pull mintlayer/telegram-bot