variables.envfile and set
TELEGRAM_BOT_TOKENto your Telegram Bot Token obtained from BotFather.
THORCHAIN_NODE_IPto any THORNode IP you want to monitor (or
localhost). Leave it empty or remove it to use testnet seed Node IPs.
BINANCE_NODE_IPto any Binance Node IP you want to monitor (or
localhost). Leave it empty or remove it to not monitor a Binance Node.
ADMIN_USER_IDSto a list of Telegram User IDs that are permissioned to access the Admin Area.
pip install -r requirements.txt
/newbotin the chat, and follow the given steps to create a new telegram token. Save this token, you will need it in a second.
localhostto listen a node on your own machine.
BINANCE_NODE_IPto this IP. Set it to
localhostif the Binance Node runs on the same machine as the Telegram Bot.
ADMIN_USER_IDSenvironment variable. Leave the default dummy values if you do not intend to use the Admin Area.
@userinfobot. Ensure that this is a Bot and not a Channel and has exactly the handle
@userinfobot, as there are a lot of channels and bots with similar names. Start this Bot and it returns you your User ID that you need to export in
,i.e. a comma.
increase_block_height.pywhich artificially increases the block height so that there are no notifications that the block height got stuck.
thornode_bot). Now search for this name in Telegram, open the chat and hit start!
storage/session.data. Once you stop and restart the bot, everything should continue as if the bot was never stopped.
storagedirectory before startup.
DEBUG=Falseand all other environment variables as described in the 'Set environment variables' section. If you're using docker-compose to run this Bot, modify the existing variables in
variables.envfile (No need to set DEBUG as there's no DEBUG mode in the docker version).
--env TELEGRAM_BOT_TOKENflag to your telegram bot token.
--env THORCHAIN_NODE_IPflag to an IP of a running THORNode, or to
localhostif the THORNode runs on the same machine as the Telegram Bot. If you don't know any IP leave this empty i.e.
--env THORCHAIN_NODE_IP=or remove it completely - then the Telegram Bot works with testnet seed node IPs from https://testnet-seed.thorchain.info.
--env BINANCE_NODE_IPflag to an IP of a running Binance Node, or to
localhostif Telegram Bot and Binance Node run on the same machine. Leave this empty i.e.
--env BINANCE_NODE_IP=or remove it to not do any Binance monitoring.
-vargument passes the dockersocket to the container so that we can restart docker containers from inside the Telegram Bot.
--mountflag tells docker to mount our previously created volume in the directory
storage. This is the directory where your bot saves and retrieves the
healthcheck.pyfile. The script assures that
thornode_bot.pyis periodically updating the
docker-compose.yamland comment out the line
image: "block42blockchaincompany/thornode_bot:latest"and comment in the line
TELEGRAM_API_HASHrespectively. Also save the name of your Telegram Bot without the preceding
TELEGRAM_BOT_IDenvironment variable (e.g. if your bot is named
TELEGRAM_BOT_TOKENenvironment variable with your telegram bot token, set
ADMIN_USER_IDSwith permissioned IDs and set
DEBUG=Trueas explained in previous sections. If you want to test the restarting of docker containers, do not forget to start at least one container on your system.
storage/in order to have fresh starts for every integration test. If you wish to keep your persistent data, don't run the integration test or comment out the line
test/folder in your terminal and run
-----ALL TESTS PASSED-----at the end.