Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @ceramicnetwork/ipfs-daemon

Ceramic IPFS Daemon

Wraps js-ipfs instance with dag-jose codec enabled.

Getting started

Installation

$ npm install @ceramicnetwork/ipfs-daemon

Usage

import {IpfsDaemon} from "@ceramicnetwork/ipfs-daemon";

// All the parameters are optional here
// If not set, they are given defaults or got read from process environment variables
const ipfsDaemon = await IpfsDaemon.create({
    ipfsDhtServerMode: IPFS_DHT_SERVER_MODE, // DHT Server
    ipfsEnableApi: true, // Enable IPFS API
    ipfsEnableGateway: true, // Enable IPFS Gateway
    useCentralizedPeerDiscovery: true, // Connect to bootstrap nodes
    ceramicNetwork: 'testnet-clay' // Bootstrap nodes are selected per network
})
await ipfsDaemon.start()
const ipfs = ipfsDaemon.ipfs
await ipfsDaemon.stop()

Contributing

We are happy to accept small and large contributions. Make sure to check out the Ceramic specifications for details of how the protocol works.

License

Apache-2.0 or MIT

Index

References

Configuration

Re-exports Configuration

Configuration

Re-exports Configuration

HealthcheckServer

Re-exports HealthcheckServer

IpfsApi

Re-exports IpfsApi

IpfsDaemon

Re-exports IpfsDaemon

IpfsDaemon

Re-exports IpfsDaemon

Type aliases

IpfsApi

IpfsApi: typeof IpfsApi

Variables

Const format

format: { codec: Code; defaultHashAlg: string; resolver: { resolve: (buff: Buffer, path: string) => { remainderPath: string; value: T }; tree: (buff: Uint8Array) => Iterable<string> }; util: { cid: (buff: Buffer, opts?: { cidVersion?: 0 | 1 | undefined; hashAlg?: string | undefined } | undefined) => Promise<OldCID>; deserialize: (b: Uint8Array) => T; serialize: (o: T) => Buffer } } = legacy(dagJose, {hashes: hasher})

Type declaration

  • codec: Code
  • defaultHashAlg: string
  • resolver: { resolve: (buff: Buffer, path: string) => { remainderPath: string; value: T }; tree: (buff: Uint8Array) => Iterable<string> }
    • resolve: (buff: Buffer, path: string) => { remainderPath: string; value: T }
        • (buff: Buffer, path: string): { remainderPath: string; value: T }
        • Parameters

          • buff: Buffer
          • path: string

          Returns { remainderPath: string; value: T }

          • remainderPath: string
          • value: T
    • tree: (buff: Uint8Array) => Iterable<string>
        • (buff: Uint8Array): Iterable<string>
        • Parameters

          • buff: Uint8Array

          Returns Iterable<string>

  • util: { cid: (buff: Buffer, opts?: { cidVersion?: 0 | 1 | undefined; hashAlg?: string | undefined } | undefined) => Promise<OldCID>; deserialize: (b: Uint8Array) => T; serialize: (o: T) => Buffer }
    • cid: (buff: Buffer, opts?: { cidVersion?: 0 | 1 | undefined; hashAlg?: string | undefined } | undefined) => Promise<OldCID>
        • (buff: Buffer, opts?: { cidVersion?: 0 | 1 | undefined; hashAlg?: string | undefined } | undefined): Promise<OldCID>
        • Parameters

          • buff: Buffer
          • Optional opts: { cidVersion?: 0 | 1 | undefined; hashAlg?: string | undefined } | undefined

          Returns Promise<OldCID>

    • deserialize: (b: Uint8Array) => T
        • (b: Uint8Array): T
        • Parameters

          • b: Uint8Array

          Returns T

    • serialize: (o: T) => Buffer
        • (o: T): Buffer
        • Parameters

          • o: T

          Returns Buffer

Const hasher

hasher: {}

Type declaration