{"id":14384477,"url":"https://github.com/orbitdb-archive/orbit-db-powergate-io","last_synced_at":"2025-10-04T21:31:34.908Z","repository":{"id":57316018,"uuid":"290311014","full_name":"orbitdb-archive/orbit-db-powergate-io","owner":"orbitdb-archive","description":"A bridge between OrbitDB and Powergate, which is itself a bridge between Filecoin and IPFS.","archived":true,"fork":false,"pushed_at":"2021-05-07T14:54:30.000Z","size":625,"stargazers_count":15,"open_issues_count":6,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-09-25T23:23:52.093Z","etag":null,"topics":["filecoin","filecoin-lotus","ipfs","orbit-db","powergate"],"latest_commit_sha":null,"homepage":"https://orbitdb.github.io/orbit-db-powergate-io/","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/orbitdb-archive.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-08-25T19:59:42.000Z","updated_at":"2024-05-30T11:16:17.000Z","dependencies_parsed_at":"2022-08-25T20:40:43.058Z","dependency_job_id":null,"html_url":"https://github.com/orbitdb-archive/orbit-db-powergate-io","commit_stats":null,"previous_names":["orbitdb-archive/orbit-db-powergate-io","orbitdb/orbit-db-powergate-io"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb-archive%2Forbit-db-powergate-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb-archive%2Forbit-db-powergate-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb-archive%2Forbit-db-powergate-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb-archive%2Forbit-db-powergate-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbitdb-archive","download_url":"https://codeload.github.com/orbitdb-archive/orbit-db-powergate-io/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219876787,"owners_count":16554787,"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":["filecoin","filecoin-lotus","ipfs","orbit-db","powergate"],"created_at":"2024-08-28T18:01:24.964Z","updated_at":"2025-10-04T21:31:29.537Z","avatar_url":"https://github.com/orbitdb-archive.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# PowergateIO (orbit-db-powergate-io)\n\n\u003e A bridge between [OrbitDB](https://github.com/orbitdb/orbit-db) and [Powergate](https://docs.textile.io/powergate/), which is itself a bridge between [Filecoin](https://filecoin.io) and [IPFS](https://ipfs.io/).\n\n## Install\n\n`npm install orbit-db-powergate-io`\n\n### From Source\n\n```bash\n$ git clone https://github.com/orbitdb/orbit-db-powergate-io\n$ cd orbit-db-powergate-io\n$ npm install\n```\n\n## Usage\n\nPowergateIO is designed to work with only one configuration option: the gRPC\nendpoint of the Powergate node you want to connect to. Everything else should be handled\n\"under the hood\" for you. See below.\n\n### Initial Setup\n\n```JavaScript\nconst PowergateIO = require('orbit-db-powergate-io')\n\nconst host = 'http://0.0.0.0:6002' // This is the default value\nPowergateIO.create(host)\n  .then((powergateio) =\u003e {\n    console.log(powergateio.wallet) // Will be {} until funded\n  })\n```\n\n### Backing up an OrbitDB Snapshot\n\nPowergateIO is meant to be used from one IPFS node to another, and to replicate\nOrbitDB databases between them. So, let's assume that we have an IPFS node and\nOrbitDB running locally, and we're going to interact with a _remote_ Powergate\ninstance.\n\n```JavaScript\nconst IPFS = require('ipfs')\nconst OrbitDB = require('orbit-db')\nconst PowergateIO = require('orbit-db-powergate-io')\n\n;(async () =\u003e {\n  const ipfs = await IPFS.create()\n  const orbitdb = await OrbitDB.createInstance(ipfs)\n  powergateio = await PowergateIO.create('https://my.hosted.powergate.node')\n\n  const addresses = (await powergateio.ipfs.id()).addresses\n  await ipfs.swarm.connect(addresses[0].toString())\n\n  const db = await orbitdb.eventlog('powergate-test')\n  for (let i = 0; i \u003c 10; i++) {\n    await db.add(`entry${i}`)\n  }\n\n  jobStatus = await powergateio.storeSnapshot(db.address.toString())\n  console.log(jobStatus)\n\n  // Wait until wallet is funded\n  // Can take up to 2 minute on testnet\n  console.log(powergateio.wallet)\n\n  await powergateio.stop()\n  await orbitdb.disconnect()\n  await ipfs.stop()\n})()\n```\n\n### Retrieving an OrbitDB Snapshot\n\nOnce you've stored a snapshot and have made note of the DB address returned,\nyou can use that db address to retrieve the snapshot!\n\n```JavaScript\nconst IPFS = require('ipfs')\nconst OrbitDB = require('orbit-db')\nconst PowergateIO = require('orbit-db-powergate-io')\n\n;(async () =\u003e {\n  const ipfs = await IPFS.create()\n  const orbitdb = await OrbitDB.createInstance(ipfs)\n  const powergateio = await PowergateIO.create('https://my.hosted.powergate.node')\n\n  const addresses = (await powergateio.ipfs.id()).addresses\n  await ipfs.swarm.connect(addresses[0].toString())\n\n  const dbAddr = '/orbitdb/zdpuAxkdoDum8Nk2VCxKkHZk8TzqAYPm86mVgoy7wagu2UcZB/powergate-test'\n  const db2 = await orbitdb.open(dbAddr, { create: true })\n  const snapshot = await powergateio.retrieveSnapshot(dbAddr)\n\n  await db2._oplog.join(snapshots[0].log)\n  await db2._updateIndex()\n})()\n```\n\nFor more information, see the [API docs](https://orbitdb.github.io/orbit-db-powergate-io/PowergateIO.html). Also,\nthe [tests](https://github.com/orbitdb/orbit-db-powergate-io/tree/master/test) are heavily commented to detail\nwhat is happening at each step.\n\n## Contributing\n\nIssues and pull requests accepted. Please note that several issues have \"[Help Wanted]\"\nand \"[Good First Issue]\" tags!\n\n[Good First Issue]: (https://github.com/orbitdb/orbit-db-powergate-io/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)\n[Help Wanted]: (https://github.com/orbitdb/orbit-db-powergate-io/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)\n\n### Developing Locally\n\nIt's highly recommended to install both Docker and Docker compose. From there, `make` is your\nbest friends. It gives you the following commands:\n\n- `make up` - Spins up all the necessary docker images for local development\n- `make lint` - Lints your JS code vi standard.js\n- `make docs` - Compiles the README and JS docstrings into the docs/ folder\n- `make down` - Spins down all the docker images\n- `make clean` - Removes ephemeral files and folders like node_modules and package-lock.json\n- `make test` - Does a whole bunch of the above, in order. *use it!*\n- `make rebuild` - runs `make clean` and `make deps` to give you a clean slate.\n\n## License\n\nMIT (or Apache2.0 at your discretion)\n\n© OrbitDB Community\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb-archive%2Forbit-db-powergate-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitdb-archive%2Forbit-db-powergate-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb-archive%2Forbit-db-powergate-io/lists"}