You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
torrent-paradise/index-generator
Urban Guacamole 241a83281f Clean up
Before publishing to Github
5 years ago
..
README Clean up 5 years ago
main.js Clean up 5 years ago
main.ts Clean up 5 years ago
package-lock.json Initial commit 5 years ago
package.json Initial commit 5 years ago
tsconfig.json Initial commit 5 years ago

README

Takes a sqlite DB (export of postgres that is used by spider, tracker-scraper and import-tpb-dump) and generates the index, using the ipfsearch-index library.

Getting sqlite dump from the postgres: 
nextgen@ipfsearch: ~$ pg_dump --data-only --inserts nextgen > dump.sql

# remove header from dump (manually)

sed -i -e 's/public.peercount/peercount/g' dump.sql
sed -i -e 's/public.torrent/torrent/g' dump.sql
tail -n +2 dump.sql > newdump.sql
mv newdump.sql dump.sql
gzip dump.sql

# copy dump.sql.gz to index-generator directory, unzip

user@localhost $ scp user@server:/home/nextgen/dump.sql.gz .
$ sqlite3 db.sqlite3

sqlite> CREATE TABLE peercount ( infohash char(40), tracker varchar, seeders int, leechers int, completed int, scraped timestamp);
sqlite> CREATE TABLE torrent( infohash char(40), name varchar, length bigint, added timestamp);
sqlite> BEGIN;
sqlite> .read dump.sql
sqlite> END;