Note: The Skycoin Cloud logo (above) is the property of the Skycoin project.
Build Status | |
---|---|
Master | |
Dev |
- Changelog
- Credits
- Overview
- Wing Comamander Setup
- Running Wing Commander
- Stopping Wing Commander
- Wing Commander Bot Commands
- Known Issues
- Donations
Wing Commander is a Telegram bot written in Go
designed to help the Skyfleet community monitor and manage their Skyminers and associated Nodes.
This is currently a Work In Progress (WIP) and has been released as an early Alpha to select group for testing and feedback. More details will be provided as the project progresses.
Please note that this is not an official Skycoin project. If you have issues or questions - please do not bother the Skycoin or Skywire teams - raise any issues or feature requests in GitHub. Also note that this is not my job - I am doing this as an active member of the Skyfleet community and will endeavor to get back to you and resolve issues when I can. Please have patience and bare with me.
The intention of this project is to have a specialised Telegram bot application (written in Go) to run on a Skycoin Skywire (Skyminer) Manager Node and provide its owner with realtime management and monitoring capabilities.
This section is incomplete and requires further work. It should be sufficient however for those interested in working with the Alpha release to get it running.
You MUST provide a valid configuration file for the bot or it will not launch. The config file must reside in the following location $HOME\.wingcommander\config.toml
You will need to create the .wingcommander
folder and then place the config.toml
file into it.
cd ~
mkdir .wincommander
Refer to the provided example configution file: BigOokie\skywire-wing-commander\src\wcbot\config.example.toml
file for details of all required settings. I suggest copying this as a template and then using a text editor such as nano
or vi
to edit the details.
Initiate a Telegram chat with the @BotFather
. The @BotFather
is a bot provided by Telegram and will guide you through the process of creating a new Telegram account for your bot.
I won't cover specifics here - I suggest you Google it.
Once you have created a new bot, the @BotFather
will provide you with details similar to the below:
@BotFather:
Done! Congratulations on your new bot. You will find it at t.me/{YOUR-BOT-NAME_bot}.
You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.
Use this token to access the HTTP API:
NNNNNNNNN:ABCD1234abc1_aBCD12345EFghiJK1234ab
For a description of the bot API, see this page: https://core.telegram.org/bots/api
You will need to paste the (API) token
provided by the @BotFather
into your config.toml
file .
The @BotFather
allows you to control certain settings for the bot - including its ability to participate in group chats. At this stage the bot has been designed for use in private chats only. Further, I would strongly recommend not allowing it to be used by anyone other than youself or within group context.
The Wing Commander bot is designed to operate on your Skywire Manager Node - it is not intended or expected to function on a subordinate Node that does not run the Skywire Manager.
It is expected that you have Go v1.10.x
installed. I will leave the installation of this to you. The below steps assume Go is correctly installed and your $GOPATH
is correctly defined.
To get and build the code use the following commands - note paths are case-sensitive:
mkdir -p $GOPATH/src/github.com/BigOokie
cd $GOPATH/src/github.com/BigOokie
git clone https://github.com/BigOokie/skywire-wing-commander.git
cd skywire-wing-commander
go install -v ./...
To update and rebuild, use the following commands:
cd $GOPATH/src/github.com/BigOokie/skywire-wing-commander
git pull origin master
go install -v ./...
To run the Wing Commander bot you must have a config.toml
file setup. At present, the config.toml
file MUST be placed into the same folder that the wcbot
application (i.e. $GOPATH/bin/
). This will be moved into the users folder at some point in the future.
There is an example configuration file provided with the source (config.example.toml
). Easiest way to start is to copy this and replace the required values.
Key elements you will need in the config.toml
file are:
- The bot token, provided by the
@BotFather
- Your bots
ChatID
. - Your Telegram
@
user name (type@username
in telegram and click on it if you don't know how to get one)
To get your ChatID
go into Telegram and send a chat message to your newly created bot (it will not respond). Once you have initiated a chat with your bot, then enter the following URL into your browser:
https://api.telegram.org/bot<YourBOTToken>/getUpdates
The above URL should produce JSON
output for your bot, including the ChatID
. Paste your ChatID
into your config.toml
file.
To run Wing Commander as a background process (detached from the terminal):
cd $GOPATH/bin
nohup ./wcbot /dev/null 2>&1 & echo $! > wcbot.pid &
To run Wing Commander as a foreground process (debug info logged to the terminal):
cd $GOPATH/bin
./wcbot
Once the Wing Commander Bot is running, start a private chat with the Bot you can make use for the commands to run it (see following section)
cd $GOPATH/bin
pkill -F wcbot.pid
Alternatively, if you are running Wing Commander interactively from the command line, you can press CTRL+C
to shut it down gracefully.
This section outlines the Telegram Bot commands that are currently supported by Wing Commander:
/help
Provides the user with information on the commands supported by Wing Commander (listed below).
/about
Shows information and credits about the creator of Wing Commander and any key contributors.
/status
Manually request current status of the Wing Commander Bot.
/start
Wing Commander will start monitoring the Skyminer that it is running on.
Once started, Wing Commander will provide notification updates via Telegram when any Node managed by the Skyminer Manager connects or disconnects.
Additionally, the /start
command will initiate a heartbeat which will provide a status update on a configurable cycle (interval set in config.toml
). The heartbeat will help you to ensure that the bot and/or the Skyminer itself is still running. If you stop receiving the heartbeat, you need to check whats going on.
/stop
Wing Commander will stop monitoring the Skyminer. This will also stop the heartbeat.
The following section outlines some known issues that need to be taken into consideration by anyone running this software:
-
DNS level blocking/filtering of Telegram API domain on the Skywire nodes (or routers). More detail provided below.
-
Repository renamed. The repository has recently been renamed. It was previously
skywire-telegram-notify-bot
. It is now calledskywire-wing-commander
(note that this is case sensitive). Please make sure you update any references to the new repo name.
I have built and tested this on the following setups - but please note it is still considered ALPHA:
- DIY Raspberry Pi Miner
- Official Skyminer (using the official prepared images for the orange pi prime)
- DIY on MacOS.
YOU TAKE FULL RESPONSIBILITY
If you are running OpenDNS or other DNS which protects and prevents access to certain domains, you may need to update the settings to ensure that the Telegram API domain (https://api.telegram.org
) is not blocked.
In OpenDNS this is blocked by the Chat
and Instant message
areas.
Access to the Telegram API is being blocked if you get the following error when trying to run the Bot:
PANI[0000] Post https://api.telegram.org/bot{BOTTOKEN_FROM_BOTFATHER}/getMe: x509: certificate signed by unknown authority
You can verify this by using curl
. Run the following command and if you get the error shown below, the domain is being blocked. If the domain isn't blocked you should get a JSON response from Telegrams API.
curl https://api.telegram.org/bot{BOTTOKEN_FROM_BOTFATHER}/getMe
curl: (60) SSL certificate problem: unable to get local issuer certificate
This is not my job, but I enjoy building things for the Skyfleet community. If you find my work useful, please consider donating to support it.
Skycoin: ES5LccJDhBCK275APmW9tmQNEgiYwTFKQF
BitCoin: 37rPeTNjosfydkB4nNNN1XKNrrxxfbLcMA