Code that lives in the bepsi vending machine that does three things:
- Listens to MATIC/DAI/USDC/USDT payments to
PAYMENT_ADDRESS
, on payment dispenses bepsi - Listens to an LNbits websockets, on payment dispenses bepsi
- Listens to discord emoji reaction, on reaction dispenses bubbly
This guide was written for Debian 12.
sudo apt install git make build-essential
Requires Node.js
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 20
Requires Yarn
npm install --global yarn
git clone https://github.com/GitYVR/bepsi-pi.git
cd bepsi-pi
yarn install
Copy the example environment and fill out the parameters:
cp .env.example .env
nano .env
To test run:
yarn start
To persist bepsi-pi and make it run on startup:
cd ~/bepsi-pi
npm install -g pm2
pm2 start index.js --name bepsi-pi --exp-backoff-restart-delay=100
pm2 startup
pm2 will then issue you a command that will generate and install a systemd file for your system. Run this command and restart your machine to test this.
Useful commands:
pm2 list
pm2 monit
To see logs:
pm2 logs bepsi-pi