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
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
-
serialize: (o: T) => Buffer
-
-
Parameters
Returns Buffer
Ceramic IPFS Daemon
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