Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
radicle: Add new `ash.radicle.garden` seed node
Merged did:key:z6MksFqX...wzpT opened 2 years ago

Add the new ash node as a preferred seed, to load balance.

12 files changed +65 -16 7b1847d8 77076af2
modified build.rs
@@ -1,8 +1,6 @@
use std::env;
use std::process::Command;

-
// TODO: Update to `cargo::` syntax after rust 1.77.
-

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Set a build-time `GIT_HEAD` env var which includes the commit id;
    // such that we can tell which code is running.
@@ -88,10 +86,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
        })
        .unwrap_or(0.to_string());

-
    println!("cargo:rustc-env=RADICLE_VERSION={version}");
-
    println!("cargo:rustc-env=GIT_COMMIT_TIME={commit_time}");
-
    println!("cargo:rustc-env=GIT_HEAD={hash}");
-
    println!("cargo:rustc-rerun-if-changed=.git/HEAD");
+
    println!("cargo::rustc-env=RADICLE_VERSION={version}");
+
    println!("cargo::rustc-env=GIT_COMMIT_TIME={commit_time}");
+
    println!("cargo::rustc-env=GIT_HEAD={hash}");

    Ok(())
}
modified radicle-cob/src/test.rs
@@ -1,5 +1,5 @@
pub mod identity;
-
pub use identity::{Name, Person, Project, RemoteProject};
+
pub use identity::{Person, Project, RemoteProject};

pub mod storage;
pub use storage::Storage;
modified radicle-fetch/src/git.rs
@@ -17,6 +17,6 @@ pub(crate) mod oid {

    /// Convert from an [`Oid`] to an [`ObjectId`].
    pub fn to_object_id(oid: Oid) -> ObjectId {
-
        ObjectId::try_from(oid.as_bytes()).expect("invalid git-ext Oid")
+
        ObjectId::from(oid.as_bytes())
    }
}
modified radicle-fetch/src/refs.rs
@@ -4,7 +4,6 @@ use radicle::crypto::PublicKey;
use radicle::git::{self, Component, Namespaced, Oid, Qualified};
use thiserror::Error;

-
pub use radicle::git::refs::storage;
pub use radicle::git::refs::storage::Special;

use crate::git::refs::{Policy, Update};
modified radicle-httpd/src/api/v1/profile.rs
@@ -73,7 +73,8 @@ mod routes {
              "config": {
                "publicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path",
                "preferredSeeds": [
-
                  "z6MkrLMMsiPWUcNPHcRajuMi9mDfYckSoJyPwwnknocNYPm7@seed.radicle.garden:8776"
+
                  "z6MkrLMMsiPWUcNPHcRajuMi9mDfYckSoJyPwwnknocNYPm7@seed.radicle.garden:8776",
+
                  "z6Mkmqogy2qEM2ummccUthFEaaHvyYmYBYh3dbe9W4ebScxo@ash.radicle.garden:8776"
                ],
                "web": { "pinned": { "repositories": [] } },
                "cli": {
modified radicle-node/src/test/environment.rs
@@ -373,7 +373,7 @@ impl<G: Signer + cyphernet::Ecdh> NodeHandle<G> {

        for line in io::BufReader::new(io::Cursor::new(&result.stdout))
            .lines()
-
            .flatten()
+
            .map_while(Result::ok)
        {
            log::debug!(target: "test", "rad {cmd}: {line}");
        }
modified radicle-node/src/wire.rs
@@ -280,8 +280,7 @@ impl Decode for PublicKey {
    fn decode<R: io::Read + ?Sized>(reader: &mut R) -> Result<Self, Error> {
        let buf: [u8; 32] = Decode::decode(reader)?;

-
        PublicKey::try_from(buf)
-
            .map_err(|e| Error::Io(io::Error::new(io::ErrorKind::InvalidInput, e.to_string())))
+
        Ok(PublicKey::from(buf))
    }
}

modified radicle-term/src/editor.rs
@@ -52,6 +52,7 @@ impl Editor {
        let mut file = fs::OpenOptions::new()
            .write(true)
            .create(true)
+
            .truncate(true)
            .open(&self.path)?;

        if file.metadata()?.len() == 0 {
modified radicle/src/cob/patch.rs
@@ -534,7 +534,7 @@ impl Patch {

    /// Get the merges.
    pub fn merges(&self) -> impl Iterator<Item = (&ActorId, &Merge)> {
-
        self.merges.iter().map(|(a, m)| (a, m))
+
        self.merges.iter()
    }

    /// Reference to the Git object containing the code on the latest revision.
modified radicle/src/node/config.rs
@@ -32,6 +32,17 @@ pub mod seeds {
        .into()
    });

+
    /// The radicle public `ash` seed node.
+
    pub static RADICLE_ASH_NODE: Lazy<ConnectAddress> = Lazy::new(|| {
+
        // SAFETY: `ConnectAddress` is known at compile time.
+
        #[allow(clippy::unwrap_used)]
+
        PeerAddr::from_str(
+
            "z6Mkmqogy2qEM2ummccUthFEaaHvyYmYBYh3dbe9W4ebScxo@ash.radicle.garden:8776",
+
        )
+
        .unwrap()
+
        .into()
+
    });
+

    /// The radicle team node.
    pub static RADICLE_TEAM_NODE: Lazy<ConnectAddress> = Lazy::new(|| {
        // SAFETY: `ConnectAddress` is known at compile time.
@@ -70,7 +81,10 @@ impl Network {
    /// Public seeds for this network.
    pub fn public_seeds(&self) -> Vec<ConnectAddress> {
        match self {
-
            Self::Main => vec![seeds::RADICLE_COMMUNITY_NODE.clone()],
+
            Self::Main => vec![
+
                seeds::RADICLE_COMMUNITY_NODE.clone(),
+
                seeds::RADICLE_ASH_NODE.clone(),
+
            ],
            Self::Test => vec![],
        }
    }
modified rust-toolchain
@@ -1 +1 @@
-
1.74
+
1.77
added scripts/tag
@@ -0,0 +1,38 @@
+
#!/bin/sh
+
set -e
+

+
if [ $# -ne 1 ]; then
+
  echo "Usage: $0 <version-number>"
+
  exit 1
+
fi
+

+
version="$1"
+
tag="v$version"
+
commit="$(git rev-parse HEAD)"
+
signing_key=$(git config user.signingKey)
+

+
git show "$commit"
+

+
if [ "$signing_key" != "$(rad self --ssh-key)" ]; then
+
  echo "The Git signing key does not match the output of 'rad self --ssh-key'."
+
  exit 1
+
fi
+

+
printf "\n"
+
printf "Tag the above commit with \033[35m$tag\033[0m, using \033[35m$(rad self --did)\033[0m? [y/N] "
+
read confirmation
+
rad auth
+

+
case "$confirmation" in
+
  [Yy]*)
+
    if git tag --annotate --sign "$tag" -m "Release $version" "$commit"; then
+
      echo "Tag $tag created and signed over $commit."
+
    else
+
      echo "Failed to create tag."
+
      exit 1
+
    fi ;;
+
  *)
+
    echo "Operation aborted."
+
    exit 1 ;;
+
esac
+