Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

More detailed usage #59

@yuhr

Description

@yuhr

The section "Usage" in the readme is not fully illustrating how to use this module with ipfs-core. Could you provide more information? How can I pass this module to "IPFS.create" API?

I'm struggling to make IPFS work entirely in memory. My current setup is following (constructed according to https://github.com/ipfs/js-ipfs/blob/master/examples/custom-ipfs-repo/index.js), but it emits OpenError: IO error: .ipfs/kptQGJNdBNgFcQxtixKUw/pins/LOCK: No such file or directory.

import IPFS from "ipfs-core"
import { nanoid } from "nanoid"
import Repo from "ipfs-repo"
import DatastoreLevel from "datastore-level"
import LevelMem from "level-mem"
import LockMemory from "ipfs-repo/src/lock-memory"

const ipfs = await IPFS.create({
  repo: new Repo(`.ipfs/${nanoid()}`, {
    storageBackends: {
      root: DatastoreLevel,
      blocks: DatastoreLevel,
      keys: DatastoreLevel,
      datastore: DatastoreLevel
    },
    storageBackendOptions: {
      root: { db: LevelMem },
      blocks: { db: LevelMem },
      keys: { db: LevelMem },
      datastore: { db: LevelMem }
    },
    lock: LockMemory
  }),
  start: false,
  silent: true,
  init: {
    algorithm: "Ed25519"
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportA question or request for support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions