revamp - bring the bot to life again
parent
594407c204
commit
a6f858671e
@ -0,0 +1,6 @@
|
||||
setup:
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
|
||||
up:
|
||||
.venv/bin/python3 -m tipbot
|
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
export $(cat .env)
|
||||
|
||||
if [ ! -d "$WALLET_PATH" ]; then
|
||||
# initialize new wow wallet and retain seed
|
||||
mkdir -p $WALLET_PATH
|
||||
docker run --rm -it --name tgbot-wallet-init \
|
||||
-v $WALLET_PATH:/root \
|
||||
lalanza808/wownero:latest \
|
||||
wownero-wallet-cli \
|
||||
--daemon-address $DAEMON_URI \
|
||||
--generate-new-wallet /root/wow \
|
||||
--password $WALLET_PASS \
|
||||
--trusted-daemon
|
||||
fi
|
||||
|
||||
# setup rpc process
|
||||
docker run --rm -d --name tgbot-wallet \
|
||||
-v $WALLET_PATH:/root \
|
||||
-p 127.0.0.1:9999:9999 \
|
||||
lalanza808/wownero:latest \
|
||||
wownero-wallet-rpc \
|
||||
--daemon-address $DAEMON_URI \
|
||||
--wallet-file /root/wow \
|
||||
--password $WALLET_PASS \
|
||||
--rpc-bind-port 9999 \
|
||||
--rpc-bind-ip 0.0.0.0 \
|
||||
--confirm-external-bind \
|
||||
--rpc-login "$WALLET_RPC_USER:$WALLET_RPC_PASS" \
|
||||
--log-file /root/rpc.log \
|
||||
--trusted-daemon
|
@ -0,0 +1,9 @@
|
||||
WALLET_PATH=xxx
|
||||
DAEMON_URI=xxx
|
||||
WALLET_PASS=xxx
|
||||
WALLET_RPC_USER=xxx
|
||||
WALLET_RPC_PASS=xxx
|
||||
TG_TOKEN=xxx
|
||||
TG_ADMIN_ID=xxx
|
||||
SQLITE_DB_PATH=xxx
|
||||
DEBUG=xxx
|
@ -1,13 +0,0 @@
|
||||
def qr(update, context):
|
||||
if len(context.args) < 1:
|
||||
update.message.reply_text('Not enough arguments passed.')
|
||||
return False
|
||||
|
||||
# validate address
|
||||
if len(context.args[0]) in [97, 108]:
|
||||
address = context.args[0]
|
||||
else:
|
||||
update.message.reply_text('This does not look like a valid Wownero address. Try again.')
|
||||
return False
|
||||
|
||||
update.message.reply_text(f'https://wownero.club/address/{address}')
|
@ -1,9 +0,0 @@
|
||||
DEBUG = True
|
||||
TG_TOKEN = 'tttttttttttt'
|
||||
TG_ADMIN_ID = 0000000000
|
||||
WALLET_PROTO = 'http'
|
||||
WALLET_HOST = 'localhost'
|
||||
WALLET_PORT = 8888
|
||||
WALLET_USER = 'yyyy'
|
||||
WALLET_PASS = 'xxxxxxxxx'
|
||||
SQLITE_DB_PATH = '/tmp/db.sqlite'
|
@ -0,0 +1,19 @@
|
||||
from dotenv import load_dotenv
|
||||
from os import getenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
TG_TOKEN = getenv('TG_TOKEN')
|
||||
TG_ADMIN_ID = int(getenv('TG_ADMIN_ID'))
|
||||
WALLET_RPC_USER = getenv('WALLET_RPC_USER')
|
||||
WALLET_RPC_PASS = getenv('WALLET_RPC_PASS')
|
||||
SQLITE_DB_PATH = getenv('SQLITE_DB_PATH')
|
||||
DAEMON_URI = getenv('DAEMON_URI')
|
||||
_d = getenv('DEBUG', True)
|
||||
|
||||
if isinstance(_d, str):
|
||||
print(_d)
|
||||
if _d.lower() == 'false':
|
||||
DEBUG = False
|
||||
else:
|
||||
DEBUG = True
|
Loading…
Reference in New Issue