Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
[wip]: Make a CLI example with threshold 2
✗ CI failure Sebastian Martinez committed 10 months ago
commit b7de4dde6bac0a685aacdfa74e72b1d2cb81007b
parent 9e010068efdc4314dde2c07386303bdeed12b3ee
1 failed (1 total) View logs
2 files changed +140 -1
modified crates/radicle-cli/examples/rad-id-threshold.md
@@ -195,9 +195,140 @@ $ rad fork
$ rad sync -f
Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from the network, found 2 potential seed(s).
✓ Target met: 2 seed(s)
-
🌱 Fetched from z6Mkux1…nVhib7Z
+
🌱 Fetched from z6MkuPZ…xEuaPUp
🌱 Fetched from z6Mkt67…v4N1tRk
$ rad inspect --sigrefs
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi ae3c6b77dc1ed51c1c1e6a2772339c2779fa9ba8
z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk dace6fe948548168a2bb687718949d9b5d9076ee
```
+

+
``` ~bob
+
$ rad clone rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
+
✓ Creating checkout in ./heartwood..
+
✓ Remote alice@z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi added
+
✓ Remote-tracking branch alice@z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/master created for z6MknSL…StBU8Vi
+
✓ Repository successfully cloned under [..]/heartwood/
+
╭────────────────────────────────────╮
+
│ heartwood                          │
+
│ Radicle Heartwood Protocol & Stack │
+
│ 0 issues · 1 patches               │
+
╰────────────────────────────────────╯
+
Run `cd ./heartwood` to go to the repository directory.
+
```
+

+
``` ~bob
+
$ cd ./heartwood
+
$ git push rad master
+
```
+

+
``` ~alice
+
$ rad follow did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
+
✓ Follow policy updated for z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
+
```
+

+
``` ~alice
+
$ rad id update --title "Increase threshold" --description "Increase threshold to 2" --threshold 2
+
✓ Identity revision 2255c2317f3a3ba7b2f0a2322af90bc6485f7744 created
+
╭────────────────────────────────────────────────────────────────────────╮
+
│ Title    Increase threshold                                            │
+
│ Revision 2255c2317f3a3ba7b2f0a2322af90bc6485f7744                      │
+
│ Blob     053541ba7b90534b35dd8718e0ceaa408979b02b                      │
+
│ Author   did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi      │
+
│ State    active                                                        │
+
│ Quorum   no                                                            │
+
│                                                                        │
+
│ Increase threshold to 2                                                │
+
├────────────────────────────────────────────────────────────────────────┤
+
│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi alice (you) │
+
│ ? did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk bob         │
+
╰────────────────────────────────────────────────────────────────────────╯
+

+
@@ -1,14 +1,14 @@
+
 {
+
   "payload": {
+
     "xyz.radicle.project": {
+
       "defaultBranch": "master",
+
       "description": "Radicle Heartwood Protocol & Stack",
+
       "name": "heartwood"
+
     }
+
   },
+
   "delegates": [
+
     "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi",
+
     "did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk"
+
   ],
+
-  "threshold": 1
+
+  "threshold": 2
+
 }
+
```
+

+
``` ~alice
+
$ rad sync -a
+
✓ Synced with 2 seed(s)
+
```
+

+
``` ~bob
+
$ rad sync
+
Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from the network, found 2 potential seed(s).
+
✓ Target met: 2 seed(s)
+
🌱 Fetched from z6MknSL…StBU8Vi
+
🌱 Fetched from z6MkuPZ…xEuaPUp
+
✓ Nothing to announce, already in sync with 2 seed(s) (see `rad sync status`)
+
$ rad id accept 2255c2317f3a3ba7b2f0a2322af90bc6485f7744
+
✓ Revision 2255c2317f3a3ba7b2f0a2322af90bc6485f7744 accepted
+
╭────────────────────────────────────────────────────────────────────────╮
+
│ Title    Increase threshold                                            │
+
│ Revision 2255c2317f3a3ba7b2f0a2322af90bc6485f7744                      │
+
│ Blob     053541ba7b90534b35dd8718e0ceaa408979b02b                      │
+
│ Author   did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi      │
+
│ State    accepted                                                      │
+
│ Quorum   yes                                                           │
+
│                                                                        │
+
│ Increase threshold to 2                                                │
+
├────────────────────────────────────────────────────────────────────────┤
+
│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi alice       │
+
│ ✓ did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk bob   (you) │
+
╰────────────────────────────────────────────────────────────────────────╯
+
```
+

+
``` ~alice
+
$ git switch master
+
Your branch is up to date with 'rad/master'.
+
$ touch YOLO
+
$ git add YOLO
+
$ git commit -v -m "What it says"
+
[master 359a556] What it says
+
 1 file changed, 0 insertions(+), 0 deletions(-)
+
 create mode 100644 YOLO
+
```
+

+
``` ~alice (stderr) RAD_SOCKET=/dev/null
+
$ git push rad master
+
✓ Canonical head updated to 359a55668e3a5d6da510171cb248c59e9c75b360
+
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
+
   3e674d1..359a556  master -> master
+
```
+

+
``` ~charlie
+
$ rad clone rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
+
✓ Seeding policy updated for rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji with scope 'all'
+
Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from the network, found 1 potential seed(s).
+
✓ Target met: 1 seed(s)
+
✓ Creating checkout in ./heartwood..
+
✓ Remote z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi added
+
✓ Remote-tracking branch z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/master created for z6MknSL…StBU8Vi
+
✓ Remote z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk added
+
✓ Remote-tracking branch z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk/master created for z6Mkt67…v4N1tRk
+
✓ Repository successfully cloned under [..]/heartwood/
+
╭────────────────────────────────────╮
+
│ heartwood                          │
+
│ Radicle Heartwood Protocol & Stack │
+
│ 0 issues · 1 patches               │
+
╰────────────────────────────────────╯
+
Run `cd ./heartwood` to go to the repository directory.
+
```
+

+
``` ~charlie
+
$ cd ./heartwood
+
$ git rev-parse master
+
3e674d1a1df90807e934f9ae5da2591dd6848a33
+
```

\ No newline at end of file
modified crates/radicle-cli/tests/commands.rs
@@ -541,6 +541,7 @@ fn rad_id_threshold() {
    let mut environment = Environment::new();
    let alice = environment.node(config::node("alice"));
    let bob = environment.node(config::node("bob"));
+
    let charlie = environment.node(config::node("charlie"));
    let seed = environment.node(config::node("seed"));
    let working = tempfile::tempdir().unwrap();
    let working = working.path();
@@ -560,6 +561,7 @@ fn rad_id_threshold() {
    let mut alice = alice.spawn();
    let mut seed = seed.spawn();
    let mut bob = bob.spawn();
+
    let mut charlie = charlie.spawn();

    seed.handle.seed(acme, Scope::All).unwrap();
    alice.handle.seed(acme, Scope::Followed).unwrap();
@@ -570,6 +572,7 @@ fn rad_id_threshold() {

    alice.connect(&seed).connect(&bob);
    bob.connect(&seed);
+
    charlie.connect(&seed);
    alice.routes_to(&[(acme, seed.id)]);
    seed.handle.fetch(acme, alice.id, DEFAULT_TIMEOUT).unwrap();

@@ -590,6 +593,11 @@ fn rad_id_threshold() {
            working.join("seed"),
            [("RAD_HOME", seed.home.path().display())],
        )
+
        .home(
+
            "charlie",
+
            working.join("charlie"),
+
            [("RAD_HOME", charlie.home.path().display())],
+
        )
        .run()
        .unwrap();
}