Skip to content

Commit

Permalink
Merge pull request #5 from orbitdb/upgrade/helia
Browse files Browse the repository at this point in the history
Upgrade/helia
  • Loading branch information
haadcode authored Jan 31, 2024
2 parents b77742c + df950aa commit 35d5289
Show file tree
Hide file tree
Showing 4 changed files with 34,154 additions and 12,350 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ Start by registering the OrbitDBIdentityProviderDID identity provider with [useI
Once registered, you can simply pass in the identity provider when creating an OrbitDB instance:

```js
import { createHelia, libp2pDefaults } from 'helia'
import { createOrbitDB, useIdentityProvider } from '@orbitdb/core'
import * as OrbitDBIdentityProviderDID from '@orbitdb/identity-provider-did'
import KeyDidResolver from 'key-did-resolver'
import { Ed25519Provider } from 'key-did-provider-ed25519'
import { create } from 'ipfs-core'

const ipfs = await create()
const libp2pOptions = libp2pDefaults()
const ipfs = await createHelia({ libp2p: libp2pOptions })

const seed = new Uint8Array(/* some private seed */)

Expand All @@ -43,13 +44,14 @@ await createOrbitDB({ ipfs, identity: { provider } })
If you require a more custom approach to managing identities, you can create an identity by passing the identity provider to [createIdentity](https://api.orbitdb.org/module-Identities-Identities.html#createIdentity) then use the resulting identity with OrbitDB:

```js
import { createHelia, libp2pDefaults } from 'helia'
import { createOrbitDB, Identities, useIdentityProvider } from '@orbitdb/core'
import OrbitDBIdentityProviderDID from '@orbitdb/identity-provider-did'
import KeyDidResolver from 'key-did-resolver'
import { Ed25519Provider } from 'key-did-provider-ed25519'
import { create } from 'ipfs-core'

const ipfs = await create()
const libp2pOptions = libp2pDefaults()
const ipfs = await createHelia({ libp2p: libp2pOptions })

const seed = new Uint8Array(/* some private seed */)

Expand Down
Loading

0 comments on commit 35d5289

Please sign in to comment.