Ceramic CLI utility functions

Hierarchy

  • CeramicCliUtils

Constructors

Methods

  • Authenticates the Ceramic client with the hex-encoded DID private key.

    Parameters

    • ceramic: CeramicClient
    • privateKey: string

    Returns Promise<void>

  • Internal helper for creating documents

    Parameters

    • content: string

      Document content

    • controllers: string

      Document controllers

    • onlyGenesis: boolean

      Create only a genesis commit (no publish or anchor)

    • deterministic: boolean

      If true, documents will not be guaranteed to be unique. Documents with identical content will get de-duped.

    • schemaStreamId: string = null

      Schema document ID

    Returns Promise<void>

  • Creates an Ed25519-based key-did from a given seed for use with the CLI. The DID instance has a KeyDidResolver and ThreeIdResolver pre-loaded so that the Ceramic daemon will be able to resolve both 'did:key' and 'did:3' DIDs.

    Parameters

    • seed: Uint8Array
    • ceramic: CeramicClient

    Returns DID

  • Create CeramicDaemon instance

    Parameters

    • configFilename: string

      Path to daemon config file

    • ipfsApi: string

      IPFS api

    • ethereumRpc: string

      Ethereum RPC URL. Deprecated, use config file if you want to configure this.

    • anchorServiceApi: string

      Anchor service API URL. Deprecated, use config file if you want to configure this.

    • ipfsPinningEndpoints: string[]

      Ipfs pinning endpoints. Deprecated, use config file if you want to configure this.

    • stateStoreDirectory: string

      Path to the directory that will be used for storing state. Deprecated, use config file if you want to configure this.

    • stateStoreS3Bucket: string

      S3 bucket name for storing data. Deprecated, use config file if you want to configure this.

    • port: number

      port on which daemon is available. Default is 7007

    • hostname: string

      hostname to listen on.

    • debug: boolean

      Enable debug logging level

    • verbose: boolean

      Enable verbose logging

    • logToFiles: boolean

      Enable writing logs to files. Deprecated, use config file if you want to configure this.

    • logDirectory: string

      Store log files in this directory. Deprecated, use config file if you want to configure this.

    • metricsExporterEnabled: boolean

      Enable metrics exporter.

    • collectorHost: string

      Hostname of the metrics collector.

    • network: string

      The Ceramic network to connect to

    • pubsubTopic: string

      Pub/sub topic to use for protocol messages.

    • corsAllowedOrigins: string

      Origins for Access-Control-Allow-Origin header. Default is all. Deprecated, use config file if you want to configure this.

    • syncOverride: string

      Global forced mode for syncing all streams. Defaults to "prefer-cache". Deprecated, use config file if you want to configure this.

    • disableComposedb: boolean

      Disable ComposeDB Indexing service.

    • readOnly: boolean

      read only endpoints available. It is disabled by default

    Returns Promise<CeramicDaemon>

  • Create non-schema document

    Parameters

    • content: string

      Document content

    • controllers: string

      Document controllers

    • onlyGenesis: boolean

      Create only a genesis commit (no publish or anchor)

    • deterministic: boolean

      If true, documents will not be guaranteed to be unique. Documents with identical content will get de-duped.

    • schemaStreamId: string = null

      Schema document ID

    Returns Promise<void>

  • Pin stream

    Parameters

    • streamId: string

      Stream ID

    • Optional privateKey: string

      optional admin DID private key

    Returns Promise<void>

  • List pinned streams

    Parameters

    • Optional streamId: string

      optional stream ID filter

    • Optional privateKey: string

      optional admin DID private key

    Returns Promise<void>

  • Unpin stream

    Parameters

    • streamId: string

      Stream ID

    • Optional privateKey: string

      optional admin DID private key

    Returns Promise<void>

  • Create schema document

    Parameters

    • content: string

      Schema content

    • controllers: string

      Schema controllers

    • onlyGenesis: boolean

      Create only a genesis commit (no publish or anchor)

    • deterministic: boolean

      If true, documents will not be guaranteed to be unique. Documents with identical content will get de-duped.

    Returns Promise<void>

  • Update schema document

    Parameters

    • schemaStreamId: string

      Schema document ID

    • content: string

      Schema document content

    • controllers: string

      Schema document controllers

    Returns Promise<void>

  • Set field in CLI client config.

    Parameters

    • variable: string

      CLI config variable

    • value: any

      CLI config variable value

    Returns Promise<void>

  • Unset field in CLI client config.

    Parameters

    • variable: string

      Name of the configuration variable

    Returns Promise<void>

  • Update document

    Parameters

    • streamId: string

      Document ID

    • content: string

      Document content

    • controllers: string

      Document controllers

    • Optional schemaCommitId: string

      Optional schema document CommitID

    Returns Promise<void>