{"id":19070906,"url":"https://github.com/ohager/orbitdb-remote-poc","last_synced_at":"2026-03-10T03:33:32.304Z","repository":{"id":44209344,"uuid":"270392094","full_name":"ohager/orbitdb-remote-poc","owner":"ohager","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-07T23:39:51.000Z","size":6308,"stargazers_count":4,"open_issues_count":11,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-02T17:04:30.973Z","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/ohager.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":"2020-06-07T18:14:50.000Z","updated_at":"2022-04-28T08:26:52.000Z","dependencies_parsed_at":"2023-01-24T09:45:42.322Z","dependency_job_id":null,"html_url":"https://github.com/ohager/orbitdb-remote-poc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ohager/orbitdb-remote-poc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Forbitdb-remote-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Forbitdb-remote-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Forbitdb-remote-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Forbitdb-remote-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohager","download_url":"https://codeload.github.com/ohager/orbitdb-remote-poc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohager%2Forbitdb-remote-poc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30323189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-11-09T01:21:14.953Z","updated_at":"2026-03-10T03:33:32.271Z","avatar_url":"https://github.com/ohager.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# orbitdb-remote-poc\n\nThis is a proof of concept to demonstrate how IPFS and OrbitDB Pubsub works.\n\nThe producer creates an OrbitDb database and writes frequently data to it.\nFurthermore, it also publishes a message directly to IPFS, which can be listened to. \n\nThe consumer connects to the OrbitDB database and replicates it. Additionally, it\nlistens to the IPFS messages and database updates.\n\n![Demo](./assets/orbitdb-demo.gif)\n\n## Installation\n\n\u003e Needs at least NodeJS 12 installed\n\n`npm i`\n\nYou need to set the bootstrap addresses for both producer and consumer.\n\nIn a first run you need to start with the producer to get the bootstrap address\n```\n===========================================\nIPFS booted\n-------------------------------------------\n{\n  id: 'QmNsaBuMwSitVEneYSvUjbH7Z6c8A5YX5NQdkDsvccioh8',\n  publicKey: 'CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQD5h4ol2do2vL+6Z3fRkJSeFxqZ3i/so/TkvhwqFf1RJMdUN6osJa3pbX8T5TvFktZmje7hGUzbVhvCH1Yxev0C31HBLNJZHvLnux4tmD439N5lAth16HRkN63+Jm3U1ftzRuCStcZP/d9acA3auAc/b/9RYkttnKAxwar+ED2UrhqnFgetvr6+f35pwLtZACfTRbYTUXRukQ9mVM/Kzy8CNnHYeK7N+xQLc/+LBi24Urm+ECV8nq4mpspjbB8lkTB6LEUQ3Qxoqhc2s+Ob+s5M6Ik/w+saivN6JHx4O58DRm63MviZrk1fPTQjazX1+auopOW9XrKspGtIy1LN/1n5AgMBAAE=',\n  addresses: [\n    \u003cMultiaddr 047f000001060faba50322122007ebe4b9e9f0fd355ac0d8e12f7164a2e519f9903c0da4f42ac5dfef3f752e47 - /ip4/127.0.0.1/tcp/4001/p2p/QmNsaBuMwSitVEneYSvUjbH7Z6c8A5YX5NQdkDsvccioh8\u003e,\n    \u003cMultiaddr 047f000001060facdd03a50322122007ebe4b9e9f0fd355ac0d8e12f7164a2e519f9903c0da4f42ac5dfef3f752e47 - /ip4/127.0.0.1/tcp/4002/ws/p2p/QmNsaBuMwSitVEneYSvUjbH7Z6c8A5YX5NQdkDsvccioh8\u003e,\n    \u003cMultiaddr 04c0a8006a060faba50322122007ebe4b9e9f0fd355ac0d8e12f7164a2e519f9903c0da4f42ac5dfef3f752e47 - /ip4/192.168.0.106/tcp/4001/p2p/QmNsaBuMwSitVEneYSvUjbH7Z6c8A5YX5NQdkDsvccioh8\u003e,\n    \u003cMultiaddr 04c0a8006a060facdd03a50322122007ebe4b9e9f0fd355ac0d8e12f7164a2e519f9903c0da4f42ac5dfef3f752e47 - /ip4/192.168.0.106/tcp/4002/ws/p2p/QmNsaBuMwSitVEneYSvUjbH7Z6c8A5YX5NQdkDsvccioh8\u003e\n  ],\n  agentVersion: 'js-ipfs/0.46.0',\n  protocolVersion: '9000'\n}\n===========================================\n```\nThe bootstrap address is of format:\n\n`/ip4/\u003cip\u003e/tcp/4001/p2p/\u003cipfs-id\u003e`\n\nExample: `/ip4/127.0.0.1/tcp/4001/p2p/QmNsaBuMwSitVEneYSvUjbH7Z6c8A5YX5NQdkDsvccioh8`\n\nThe database address you will need as argument for the consumer.\nThen go to `config.consumer.js` and add the swarm address to the bootstrap section.\nOnce started the consumer pick up its swarm address and add as bootstrap for the producer.\nThen both are able to communicate in a bi-directional manner.\n \n\n## Run Producer\n\nAfter configuration run the producer like this:\n\n`npm run producer`\n\nOn start, it will list the database address, which you need for the consumer as argument:\n\n```\n===========================================\nDatabase initialized\nAddress: /orbitdb/zdpuAzoyTYPqa7BNa2Npm9hyrKcFX1HNNMzh5r8FK7nSdwg5W/producer\n===========================================\n```\n\n## Run Consumer\n\nTo run the consumer you need to get the database address from the producer\n\n`npm run consumer \u003cdb-address\u003e`\n\nExample:\n\n`npm run start:consumer /orbitdb/zdpuAzoyTYPqa7BNa2Npm9hyrKcFX1HNNMzh5r8FK7nSdwg5W/producer`\n\nYou get the database address from the producers output:\n\n## Troubleshooting\n\nMost probably you will have problems with the connections between both participants.\n\n1. To run them on the same computer the consumer must be on other ports than the producer\n\n__The Consumer Config__\n```js\n   // CONSUMER CONFIG\n    config: {\n       Addresses: {\n         Swarm: [\n            // set to non-conflicting ports\n           \"/ip4/0.0.0.0/tcp/4011\",\n           \"/ip4/0.0.0.0/tcp/4012/ws\"\n         ]\n       },\n       Bootstrap: [\n          // the producers multiaddress string\n          // The last segment is the ipfs id, which is different in your case\n          // you get the address from the producers start up log (look for 'IPFS booted')\n         \"/ip4/127.0.0.1/tcp/4001/p2p/QmTW2V77WZzWXk1u7RQHwZGr9SMktVvibWns8oYwQsCfHQ\"\n       ]\n     },\n```\n\n__The Producer Config__\n```js\n    config: {\n       Addresses: {\n         Swarm: [\n           \"/ip4/0.0.0.0/tcp/4001\",\n           \"/ip4/0.0.0.0/tcp/4002/ws\"\n         ]\n       },\n       Bootstrap: [\n          // the consumers multiaddress string\n          // The last segment is the ipfs id, which is different in your case\n          // you get the address from the consumers start up log (look for 'IPFS booted')\n         \"/ip4/127.0.0.1/tcp/4011/p2p/QmNsaBuMwSitVEneYSvUjbH7Z6c8A5YX5NQdkDsvccioh8\"\n       ]\n     },\n```\n\n\u003e For remote communication you need the external IPs and eventually configure firewall or port forwarding\n\n2. The addresses need to be added to the bootstrap section in the config files (or added dynamically in the code)\n    - the addresses may look like this `/ip4/77.56.45.83/tcp/4001/p2p/QmVmYesEWZm4L1YbrVhCvJEzCDNCvrU56E22HSDXiaCTy4`\n    - the consumer needs the address from the producer, and vice versa\n3. Check if your firewall is blocking the ports 4001 and 4002\n4. Check if your ports are forwarded, i.e. activate port forwarding in the router  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohager%2Forbitdb-remote-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohager%2Forbitdb-remote-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohager%2Forbitdb-remote-poc/lists"}