Files
heartwood/radicle-cli/examples/rad-delegate.md
T
Fintan Halpenny aa05f676f7 cli: add delegate cli
Adds a `rad delegate` CLI command.

The command consists of three subcommands:
* `add` -- add a new delegate to the set of delegates of a project
* `remove` -- remove an existing delegate from the set of delegates of a
  project
* `list` -- list the delegates of a project

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-12-27 12:25:24 +01:00

1.3 KiB

Delegates are the authorized keys that can manage a project's metadata, including adding a new delegate.

Let's list the current set of delegates for a project.

$ rad delegate list rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
[
  "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"
]

We want to add a new maintainer to the project to help out with the work.

$ rad delegate add z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG --to rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
Added delegate 'did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG'
ok Update successful!

Let's convince ourselves that there's another delegate.

$ rad delegate list rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
[
  "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi",
  "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG"
]

And finally, we no longer want to be part of the project so we pass on the torch and remove ourselves from the delegate set.

$ rad delegate remove z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --to rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
Removed delegate 'did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi'
ok Update successful!
$ rad delegate list rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
[
  "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG"
]