comment server implemented in python to host comments on lbry
Go to file
2019-06-07 17:42:17 -05:00
config removes anonymous channel from being used as the default channel for anonymous comments 2019-05-31 15:55:48 -04:00
schema removes unnecessary column 2019-06-06 03:23:30 -05:00
src Moves functions around into more logical locations 2019-06-06 04:43:47 -05:00
tests Fixes unittests for comment creating 2019-06-07 17:42:17 -05:00
compile.py Moves async code around 2019-05-26 00:42:39 -04:00
LICENSE.md Create LICENSE.md 2019-05-21 08:17:10 -04:00
main.py Modifies tests and entrypoint 2019-05-29 18:01:48 -04:00
README.md Updates README 2019-06-06 03:23:08 -05:00
requirements.txt Makes compile-friendly 2019-05-25 22:44:56 -04:00
schema.png Updates schema diagram 2019-06-06 03:27:31 -05:00

LBRY Comment Server

Installation

Firstly you'll need to install and run the lbrynet daemon, the details of which can be found here.

Installing the server:


$ git clone https://github.com/osilkin98/comment-server
$ cd comment-server

# create a virtual environment
$ virtualenv --python=python3 venv

# Enter the virtual environment
$ source venv/bin/activate

# install the library dependencies
(venv) $ pip install -r requirements.txt

Usage

First, make sure that the LBRY API server is running, to do so you can run the following:

(venv) $ curl  --data '{ "method": "status"}' http://localhost:5279/ | grep is_running

# Or from the lbrynet virtual environment:
(lbry-venv) $ lbrynet status | grep is_running

Then to start the server, simply run:

(venv) $ python -m main &  

Schema

schema

About

A lot of the design is more or less the same with the original, except this version focuses less on performance and more on scalability.

Rewritten with python because it's easier to adjust and maintain. Instead of doing any multithreading, this implementation just delegates a single database connection for write operations.

The server was originally implemented with aiohttp and uses aiojobs for scheduling write operations. As pointed out by several people, Python is a dinosaur in comparison to SQLite's execution speed, so there is no sensibility in multi-threading from the perspective of the server code itself.