{"id":21815702,"url":"https://github.com/bitcoin-com/ws.bitcoin.com","last_synced_at":"2025-04-14T00:51:53.343Z","repository":{"id":42338000,"uuid":"196515419","full_name":"Bitcoin-com/ws.bitcoin.com","owner":"Bitcoin-com","description":"WebSockets","archived":false,"fork":false,"pushed_at":"2023-07-18T17:21:20.000Z","size":3058,"stargazers_count":2,"open_issues_count":26,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T14:55:15.276Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Bitcoin-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-12T05:40:39.000Z","updated_at":"2023-11-14T10:26:34.000Z","dependencies_parsed_at":"2023-02-17T00:00:54.110Z","dependency_job_id":null,"html_url":"https://github.com/Bitcoin-com/ws.bitcoin.com","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitcoin-com%2Fws.bitcoin.com","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitcoin-com%2Fws.bitcoin.com/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitcoin-com%2Fws.bitcoin.com/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitcoin-com%2Fws.bitcoin.com/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bitcoin-com","download_url":"https://codeload.github.com/Bitcoin-com/ws.bitcoin.com/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804781,"owners_count":21164131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-27T15:21:56.590Z","updated_at":"2025-04-14T00:51:53.321Z","avatar_url":"https://github.com/Bitcoin-com.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ws.bitcoin.com\n\n### Installation\n\nInstall NodeJS [latest long term support](https://nodejs.org/en/) (LTS) version. Confirm it worked:\n\n```\nnode -v\nv10.15.3\n```\n\nClone the git repo from github\n\n```\ngit clone https://github.com/Bitcoin-com/ws.bitcoin.com.git\ncd ws.bitcoin.com\n```\n\nInstall the dependencies\n\n```\nnpm install\n```\n\nEdit the `start-local-server` file and for the `ZEROMQ_URL` value add the IP address of your full node where you have bitcoin cash data streaming in real-time over zeromq.\n\n```\n#!/bin/bash\n\nexport ZEROMQ_PORT=28332\nexport ZEROMQ_URL=ip.address.of.node\nexport NETWORK=mainnet\n\nnpm start\n```\n\nStart the app.\n\n```\n./start-local-server\n\nws.bitcoin.com started on port 3000\nConnecting to BCH ZMQ at ip.address.of.node:28332\n```\n\nOpen a BITBOX console with [bitbox-cli](https://www.npmjs.com/package/bitbox-cli)\n\n```\nbitbox console\n\u003e let socket = new bitbox.Socket({\n...   callback: () =\u003e {\n.....     console.log(\"connected\")\n.....   },\n...   restURL: \"http://localhost:3000\"\n... })\nconnected\n\u003e socket.listen(\"transactions\", message =\u003e {\n...   console.log(message)\n... })\n\u003e {\n  \"format\": {\n    \"txid\": \"656e9c88acedfe97aea87ef8f750d5ae4cfd34d9f2c1bbcedfcb04f891ac58bf\",\n    \"version\": 1,\n    \"locktime\": 0,\n    \"size\": 271,\n    \"vsize\": 271\n  },\n  \"inputs\": [\n    {\n      \"txid\": \"23785a10ace5525a0d5c7b95cb35e70fe32f8cd93821ec91ef623e6467c43ae4\",\n      \"n\": 1,\n      \"script\": \"30440220552b9725f844f825d819b644dec43a3cdc1171a0157a1d8aef945522ab2e0a600220683e3ea8626bc2199f7d72971f61e18ba24ba3218d9e138f9e209d5563a9b78e41 0467ff2df20f28bc62ad188525868f41d461f7dab3c1e500314cdb5218e5637bfd0f9c02eb5b3f383f698d28ff13547eaf05dd9216130861dd0216824e9d7337e3\",\n      \"sequence\": 4294967295\n    }\n\n  ... real-time transactions data\n```\n\nYou can also pass in `\"blocks\"` to get real-time block data over websockets\n\n```js\nlet socket = new bitbox.Socket({\n  callback: () =\u003e {\n    console.log(\"connected\")\n  },\n  restURL: \"http://localhost:3000\"\n})\nsocket.listen(\"transactions\", message =\u003e {\n  console.log(message)\n})\nsocket.listen(\"blocks\", message =\u003e {\n  console.log(message)\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoin-com%2Fws.bitcoin.com","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitcoin-com%2Fws.bitcoin.com","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoin-com%2Fws.bitcoin.com/lists"}