Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions bootstrap-languages/agent-language/hc-dna/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/bash
CARGO_TARGET_DIR=target RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release --target wasm32-unknown-unknown
hc dna pack workdir
hc app pack workdir
CARGO_TARGET_DIR=target RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release --target wasm32-unknown-unknown && hc dna pack workdir && hc app pack workdir
4 changes: 1 addition & 3 deletions bootstrap-languages/direct-message-language/hc-dna/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/bash
CARGO_TARGET_DIR=target RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release --target wasm32-unknown-unknown
hc dna pack workdir
hc app pack workdir
CARGO_TARGET_DIR=target RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release --target wasm32-unknown-unknown && hc dna pack workdir && hc app pack workdir
3 changes: 1 addition & 2 deletions bootstrap-languages/file-storage/hc-dna/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/bash
CARGO_TARGET_DIR=target RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release --target wasm32-unknown-unknown
hc dna pack workdir
CARGO_TARGET_DIR=target RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release --target wasm32-unknown-unknown && hc dna pack workdir
4 changes: 1 addition & 3 deletions bootstrap-languages/p-diff-sync/hc-dna/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/bash
CARGO_TARGET_DIR=target RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release --target wasm32-unknown-unknown
hc dna pack workdir
hc app pack workdir
CARGO_TARGET_DIR=target RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release --target wasm32-unknown-unknown && hc dna pack workdir && hc app pack workdir
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,33 @@ pub fn add_active_agent_link<Retriever: PerspectiveDiffRetreiver>() -> SocialCon
Retriever::create_entry(EntryTypes::Anchor(agent_root_entry.clone()))?;

let agent = agent_info()?.agent_initial_pubkey;
create_link(
hash_entry(agent_root_entry)?,
agent,
LinkTypes::Index,
LinkTag::new("active_agent"),
)?;
let agent_root_hash = hash_entry(agent_root_entry)?;

// Check if the link already exists to avoid duplicates
let query = LinkQuery::try_new(
agent_root_hash.clone(),
LinkTypes::Index
)?
.tag_prefix(LinkTag::new("active_agent"));
let existing_links = get_links(query, GetStrategy::Local)?;

// Check if this agent already has an active link
let link_exists = existing_links.iter().any(|link| {
link.target.clone().into_agent_pub_key() == Some(agent.clone())
});

if !link_exists {
debug!("===PerspectiveDiffSync.add_active_agent_link(): Creating new active agent link");
create_link(
agent_root_hash,
agent,
LinkTypes::Index,
LinkTag::new("active_agent"),
)?;
} else {
debug!("===PerspectiveDiffSync.add_active_agent_link(): Link already exists, skipping");
}

let after_fn_end = get_now()?.time();
debug!("===PerspectiveDiffSync.add_active_agent_link() - Profiling: Took {} to complete whole add_active_agent_link()", (after_fn_end - now_fn_start).num_milliseconds());
Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use perspective_diff_sync_integrity::{

use crate::errors::{SocialContextError, SocialContextResult};
use crate::retriever::holochain::get_active_agents;
use crate::utils::dedup;

pub fn set_online_status(status: PerspectiveExpression) -> SocialContextResult<()> {
let entry = EntryTypes::PrivateOnlineStatus(status);
Expand Down Expand Up @@ -174,6 +175,8 @@ pub fn get_others() -> SocialContextResult<Vec<String>> {
others.push(did_key.unwrap());
}
}
// Deduplicate DIDs in case multiple agent keys map to the same DID
let others = dedup(&others);
Ok(others)
}

Expand Down
2 changes: 1 addition & 1 deletion cli/mainnet_seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"did:key:z6MkvPpWxwXAnLtMcoc9sX7GEoJ96oNnQ3VcQJRLspNJfpE7"
],
"knownLinkLanguages": [
"QmzSYwdaspRZxrBwuegJa6jmU6nxV6jtbQtavivuTf7ARwc97tT"
"QmzSYwdp1nkvMSU4DiDeGsqfAjYBsMXsKwB2fFR7XiXNodiR4BF"
],
"directMessageLanguage": "QmzSYwdgHzAjKMbtzu6SVM13QVEC2J1BLDUYVQdJhTBLxT8JRj5",
"agentLanguage": "QmzSYwdZDdgxiyE8crozqbxoBP52h6ocMdDq2S2mg4ScjzVLWKQ",
Expand Down
2 changes: 1 addition & 1 deletion rust-executor/src/mainnet_seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"did:key:z6MkvPpWxwXAnLtMcoc9sX7GEoJ96oNnQ3VcQJRLspNJfpE7"
],
"knownLinkLanguages": [
"QmzSYwdaspRZxrBwuegJa6jmU6nxV6jtbQtavivuTf7ARwc97tT"
"QmzSYwdp1nkvMSU4DiDeGsqfAjYBsMXsKwB2fFR7XiXNodiR4BF"
],
"directMessageLanguage": "QmzSYwdgHzAjKMbtzu6SVM13QVEC2J1BLDUYVQdJhTBLxT8JRj5",
"agentLanguage": "QmzSYwdZDdgxiyE8crozqbxoBP52h6ocMdDq2S2mg4ScjzVLWKQ",
Expand Down