Camino Messenger Bot Installation
Please be aware that this document is currently a draft and is undergoing active development. Content, guidelines, and instructions may be subject to change.
This application is in the alpha phase of development. It is important to note that during this stage, breaking changes may occur without advance notice. Users should proceed with caution.
Introduction​
This document guides you through the installation of the Camino Messenger Bot using two distinct methods. The first method involves compiling the software from its source code, while the second method utilizes Docker to create an image and run a container.
Compiling from Source​
Requirements​
Before you begin, ensure you have the necessary libraries installed.
Ubuntu 22.04 LTS:
sudo apt install libolm-dev
sudo snap install go --classic
Get the Source​
To get started, clone the Camino Messenger Bot repository and initialize the submodules:
git clone https://github.com/chain4travel/camino-messenger-bot.git
cd camino-messenger-bot
git submodule update --init
Install Go Dependencies​
Install the required Go dependencies with:
go mod download
Build​
Compile the application using the following command:
./scripts/build.sh
This will create a compiled binary under the build
directory.
Verify​
To ensure the build was successful, check for the camino-messenger-bot
binary:
./build/camino-messenger-bot --help
Running camino-messenger-bot --help
should produce the following output:
$ ./build/camino-messenger-bot --help
starts camino messenger bot
Usage:
camino-messenger-bot [flags]
Flags:
--booking_token_address string BookingToken address. (default "0xe55E387F5474a012D1b048155E25ea78C7DBfBBC")
--bot_key string Sets bot private key. Its used for the matrix server connection, cm account interaction and cheques signing.
--cash_in_period int Cash-in period (in seconds). (default 86400)
--chain_rpc_url string C-chain RPC URL.
--cheque_expiration_time uint Cheque expiration time (in seconds). (default 18144000)
--cm_account_address string Sets bot cm account address.
--config string path to config file dir (default "camino-messenger-bot.yaml")
--db.migrations_path string Path to migration scripts. (default "file://./migrations")
--db.path string Path to database dir. (default "cmb-db")
--developer_mode Sets developer mode.
-h, --help help for camino-messenger-bot
--matrix.host string Sets the matrix host.
--min_cheque_duration_until_expiration uint Minimum valid duration until cheque expiration (in seconds). (default 15552000)
--network_fee_recipient_bot_address string Network fee recipient bot address.
--network_fee_recipient_cm_account string Network fee recipient CMAccount address.
--partner_plugin.ca_file string The partner plugin RPC server CA certificate file.
--partner_plugin.enabled Enable or disable the partner plugin rpc client. It must be enabled if bot's cm account supports at least one service.
--partner_plugin.host string partner plugin RPC server host. (default "localhost:50051")
--partner_plugin.unencrypted Whether the RPC client should initiate an unencrypted connection with the server.
--response_timeout int The messenger timeout (in milliseconds). (default 3000)
--rpc_server.cert_file string The server certificate file.
--rpc_server.enabled Enable or disable RPC server. It must be enabled if bot is expecting to receive RPC requests (e.g. its distributor bot).
--rpc_server.key_file string The server key file.
--rpc_server.port uint The RPC server port. (default 9090)
--rpc_server.unencrypted Whether the RPC server should be unencrypted.
--tracing.cert_file string The tracing certificate file.
--tracing.enabled Whether tracing is enabled.
--tracing.host string The tracing host. (default "localhost:4317")
--tracing.insecure Whether the tracing connection should be insecure. (default true)
--tracing.key_file string The tracing key file.
-v, --version version for camino-messenger-bot
Below is a screen capture of all the steps above done on Ubuntu 22.04.3 LTS:
The screencast below demonstrates an older version of the bot. It will be updated in the future, but for now, it is provided here for reference.
Building Docker Image​
Follow these steps to build the Docker image.
Get the Source​
First, clone the Camino Messenger Bot repository and initialize the submodules:
git clone https://github.com/chain4travel/camino-messenger-bot.git
cd camino-messenger-bot
git submodule update --init
Build the Image​
Use the following command to build the Docker image:
docker build --tag camino-messenger-bot .
After a successful build, test the image with:
docker run --rm camino-messenger-bot --help
The expected output should be:
Usage of ./camino-messenger-bot:
-config string
Path to configuration file
Below is a screen capture of all the steps above done on Ubuntu 22.04.3 LTS:
The screencast below demonstrates an older version of the bot. It will be updated in the future, but for now, it is provided here for reference.
Networking​
To enable the bot to connect to the Camino Messenger server, ensure that the network infrastructure and firewall rules are properly configured. The host running the bot must be able to resolve DNS names and establish a connection with at least the configured Matrix server. For internal communication with the Partner Plugin, ensure that the hosts can reach each other and that firewall rules allow the necessary applications to communicate.
Bot-Plugin Connection Scenarios​
-
Bot in Docker Container, Plugin on Host Machine (localhost):
In the bot configuration for the plugin host, usehost.docker.internal
. -
Bot in Docker Container, Plugin in Another Docker Container:
In the bot configuration for the plugin host, use the service name of the plugin as defined in the Docker Compose file. -
Bot Executable on Host Machine, Plugin on Host Machine:
In the bot configuration for the plugin host, uselocalhost
.
Known Issues & Limitations​
The following known issues should be considered when using the Camino Messenger Bot v10.2.0:
Version: v10.2.0​
-
Start-Up Delay: After a fresh start, the bot requires 10 to 15 seconds to initialize before it can send or receive messages on some systems. This delay may increase depending on network conditions, especially if the bot receives messages during this initialization period.
-
Crash on Empty Message: The bot crashes if it receives an empty message, which should never occur. The Partner Plugin is responsible for sanitizing such messages. In the future, validation for empty messages and other relevant message types will be implemented using the protovalidate library.
-
Single Bot Contact Limitation: Currently, only the first bot returned by the CM-Account is contacted by other bots. This limitation will be addressed in future updates to support High Availability and Failover within the Camino Messenger architecture.
-
Crash on Plugin Disconnection: If the Partner Plugin disconnects while the bot receives a message, the bot may crash. As a workaround, use the
--restart always
flag when running the bot in a Docker container. -
Mandatory Response Header Field: The status field in the message response header is mandatory and should indicate either "success" or "failure". This requirement will be enforced once the protovalidate library is implemented.