{"_id":"@dhub/mirroring-service","_rev":"2-480f854eb78d21140ccf031ac3fecd87","name":"@dhub/mirroring-service","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@dhub/mirroring-service","version":"1.0.0","description":"A dHub service with an RPC API for mirroring.","main":"index.js","scripts":{"build":"drpc_dweb rpc/schema.proto --rpc=rpc/index.js --messages=rpc/messages.js","test":"standard && tape test/*.js","start":"node server.js"},"repository":{"type":"git","url":"git+https://github.com/dwebprotocol/dhub-mirroring-service.git"},"keywords":["dhub","seeding","mirroring"],"author":{"name":"PeepsLabs","email":"peepslabs@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/dwebprotocol/dhub-mirroring-service/issues"},"homepage":"https://dwebx.org","devDependencies":{"standard":"^16.0.3","tape":"^5.0.1"},"dependencies":{"@dhub/client":"^1.0.0","drpc_dweb":"^1.0.0","drpc_dweb-runtime":"^1.0.0","dwebtree":"^1.0.0","ddrive":"^5.0.0","nanoresource-promise":"^2.0.0"},"gitHead":"926e4b7825fe51869150f90515f4e7b771294ecf","_id":"@dhub/mirroring-service@1.0.0","_nodeVersion":"12.0.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-TgwH5HBzfVBmDdWtGdyTi6Sqyh5onDDJSaYzeyPggUpn2E7yl/eAIxtqKEVTUhRgi5S0sqLu7hqq8L/ZvXqTpA==","shasum":"6f6ee4fa886a8bea2783e469a4c2b7acf3eaf4ee","tarball":"https://registry.npmjs.org/@dhub/mirroring-service/-/mirroring-service-1.0.0.tgz","fileCount":12,"unpackedSize":28205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgTL0oCRA9TVsSAnZWagAAu9UP/1GRfuiOja1qWu7pkRAM\n0n6aTsIoZYxjq6n5axfgFIykq3cq5xA+eUv6cz1dPXYfkth0wXV+c6bQSyxY\nY2A8CYjgUIHVn94Town5/RX4Ven8m9uotv48pRTBGrVnki8I9XRhFsMhgvqZ\nioxlmzw9LDfy5d4Lhc8uZzOogSvdKDs7KTmaQRENJW6uT5Yb+3ZIlu/VpTLy\ne5+61Xe0r6s92TwRm71U4HWYR8x2aqYHIYGK6wIeUF+2ZZM120Pr1UAmsTEP\nd2GcWXRtACFEJhhPgTZ3TUMeSUc/gyeVSrV6HjnrSgod1mECewGw2/C98VgA\nAQO8rg5oxpa6qQytrN6WwVoNZcWG1Rw4BWoSF8TCwkxYQ5JVCVLFYCDM7yX9\nz0GvRFpd8hs7pzKNZbZo1RV/tRcoQw98+Uwmou/XcnYUk8M07FJgzmOJBGS/\nVzAKh/QItus18jZrt7tquBx6CoWyDCQ5k1qtqi1VPxfdIzaT47Tem7ssV+J7\naHTv17Cd8GmBS+PmZZ8z1gMMH9HvnP57Rm+lJG+FHPDd5P0bT09WkrsGe9Fa\ntvIs5WKY2tBmq9R0DaclYwZuPqVw7rCrZBvaZIKTz6Tl2/tamln5e2/jG0Sz\n13djbxIYxRx/NByurtpgIZB0QTQUE3r0EVNyzldT3gnaIEBDWVDvD+SV3u6k\nVQJL\r\n=oai9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF2ENxMMJGA/PMT0ASdJ3DmEQW/Ku7yWpMZTfuhWPG5eAiEAjMRuQQMLF+YfJncmxdR3url1BKwpfIzmQIkD1L+90OY="}]},"_npmUser":{"name":"dwebprotocol","email":"shikhar@arisen.network"},"directories":{},"maintainers":[{"name":"dwebprotocol","email":"shikhar@arisen.network"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mirroring-service_1.0.0_1615641896038_0.702458465453579"},"_hasShrinkwrap":false},"1.0.2":{"name":"@dhub/mirroring-service","version":"1.0.2","description":"A dHub service with an RPC API for mirroring.","main":"index.js","scripts":{"build":"drpc rpc/schema.proto --rpc=rpc/index.js --messages=rpc/messages.js","test":"standard && tape test/*.js","start":"node server.js"},"repository":{"type":"git","url":"git+https://github.com/dwebprotocol/dhub-mirroring-service.git"},"keywords":["dhub","seeding","mirroring"],"author":{"name":"PeepsLabs","email":"peepslabs@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/dwebprotocol/dhub-mirroring-service/issues"},"homepage":"https://dwebx.org","devDependencies":{"standard":"^16.0.3","tape":"^5.0.1"},"dependencies":{"@dhub/client":"^1.0.0","drpc_dweb":"^1.0.0","drpc_dweb-runtime":"^1.0.0","dwebtree":"^1.0.0","ddrive":"^5.0.0","nanoresource-promise":"^2.0.0"},"gitHead":"4fe39de4c38656417650203e97c600df8ee86492","_id":"@dhub/mirroring-service@1.0.2","_nodeVersion":"12.0.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-aZTXtR/5Vz2zIAUISDbYJiEpz+AtB0PoV5ysbbXUABHd6EE8ILgdHK40jcN79I2EaeIgPkBRqZ5WcS/2k1Rrsw==","shasum":"51408e61a4fc1bd97a2c0da940d4fea8dac8122f","tarball":"https://registry.npmjs.org/@dhub/mirroring-service/-/mirroring-service-1.0.2.tgz","fileCount":12,"unpackedSize":28130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXDKFCRA9TVsSAnZWagAAsngP/j8GIaxGe+c9SxWsa6sX\nr9hx+tE703ICcefdcf61WouZhabZbXS5OFhgq8U28aJiY2s5Y8dGRN54MTpW\n7+dK8iByazt84keHTG9VIBonOrnHPAoOlH/blKI4OGaSdrEPdJG2+iG7ieIt\nHInBBS40dCmSCM18e4wT8cpbuKrfRKOoZTS8JhxkFvQuvSNuPDG27B6g5RnO\n/8ldE+5kcqgv8YPeQ4LBXaJDdtyxi0NRT+jzsVBrb8e18YOVvZ+1pAsKZ7cZ\nBXSKlv9o0o1njIZsyOuoMulg8XSnk9VdZtL6otvsToACSR24n1u8Pjeb7xZt\nuoAairXLj5hJjZII5gifKlOZL36nQh4LOtIkBNN7gCDLQiRXd+elynVJ5GHC\nHVBm/rj9On4gK9TQcEGwZ2bGJsieW66qkeRG3NKET7uXUFbjF+njCzp0HX6u\nJ6CS+Di0KwmlCU+qYhaDjWso9EMn9hPx5iV2e4y1kgJwWcwmutFwMfxQYkvh\na9/uYkEtVACc7xiT6NlR+Yyd0fwCWJgvMveVUxsWTfqF5ulHEV8f8S/SfiXj\nboKPuBtahe6KPyy+RaPZrcwT32asFWh5XB/y8ZqGOrlVEmbUc4RrSVRpGmIt\n1YCvSohk/XsuwIlS9mrmuVkSXlwHgRhPq2Mn2ReXCjsnidt9gP3vSuOTooCY\nqsOw\r\n=5Hdd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHrmeaSdxsGYb/ub2m7A1mDS0u1NAtN1Z9mvZ9E0EcKjAiEA/sQuptgZreJ5Q3ihizuQasmOshDm+VhlpCEFQcLcQFM="}]},"_npmUser":{"name":"dwebprotocol","email":"shikhar@arisen.network"},"directories":{},"maintainers":[{"name":"dwebprotocol","email":"shikhar@arisen.network"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mirroring-service_1.0.2_1616654980477_0.9988456282042151"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-13T13:24:55.806Z","1.0.0":"2021-03-13T13:24:56.245Z","modified":"2022-04-05T04:20:57.026Z","1.0.2":"2021-03-25T06:49:40.634Z"},"maintainers":[{"name":"dwebprotocol","email":"shikhar@arisen.network"}],"description":"A dHub service with an RPC API for mirroring.","homepage":"https://dwebx.org","keywords":["dhub","seeding","mirroring"],"repository":{"type":"git","url":"git+https://github.com/dwebprotocol/dhub-mirroring-service.git"},"author":{"name":"PeepsLabs","email":"peepslabs@gmail.com"},"bugs":{"url":"https://github.com/dwebprotocol/dhub-mirroring-service/issues"},"license":"MIT","readme":"# dhub-mirroring-service\nA dHub service with a RPC API for mirroring.\n\n## Installation\n```\nnpm i dhub-mirroring-service\n```\n\n## Usage\nThis service is meant to run alongside a running dHub server.\n\nWith dHub running in a separate terminal:\n```sh\n❯ ./bin/index.js\nRunning dhub-mirror/1.0.6 linux-x64 node-v14.15.0\nListening on /tmp/dhub-mirroring.sock\n```\n\nThen you can import `dhub-mirroring-service/client` inside a script, and it will auto-connect to the running server.\n\nThe mirror service provides an [DRPC](https://github.com/dwebprotocol/drpc) endpoint with methods for mirroring, unmirror, and listing mirroed dDatabase-based data structures.\n\nCurrently it supports mirroring dDrives and individual DDatabases. It doesn't do data-structure detection by looking at DDatabase headers -- you gotta explicitly provide the type.\n\nAs of now, dDrive mirroring doesn't handle mounts. Maybe one day\n\n## API\n\n#### `await client.mirror(key, type)`\nStart mirroring a dDatabase-based data structure.\n\nThis command will currently special-case the `ddrive` type, mirroring both metadata and content feeds.\n\n#### `await client.unmirror(key, type)`\nStop mirroring a dDatabase-based data structure.\n\nThis command will currently special-case the `ddrive` type, unmirroring both metadata and content feeds.\n\n#### `await client.status(key, type)`\nCheck if a data structure is being mirrored;\n\nReturns an object of the form:\n```js\n{\n  key, // Buffer\n  type, // string\n  mirroring // bool\n}\n```\n\n#### `await client.list()`\nList all data structures being mirrored.\n\nReturns an Array of status objects with the same shape as the `status` return value.\n\n#### `await client.stop()`\nShut down the server.\n\n## License\nMIT\n","readmeFilename":"README.md"}