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

The daemon can be run with Node.js or Docker.

Using Node.js

You can install this package globally and run the binary from your shell

npm install -g @ceramicnetwork/ipfs-daemon
export CERAMIC_NETWORK=testnet-clay # or another Ceramic network
ipfs-daemon

or use it in a Node.js application

npm install @ceramicnetwork/ipfs-daemon
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()

Using Docker

Public builds of the image Dockerfile.ipfs-daemon are hosted here: ceramicnetwork/ipfs-daemon on Docker Hub

docker pull ceramicnetwork/ipfs-daemon
docker run -p 5011:5011 -e CERAMIC_NETWORK=testnet-clay ceramicnetwork/ipfs-daemon

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

HealthcheckServer

Re-exports HealthcheckServer

IpfsDaemon

Re-exports IpfsDaemon

Type aliases

RepoOptions

RepoOptions: { backends: Record<string, StorageBackend>; createIfMissing: boolean; localPathPrefix: string | undefined; path: string }

Type declaration

  • backends: Record<string, StorageBackend>
  • createIfMissing: boolean
  • localPathPrefix: string | undefined
  • path: string

S3Options

S3Options: { accessKeyId?: string; bucket?: string; region?: string; secretAccessKey?: string }

Type declaration

  • Optional accessKeyId?: string
  • Optional bucket?: string
  • Optional region?: string
  • Optional secretAccessKey?: string

Variables

Const format

format: Format<string | DagJWS | DagJWE> = convert(dagJose)

Functions

LocalDatastoreFS

LocalDatastoreLevel

createRepo

fromBooleanInput

  • fromBooleanInput(input: string | undefined, byDefault?: boolean): boolean

localPath

  • localPath(prefix: string | undefined, location: string): string

setRepoBackend

  • setRepoBackend(config: any, name: string, repoOptions: RepoOptions, s3: () => S3, defaultBackend: any): void

Object literals

Const notALock

notALock: object

getCloser

  • getCloser(): { close: any }

getLockfilePath

  • getLockfilePath(): void

lock

  • lock(): Promise<{ close: any }>

locked

  • locked(): Promise<boolean>