Bot for Multiple Social Networking Platforms for Giving/Receiving Lotus to/from other Users.
Continuous Testing & Integration not implemented yet
- NodeJS 18.x (Recommend NodeJS repository for latest security updates: https://nodejs.org/en/download/package-manager/) (For Windows Admins: Make sure NodeJS is installed to the system $PATH)
- TypeScript ^4.x (Installed during
npm install
) (For Windows Admins: Install this manually & globally -npm install -g typescript
) - Prisma ^4.8.x (Installed during
npm install
) - sqlite3 package (Optional, Linux Only)
IMPORTANT: You will need to install git
and sqlite3
on your system
To run the automated install, paste and execute the following command in your terminal: curl https://raw.githubusercontent.com/givelotus/lotus-bot/main/install.sh | sudo bash
After the installation completes, you will need to edit your /opt/lotus-bot/.env
file to fill in the appropriate values for your platform!
The install.sh
script will:
- Clone this repository to
/opt/lotus-bot
directory - Create a new system user with the repository as its
$HOME
folder and ensure proper permissions - Create the
.env
config file - Install NPM dependencies
- Set up Prisma and sqlite3 database
- Install systemd service
If you prefer to not run the Automatic Install, or if you are running Windows, follow the below prcoedure.
- Install sqlite3 per your distribution's package management system
- Set up the folder to hold the repo -
sudo mkdir -p /opt/lotus-bot
- Clone the repo -
sudo git clone https://github.com/givelotus/lotus-bot.git /opt/lotus-bot
- Open the folder in your favorite terminal
- Then
cp .env.example .env
- Modify
.env
with the required API key(s) for the bot(s) you want to run. - Install dependencies:
npm install
- Initialize the Database:
npx prisma migrate dev --name init
sqlite3 ./prisma/dev.db 'PRAGMA journal_mode=WAL; PRAGMA synchronous=FULL;'
- systemd is supported, you can install the service unit from the
install/
folder:
sudo cp ./install/lotus-bot.service /etc/systemd/system
sudo systemctl daemon-reload
- Install typescript globally:
npm install -g typescript
(This will require Administrator Rights) - Setup a folder to hold the repo, example:
C:\Lotus\lotus-bot
- Clone the repo into said folder:
git clone https://github.com/givelotus/lotus-bot.git C:\Lotus\lotus-bot
- Open the folder in cmd or PowerShell
- Then
copy .env.example .env
- Modify
.env
with the required API key(s) for the bot(s) you want to run. - Install dependencies:
npm install
- Initialize the Database:
npx prisma migrate dev --name init
sqlite3 ./prisma/dev.db 'PRAGMA journal_mode=WAL; PRAGMA synchronous=FULL;'
- TBD
These commands are for the user-space; they are not administrative in nature.
balance .......... Check your Lotus balance
deposit .......... Deposit Lotus to your account
withdraw ......... Withdraw Lotus to your wallet address
link .......... Connect platform accounts to share a wallet balance
give .......... Give Lotus to another user
Starting with v2.1.0, the "give" interaction of lotus-bot is now done on-chain. The Give database table is now simply used for tracking gives rather than for calculating user balances. User balances are now calculated solely by the UTXOs of the user's WalletKey
.
We require the sqlite3 package in order to enable Write-Ahead Logging (WAL) on the Prisma-generated sqlite database. We do this so that you can run multiple instances of the bot on the same sqlite database (i.e. to safely handle simultaneous write operations).
More information about WAL can be found here
NOTE: Since v2.0.0, WAL is no longer required, but the PRAGMA changes are still part of the install for helping ensure database integrity.
WAL is enabled by default with Prisma on Windows[?]
Telegram: @maff1989
Discord: maff1989#2504