Skip to content

chainabit config set ​

Published (2.2.0) ​

This command is not included in Published (2.2.0). It is available in Development (2.2.0).

Development (2.2.0) ​

Replace the account rule document

Synopsis ​

text
chainabit config set --file <path> --if-match <version> [options]

Options ​

OptionDescriptionDefault
--file <path>Provide a valid JSON rule document of at most 64 KiB. Required.—
--if-match <version>Use the version from config get (0 to create). Required.—
--yesConfirm this change—

Options shared by every command are described in Global options and shared behavior.

Behavior ​

Replaces the whole rule document of your account with the JSON document in --file. The command is guarded in two ways:

  • --if-match takes the version you got from chainabit config get (use 0 when no document exists yet). If the document changed since you read it, the server refuses the write and nothing is overwritten; read it again and retry.
  • Before writing, the command asks you to confirm the replacement. Pass --yes to confirm in advance. Without --yes and without an interactive answer the command exits with code 2 and sends nothing.

The file must be valid JSON of at most 64 KiB and a valid rule document. An invalid or oversized file, or a version that is not a whole number from 0 to 999999999, is refused before anything is requested. The command refuses when the connected server is too old to support it.

Output ​

The new version and the document fingerprint. With --json the output contains version and digest.

Authentication and permissions ​

You must be signed in with a full session to write. A credential that can only read the account's settings can run chainabit config get but is refused here.

Examples ​

bash
chainabit config set --file account-rules.json --if-match 3
chainabit config set --file account-rules.json --if-match 0 --yes
chainabit config set --file account-rules.json --if-match 3 --yes --json

Built with purpose. chainabit.com