A simple cryptocurrency funding system made with:
- Python
- Quart web-framework
- pewee ORM
- Postgres
- Redis
TL;DR:
apt install -y python3-virtualenv libjpeg-dev libpng-dev python3 redis-server postgresql postgresql-contrib postgresql-server-dev-*
virtualenv -p /usr/bin/python3 venv
source venv/bin/activate
pip install -r requirements.txt
cp settings.py_example settings.py
# change the settings, then execute `run.py`
python3 run.pyAlternatively use asgi.py for usage via hypercorn or
uvicorn.
Some options in settings.py need changing:
- Set:
DB_*- point to a Postgres database - Optional:
REDIS_URIif your Redis instance has a non-default configuration - Optional:
X_FORWARDEDtoTrueif proxied by a webserver (X-Forwarded-Forexpected) - Set
APP_SECRET. - Set
DOMAINtomydomain.com - Optional:
DISCOURSE_*related options to connect to Discourse - Set
COIN_*, see also below 'Coin configuration'
To auto-post on Discourse, navigate to the Discourse API keys page (you need to be a system admin):
[YourSite]/admin/api/keys
This will include the comments from Discourse on the proposal page and turn on automatic Discourse topic creation when a proposal is posted.
Important: some handy Discourse options to change:
- Increase
DISCOURSE_MAX_ADMIN_API_REQS_PER_MINUTE - Increase
DISCOURSE_MAX_REQS_PER_IP_PER_10_SECONDS
Download and extract the most recent release to get firod.
Run this somewhere (via a systemd unit file, or just a screen/tmux session, etc.):
./firod -rpcbind=127.0.0.1 \
-rpcallowip=127.0.0.1 \
-rpcport=18888 \
-rpcuser=admin \
-rpcpassword=admin
And set settings.py options:
- Set
COIN_NAMEto'firo' - Set
COIN_RPC_PORTto18888 - Set
COIN_RPC_AUTHto'admin,admin'
MIT
