PAI-BOT LINUX INSTALLATION

You are here:
< All Topics
Table of Contents

PAI-Bot Installation Guide

Prerequisite:

In order to use the PAI system, you will need to connect to PAI-NET. 

please make sure you acquire the following information before you start the installation process: 

  1. PAI-NET URL – the URL of the PAI-NET you will be using
  2. Organization name
  3. PAI-NET user & password 

Before you install PAI-Bot you will need to set up the PAI environment. 

PAI environment includes a directory (the PAI directory) that stores all PAI’s files. 

For more information read the PAI environment installation guide. 

For best practice, we recommend installing PAI directory at  ` /var/PAI ` for Linux based OS

PAI-Bot cannot work without the PAI directory, please make sure all files and directories are properly configured before you continue. you can use our PAI-ENV-CHECKLIST script to test the environment. 

After you set up the environment, we can start installing the Bot. 

PAI-Bot is a Node-JS application, and require you to install Node-JS and npm on your machine. 

Full prerequisite list can be found here

PAI Bot installation guide:

  1. Download the project from our GitHub repository
  2. Open the project directory in the terminal and run: ` npm install `. and after, run: ‘ npm update ‘. this will install and update all PAI-Bot packages that are required for running the bot. 
  3. In order to control your Bot with PAI-Control-Panel, you will need to register your Bot to PAI-NET: 

Run the command ` npm run init ` in your terminal, this will set up your Bot, and will ask you questions to configure your Bot: 

  • Your Bot is not connected to PAI-NET. Would you like to register your bot to PAI-NET ?” – Press Enter
  •  “Please enter PAI-NET URL” – The URL you got from us
  •  “Please enter PAI-NET username (email):” – enter your PAI-NET username
  •  Enter your PAI-NET password
  • You should get now: token is now active & login success
  • Do you want to register new bot or load an existing bot ?” – Choose “CREATE NEW BOT”
  • Please enter Bot’s nickname:” – enter any nickname you want for your Bot.
  • Select organization: ” – Choose “Developers”
  • You should get now: bot created: $NICKNAME & token is now active & login success & Done

Congratulations! you’ve successfully created your first new PAI-Bot

  1. After you configured your Bot, open the terminal and the ` node start`, this will start the Bot process. look for the ” PAI-NET socket connected to server ” log, if you see this message then your Bot is online! 
  2. Go to PAI-Control-Panel and communicate with your Bot. 

Linux / Mac

  • Tested version : Ubuntu 18.04

Docker 

Installation

O/SDocker ImageDocker File
Ubuntu 18.04Ubuntu bot image file 

Prerequisite:

#DownloadHelp
Node.JSNodejs_DownloadUbuntu help link
Pm2PM2Help link
JavaJava_DownloadHelp – (optional)
GitGit_Download
PythonPython_Download(optional)

* installation script will install prerequisite for supported system

Script :

Ubuntu : http://www.git 

Mac: http://sd 

Win: 

Other Linux: 

Run

  • Install Prerequisite
  • Run script: for – Win:run.bat | Ubuntu:run.sh
  • Answer questions
  • Bot is running

FAQ

Q: What the script does?

A:   – Set PAI folder enviroment

  • Create PAI folders: Win:C:\PAI | Ubuntu:/var/PAI
  • Cloning Bot git project
  • Npm login
  • Install npm packages
  • Running bot installation
  • Bot is running
  • Open console: https://dbot.pai-net.org