{"id":49714802,"url":"https://github.com/hive-engine/ssc_tokens_history","last_synced_at":"2026-05-08T19:34:20.805Z","repository":{"id":43941622,"uuid":"260615323","full_name":"hive-engine/ssc_tokens_history","owner":"hive-engine","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-01T14:17:46.000Z","size":238,"stargazers_count":7,"open_issues_count":16,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-01T17:47:58.872Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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":"history_builder.js","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}},"created_at":"2020-05-02T04:44:34.000Z","updated_at":"2025-02-10T10:24:38.000Z","dependencies_parsed_at":"2024-01-28T03:24:49.782Z","dependency_job_id":"a1c0ebfc-3702-41ca-a7c6-d16c941f11be","html_url":"https://github.com/hive-engine/ssc_tokens_history","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hive-engine/ssc_tokens_history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fssc_tokens_history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fssc_tokens_history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fssc_tokens_history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fssc_tokens_history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hive-engine","download_url":"https://codeload.github.com/hive-engine/ssc_tokens_history/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hive-engine%2Fssc_tokens_history/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:20.104Z","updated_at":"2026-05-08T19:34:20.787Z","avatar_url":"https://github.com/hive-engine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Steem Smart Contracts tokens history\n\nScans the Steem Smart Contracts blockchain (`history_builder.js`) to generate an index of historical \ntransactions (generally transfers) that can easily be queried using GET queries to the \nNodeJS server `server.js`\n\nUsed by [Steem-Engine](https://steem-engine.com) for transaction history (endpoint: `https://api.steem-engine.com/accounts/history`)\n\nCreated and maintained by @harpagon210 [(Original Github Repo)](https://github.com/harpagon210/ssc_tokens_history)\n\nSome additional contributions, including this README by @someguy123 / @privex [(Privex Fork)](https://github.com/Privex/ssc_tokens_history)\n\nReleased under the **MIT License** (See the file `LICENSE` for more info)\n\n# API Usage + Libraries\n\nBy default, the application itself exposes a single endpoint on port 3000 `/history`\n\nThe official history API for https://steem-engine.com is aliased to `/accounts/history`:\n\n```\nhttps://api.steem-engine.com/accounts/history\n```\n\nAn example GET query to view the most recent 5 transactions made by @someguy123 using the token `SGTK`:\n\n```\ncurl -fsSL https://api.steem-engine.com/accounts/history?account=someguy123\u0026limit=5\u0026offset=0\u0026type=user\u0026symbol=SGTK\n```\n\n**GET Parameters:**\n\n - `account` - (required) Filter TXs to/from the username of a Steem account whom uses the SSC sidechain\n - `limit` - (optional) The amount of recent TXs to load (Default: `500`)\n - `offset` - (optional) For paginating, list transactions AFTER `offset` recent transactions (Default: `0`)\n - `type` - (optional) Either `user` (TXs triggered by the user) or `contract` (TXs triggered by a smart contract)\n - `symbol` - (optional) Only list transactions involving this token symbol, e.g. `ENG` or `STEEMP`\n\n**Libraries for this API**\n\nPython Libraries:\n\n - [Privex's Python Steem-Engine Library](https://github.com/Privex/python-steemengine) | `pip3 install privex-steemengine`\n\n\n# Pre-requisites\n\n - **PostgreSQL 10** or newer is recommended\n - NodeJS (Last tested by @someguy123 on Node v10.16.2 LTS)\n\nInstall **PostgreSQL** if you don't already have it installed.\n\n```sh\napt install -y postgresql postgresql-client postgresql-client-common\n```\n\nInstall **NodeJS** 10 or higher with `nvm` if you don't already have it installed.\n\n**Note:** You don't need to do this as root. For security, it's generally a good idea to create a Linux user just for this application, it doesn't require root. Install NVM and NodeJS under the user you plan to run SSC History under.\n\n```sh\n# Create the user `ssc` and disable log-in over SSH / Console for safety\nroot@myhost ~ # adduser --gecos \"\" --disabled-login ssc\n# Change to the user `ssc` for any operations that don't require root.\nroot@myhost ~ # su - ssc\n\n# Install NVM\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash\n\n# Load NVM for the first time, since you've only just installed it.\nexport NVM_DIR=\"${XDG_CONFIG_HOME/:-$HOME/.}nvm\"\n[ -s \"$NVM_DIR/nvm.sh\" ] \u0026\u0026 \\. \"$NVM_DIR/nvm.sh\" # This loads nvm\n\n# Install the latest LTS (Long term support) version of NodeJS + NPM\nnvm install --lts\n```\n\n\n\n# Installation\n\nCreate a Postgres user and database to store the history data.\n\n```sh\nsu - postgres\n\n###\n# As the postgres user:\n###\n\n# Create the PostgreSQL user 'steemssc' and set a password (save it somewhere, you'll need it for the config)\ncreateuser -SDRl -P steemssc\n\n# Create a database called 'steemssc' owned by the user 'steemssc'\ncreatedb -O steemssc steemssc\n\nexit\n```\n\nNow that you have PostgreSQL ready to use, clone the repo and install the NodeJS packages.\n\n```sh\nroot@myhost ~ # su - ssc\n\n# As the `ssc` user\ngit clone https://github.com/harpagon210/ssc_tokens_history.git\ncd ssc_tokens_history\nnpm install\n```\n\n# Configuration\n\nInside of `ssc_tokens_history` you'll want to create a file called `.env` and fill it with the database connection details.\n\n```sh\nnano .env    # Use whatever text editor you prefer. Nano is the easiest\n```\n\nThe contents of .env should look like this:\n\n```env\nDATABASE_URL=postgres://steemssc:ThePasswordYouSetEarlier@localhost:5432/steemssc\n```\n\nSave the file.\n\nNext, you'll want to open up `config.json`.\n\n```sh\nnano config.json\n```\n\nThe only thing you'll probably need to change is the list of RPC nodes. By default, it uses `https://testapi.steem-engine.com` which is for the testnet.\n\nFor the main network, you'll want to use `https://api.steem-engine.com/rpc` (or any other SSC RPC node of your choice).\n\n```js\n{\n    \"nodes\": [\n        \"https://api.steem-engine.com/rpc\"\n    ],\n    \"lastSSCBlockParsed\": 0,\n    \"port\": 3000,\n    \"pollingTime\": 1000\n}\n```\n\n# Running + Final setup\n\nNow that you've configured the application, you'll now need to create the schema.\n\nAs the user you've installed SSC History under:\n\n```sh\n\n# This will create the Postgres database schema for 'transactions' using\n# the database connection details in the file '.env'\n\nssc@myhost ~/ssc_tokens_history $ node initDB.js\n```\n\nTo confirm the database was created, log into `postgres` again, and check if the table exists.\n\n```sh\nroot@myserver ~ # su - postgres\n\npostgres@myserver ~ $ psql steemssc\n\nsteemssc=# \\dt\n            List of relations\n Schema |     Name     | Type  |  Owner\n--------+--------------+-------+----------\n public | transactions | table | steemssc\n(1 row)\n\n```\n\nPress `CTRL-D` to exit the postgres shell, and type `exit` to return to your user.\n\nNow back to the history app.\n\nIt's time to start loading blocks into the database. Run `node history_builder.js` (it's best to do this in something like `tmux` or `screen` so it can run in the background)\n\n```sh\nssc@myhost ~ $ cd ssc_tokens_history\n\nssc@myhost ~/ssc_tokens_history $ node history_builder.js\nparsing block #1\nparsing block #2\nparsing block #3\n```\n\nIf everything is working correctly, you'll see output like above with `parsing block #123`\n\nTo run the actual history server, run the following (in another terminal. leave history_builder.js running in the background)\n\n```sh\nssc@myhost ~ $ cd ssc_tokens_history\n\nssc@myhost ~/ssc_tokens_history $ node server.js\n```\n\nThe server will not output anything, but you can test that it's working by running a query using `curl` and `jq`\n\nYou don't have to wait for `history_builder.js` to finish loading all blocks, you'll just have outdated history information until it's fully synced.\n\n(`jq` is optional, but it will make the output easier to read)\n\n```sh\nroot@myhost ~ # apt install -y jq curl\n# Request the most recent transaction\nroot@myhost ~ # curl -fsSL \"http://localhost:3000/history?account=steemsc\u0026limit=1\" -o - | jq\n[\n  {\n    \"block\": \"1635\",\n    \"txid\": \"dd7ee73d1c430c3455a996ba5e9036562614dcad\",\n    \"timestamp\": \"2019-02-21T20:20:36.000Z\",\n    \"symbol\": \"ENG\",\n    \"from\": \"steemsc\",\n    \"from_type\": \"user\",\n    \"to\": \"charlie777pt\",\n    \"to_type\": \"user\",\n    \"memo\": null,\n    \"quantity\": \"20\"\n  }\n]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhive-engine%2Fssc_tokens_history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhive-engine%2Fssc_tokens_history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhive-engine%2Fssc_tokens_history/lists"}