{"id":49714790,"url":"https://github.com/hive-engine/distribution-engine-smt","last_synced_at":"2026-05-08T19:34:18.862Z","repository":{"id":76639896,"uuid":"362881087","full_name":"hive-engine/distribution-engine-smt","owner":"hive-engine","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-29T04:09:20.000Z","size":217,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-11-29T22:38:09.185Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hive-engine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-29T16:31:11.000Z","updated_at":"2025-11-29T04:09:23.000Z","dependencies_parsed_at":"2025-11-29T10:04:05.446Z","dependency_job_id":null,"html_url":"https://github.com/hive-engine/distribution-engine-smt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hive-engine/distribution-engine-smt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fdistribution-engine-smt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fdistribution-engine-smt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fdistribution-engine-smt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fdistribution-engine-smt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hive-engine","download_url":"https://codeload.github.com/hive-engine/distribution-engine-smt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fdistribution-engine-smt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32794716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-08T19:34:18.055Z","updated_at":"2026-05-08T19:34:18.856Z","avatar_url":"https://github.com/hive-engine.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# distribution-engine\nIndexing for Hive Engine Comments Smart Contract\n\n## Installation of packages for Ubuntu 18.04\n\n```\nsudo apt-get install postgresql postgresql-contrib python3-pip libicu-dev build-essential libssl-dev python3-dev git\n\n# versioned python packages\nsudo apt-get install python3.10-dev\n```\n\n## Server\n\n```\nsudo apt install nginx ufw php7.2-fpm php7.2-pgsql\n```\nadminer (for UI access to manage postgres DB)\n```\nsudo mkdir /usr/share/adminer\nsudo wget \"https://www.adminer.org/latest.php\" -O /usr/share/adminer/latest.php\nsudo ln -s /usr/share/adminer/latest.php /usr/share/adminer/adminer.php\nsudo ln -s /usr/share/adminer/adminer.php /var/www/html\n```\n\n## Installation of python packages\n\n**General Warning**: Be aware of which pip version is used. If straddling versions, you may have pip3, pip3.6, pip3.7. or use python3.x -m pip.\n\n(Block streaming is using scot user)\n```\nsudo apt-get install -y python3-setuptools\nsudo apt-get install -y python3.8-dev\npython3.10 -m pip install wheel hive-nectar dataset psycopg2-binary nectarengine base36 python-dateutil\n```\n\n(API on machine is using root to run gunicorn)\n```\nsudo su\npython3.10 -m pip install gunicorn flask flask-cors flask-compress flask-caching prettytable pytz \npython3.10 -m pip install wheel hive-nectar dataset psycopg2-binary secp256k1prp nectarengine base36 sqltap simplejson\npython3 setup.py install\n```\n\nNOTE: In some cases, need --user setting for the module to be visible to the api server (if running official setup),\ne.g. `sudo su; python3.8 -m pip install --user flask-compress flask-caching`\n\nNote the config cache directory (config.json), make sure that directory is set up and accessible.\n\n## /mem\n```\nsudo cp /etc/fstab /etc/fstab.orig\nsudo mkdir /mem\necho 'tmpfs       /mem tmpfs defaults,size=64m,mode=1777,noatime,comment=for-gunicorn 0 0' | sudo tee -a /etc/fstab\nsudo mount /mem\n```\n\n## Create engine user\n```\nadduser engine\n```\n\n## Setup of the postgresql database\n\nSet a password and a user for the postgres database:\n\n```\nsu postgres\npsql -c \"\\password\"\ncreatedb engine\n```\n\n## Prepare the postgres database\n```\npsql -d engine -a -f sql/engine.sql\n```\n\n## Config file for accessing the database and engine rpc\nA `config.json` file must be stored in the main directory and in the homepage directory where the `app.py` file is.\n```\n{\n        \"engine_api\": \"https://api2.hive-engine.com/rpc/\",\n        \"engine_id\": \"ssc-mainnet-hive\",\n        \"apiCacheDir\": \"/tmp/scotcache\"\n        \"databaseConnector\": \"postgresql://postgres:password@localhost/engine\",\n}\n```\n\nAlso create /tmp/scotcache\n\n```\nmkdir /tmp/scotcache\n```\n\n## Running the scripts\n\nWhen running for the first time, set the `last_streamed_block` of the HIVED configuration entry\nand the `last_engine_streamed_block` of the `ENGINE_SIDECHAIN` configuration entry\nto the hive block and hive engine sidechain block, respectively, where your SMT was introduced.\n\nRun the following with your process manager of choice (e.g. pm2)\n```\n./run-engine-sc.sh\n./run-engine.sh\n(dev) ./run-api-server.sh\n(prod) ./run-prod-api-server.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhive-engine%2Fdistribution-engine-smt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhive-engine%2Fdistribution-engine-smt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhive-engine%2Fdistribution-engine-smt/lists"}