Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Config

Config is an API module for controling peer node configuration variables

It works much like 'git config'. The configuration values are stored in a config file inside your Textile repository. Getting config values will report the currently active config settings. This may differ from the values specifed when setting values.

extends

API

Hierarchy

  • API
    • Config

Index

Constructors

Methods

Constructors

constructor

Methods

get

  • get(path?: undefined | string): Promise<string | object>
  • Report the currently active config settings

    The reported settings may differ from the values specifed when setting/patching values.

    Parameters

    • Optional path: undefined | string

      Config settings path (e.g., Addresses.API). Omit for full config file.

    Returns Promise<string | object>

    A JSON representation of the current config setting at the given path

set

  • set(path: string, value: any): Promise<boolean>
  • Replace or update config settings

    See https://tools.ietf.org/html/rfc6902 for details on RFC6902 JSON patch format. Be sure to restart the daemon for changes to take effect.

    Parameters

    • path: string

      Config settings path (e.g., Addresses.API).

    • value: any

      JSON config settings (can be any valid JSON type)

    Returns Promise<boolean>

    Whether the operation was successfull