https://github.com/orbitdb/liftoff
A preconfigured instance which allows developers to "test drive" OrbitDB.
https://github.com/orbitdb/liftoff
Last synced: about 1 year ago
JSON representation
A preconfigured instance which allows developers to "test drive" OrbitDB.
- Host: GitHub
- URL: https://github.com/orbitdb/liftoff
- Owner: orbitdb
- License: mit
- Created: 2024-01-18T12:35:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-30T16:33:17.000Z (over 1 year ago)
- Last Synced: 2024-10-30T16:46:53.154Z (over 1 year ago)
- Language: JavaScript
- Size: 492 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# OrbitDB Liftoff
[](https://app.element.io/#/room/#orbit-db:matrix.org) [](https://www.npmjs.com/package/@orbitdb/liftoff) [](https://www.npmjs.com/package/@orbitdb/liftoff)
A preconfigured OrbitDB instance which allows users to quickly "test drive" OrbitDB.
This repository provides convenience functions and IPFS and Libp2p configurations to deploy OrbitDB quickly and with minimal knowledge of Helia/Libp2p.
## Install
This project uses [npm](http://npmjs.com/) and [nodejs](https://nodejs.org/).
```sh
npm i @orbitdb/liftoff
```
## Usage
To launch a OrbitDB instance and open a database, run `startOrbitDB`:
```js
import { startOrbitDB, stopOrbitDB } from '@orbitdb/liftoff'
const orbitdb = await startOrbitDB()
const db1 = await orbitdb.open('db1')
await db1.add('hello world!')
console.log(await db1.all())
await stopOrbitDB(orbitdb)
```
OrbitDB Liftoff also includes default Libp2p configurations for Node.js and browser for basic connections between multiple peers:
```js
import { createOrbitDB } from '@orbitdb/core'
import { DefaultLibp2pOptions } from '@orbitdb/liftoff'
const libp2p = await createLibp2p({ ...DefaultLibp2pOptions })
const ipfs = await createHelia({ libp2p })
const orbitdb = await createOrbitDB({ ipfs })
const db1 = await orbitdb.open('db1')
await db1.add('hello world!')
console.log(await db1.all())
```
## License
[MIT](LICENSE) © 2024 OrbitDB Community