{"action":"created","issue":{"url":"https://api.github.com/repos/orbitdb/orbit-db/issues/498","repository_url":"https://api.github.com/repos/orbitdb/orbit-db","labels_url":"https://api.github.com/repos/orbitdb/orbit-db/issues/498/labels{/name}","comments_url":"https://api.github.com/repos/orbitdb/orbit-db/issues/498/comments","events_url":"https://api.github.com/repos/orbitdb/orbit-db/issues/498/events","html_url":"https://github.com/orbitdb/orbit-db/issues/498","id":379467951,"node_id":"MDU6SXNzdWUzNzk0Njc5NTE=","number":498,"title":"Electron apps syncing simple db between each other ","user":{"login":"ZeeCoder","id":3679506,"node_id":"MDQ6VXNlcjM2Nzk1MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/3679506?v=4","gravatar_id":"","url":"https://api.github.com/users/ZeeCoder","html_url":"https://github.com/ZeeCoder","followers_url":"https://api.github.com/users/ZeeCoder/followers","following_url":"https://api.github.com/users/ZeeCoder/following{/other_user}","gists_url":"https://api.github.com/users/ZeeCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeeCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeeCoder/subscriptions","organizations_url":"https://api.github.com/users/ZeeCoder/orgs","repos_url":"https://api.github.com/users/ZeeCoder/repos","events_url":"https://api.github.com/users/ZeeCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ZeeCoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-10T22:29:24Z","updated_at":"2018-11-10T22:52:04Z","closed_at":null,"author_association":"NONE","body":"I'm a bit confused what I need to do here to have several electron apps communicate with each other, and syncing a simple key-value db.\r\nEssentially any app could add or modify the contents of the DB over a local network.\r\n\r\nI've created a local DB in one of the apps using **orbit-db** and **ipfs**, but I'm not sure how to connect two.\r\nIn the getting started guide in the replication section (https://github.com/orbitdb/orbit-db/blob/master/GUIDE.md#replicating-a-database) there seem to be an assumtion, that there's a \"master\" DB, which is replicated by the second DB, which is not what I want.\r\n\r\nEssentially these apps would need to automatically discover each other, and just sync automatically, without having a \"master\" that all others replicate.\r\n\r\nAnother thing that confused me is this the \"ipfs daemon\" (https://github.com/orbitdb/orbit-db#module-with-ipfs-daemon) which seems to be recommended for electron apps, but I'm not sure what the difference is between this and my first approach which just using the ipfs module.\r\n\r\n\r\nI'm sure I just need to do my research, I just feel like I don't know where to look. 😅"},"comment":{"url":"https://api.github.com/repos/orbitdb/orbit-db/issues/comments/437627988","html_url":"https://github.com/orbitdb/orbit-db/issues/498#issuecomment-437627988","issue_url":"https://api.github.com/repos/orbitdb/orbit-db/issues/498","id":437627988,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzYyNzk4OA==","user":{"login":"aphelionz","id":106148,"node_id":"MDQ6VXNlcjEwNjE0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/106148?v=4","gravatar_id":"","url":"https://api.github.com/users/aphelionz","html_url":"https://github.com/aphelionz","followers_url":"https://api.github.com/users/aphelionz/followers","following_url":"https://api.github.com/users/aphelionz/following{/other_user}","gists_url":"https://api.github.com/users/aphelionz/gists{/gist_id}","starred_url":"https://api.github.com/users/aphelionz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aphelionz/subscriptions","organizations_url":"https://api.github.com/users/aphelionz/orgs","repos_url":"https://api.github.com/users/aphelionz/repos","events_url":"https://api.github.com/users/aphelionz/events{/privacy}","received_events_url":"https://api.github.com/users/aphelionz/received_events","type":"User","site_admin":false},"created_at":"2018-11-10T22:52:04Z","updated_at":"2018-11-10T22:52:04Z","author_association":"NONE","body":"Hey, @ZeeCoder! I believe I understand that you want each app to contain one or more orbitdbs, and simply make those available to other electron apps on the same system. Is this correct? \r\n\r\nTo start our troubleshooting, let's ensure that each of the nodes are connected to one another. OrbitDB requires this. You can do this by trying the following steps:\r\n\r\nLet's assume your IPFS variable is simply `ipfs`.\r\n\r\n1. running something like `ipfs.id().then(console.log)` and noting the multiaddr of the node. something like `/ip4/127.0.0.1/tcp/[####]/Qm....`\r\n2. Copying that value into the \"Bootstrap\" field of the IPFS config object in your electron app's JS\r\n3. Then, you should be able tp run `ipfs.swarm.peers()` inside each app and see an array of peers, the ids of which should match your app's id.\r\n4. Copy this process for each app, *in* each app until all apps are \"bootstrapped\" with all the others.\r\n5. Run your tests again.\r\n\r\nNow, I'm not too sure about how electron networking works, but assuming that they all just communicate with the host network, then you'll just have a bunch of `js-ipfs` daemons running on a bunch of different ports."}}
{"actor":{"display_login":"aphelionz"}}