Skip to content

Pinning

Pinning allows you to add and remove streams from the permanent pinset in your Ceramic node.

By default Ceramic will garbage collect any stream that has been created, modified, or loaded after some period of time. In order to prevent the loss of streams due to garbage collection, you need to pin the streams that you wish to persist. Pinning instructs the Ceramic node to keep them around in persistent storage until they are unpinned.

Prerequisites

Pinning requires having installed a Ceramic client in your project.

Add to pinset

Use the pin.add() method to add a stream to your permanent pinset.

const streamId = 'kjzl6cwe1jw14...'
await ceramic.pin.add(streamId)

API reference

Remove from pinset

Use the pin.rm() method to remove a stream from your permanent pinset.

const streamId = 'kjzl6cwe1jw14...'
await ceramic.pin.rm(streamId)

API reference

List streamss in pinset

Use the pin.ls() method to list streams currently in your permanent pinset.

const streamIds = await ceramic.pin.ls()

API reference