Grin Wallet Telegram Bot
You can install Grin wallet python-telegram-bot with:
debian:
(https://linuxize.com/post/how-to-install-python-3-7-on-debian-9/)
Before installing Python from its source code, you must first install some required packages that are needed to build Python from source. To get these packages installed, run the commands below:
sudo apt updatesudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
After installing the above packages, go and download the latest release’s source code from the Python download page after downloading the package, run the commands below extract the file and install:
curl -O https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
tar -xf Python-3.7.3.tar.xz
cd Python-3.7.3
./configure --enable-optimizations
Next start the building process using the make command.. Replace the #8 with the number of CPU cores on your system for faster build time… My machine has 8 CPU core, so I use the make command with -j 8 option:
make -j 8
sudo make altinstall
To test if Python is installed and ready to use, run the commands below:
python3.7 --version
You should see an output similar to the one below:
Python 3.7.3
ubuntu:
(https://linuxize.com/post/how-to-install-python-3-7-on-ubuntu-18-04/)
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7
python3.7 --version
Python 3.7.3
Install pipsudo apt install python3-pip
To check if Pip Installs Packages is installed and ready to use, run the commands below:
pip3 --version
You should see an output similar to the one below:
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
Install some required packages that are needed to build Telegram bot from source:
python3.7 -m pip install aiogram
python3.7 -m pip install asyncio
python3.7 -m pip install requests
Next, move the bot.py file to grin/grin-wallet and picture grin.png
Open file bot.py and change:
TOKEN = “1056341881:AAEKYEkс-QVtKIмtzSgIFL06ahUIOnkPemo”
Here is the bot token that you receive from botFather
password = ‘generate password’
Here is the password for the grin-wallet
admin_id = [771844687, 730668]
Here is your telegram ID from @get_id_bot
grin_pass_api = ‘zijvVcc6GH5BYgznbR6K’
Enter the contents of the file here /root/.grin/main/.api_secret
After that we save the changed script on the server:
Start ssh.
sudo apt install screenscreen -S tg_bot
cd
cd grin/grin-wallet
python3.7 bot.py
If everything is fine you should see “starting”
Press CTRL + A + D and in this way we exit screen
To restart the bot you need to go into the
screen -x tg_bot
ctrl+c
python3.7 bot.py
CTRL+A+D