Kevacoin blockchain crawler with full-text index storage in the shared Manticore database (based on Sphinx)
apt install git composer manticore php-fpm php-curl php-mbstring php-pdo php-bcmathgit clone https://github.com/kvazar-network/crawler.gitcd crawlercomposer update
cp example/config.json config.jsonTo prevent data lose on server failures, change default binlog flush strategy to binlog_flush = 1
Remote or local kevacoind connection required as the data source for this crawler.
Create new system user: useradd -m kevacoin then copy kevacoind compiled into the profile root;
make sure kevacoind binary has executable permissions: chmod +x kevacoind
To accept RPC connections from crawler, create kevacoin.conf:
#/home/kevacoin/.kevacoin/kevacoin.conf
rpcuser=USERNAME
rpcpassword=PASSWORD
- make sure
config.jsoncorrespondsrpcuserandrpcpasswordvalues!
This unit auto-created on install Manticore from the official repository
#/etc/systemd/system/kevacoin.service
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=kevacoin
Group=kevacoin
ExecStart=/home/kevacoin/kevacoind -server
[Install]
WantedBy=multi-user.target#/etc/systemd/system/crawler.service
[Unit]
After=network-online.target manticore.service kevacoin.service
Wants=network-online.target manticore.service kevacoin.service
[Service]
Type=simple
User=kevacoin
Group=kevacoin
ExecStart=/usr/bin/php /home/kevacoin/crawler/src/index.php > /dev/null 2>&1
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.targetApply changes
systemctl daemon-reloadsystemctl enable kevacoin manticore crawlersystemctl start kevacoin manticore crawlersystemctl status kevacoin manticore crawler
Crawler works on background as the systemd process; if you want to operate it manually, use following CLI:
php src/index.php 60- crawl, check for new blocks everynseconds (60by default)php src/index.php drop- truncate indexphp src/index.php optimize- optimize index