bug fixing and deploy and build diagnostics
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Emergency alert system and dead man's switch for mesh networking.
|
||||
//!
|
||||
//! The dead man's switch automatically broadcasts a signed alert with GPS
|
||||
@@ -11,10 +13,8 @@ use super::message_types::{
|
||||
use anyhow::{Context, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
use tokio::sync::RwLock;
|
||||
use tracing::{info, warn};
|
||||
|
||||
/// Default dead man's switch interval: 6 hours.
|
||||
const DEFAULT_INTERVAL_SECS: u64 = 21600;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Off-grid Bitcoin operations over mesh radio.
|
||||
//!
|
||||
//! Enables mesh-only nodes (no internet) to:
|
||||
@@ -12,11 +14,9 @@ use super::message_types::{
|
||||
MeshMessageType, TxRelayPayload, TxRelayResponsePayload, TypedEnvelope,
|
||||
};
|
||||
use anyhow::{Context, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tokio::sync::RwLock;
|
||||
use tracing::{debug, info, warn};
|
||||
use tracing::warn;
|
||||
|
||||
// ─── Block Header Cache ─────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Mesh message encryption: X25519 ECDH key agreement + ChaCha20-Poly1305.
|
||||
//!
|
||||
//! Reuses Archipelago's existing Ed25519 identity infrastructure.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Typed message envelope for mesh communication.
|
||||
//!
|
||||
//! Wraps all mesh messages in a CBOR envelope with type discrimination,
|
||||
|
||||
@@ -30,7 +30,7 @@ use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use tokio::fs;
|
||||
use tokio::sync::{broadcast, watch};
|
||||
use tokio::sync::watch;
|
||||
use tracing::{error, info, warn};
|
||||
|
||||
const MESH_CONFIG_FILE: &str = "mesh-config.json";
|
||||
@@ -559,11 +559,6 @@ impl MeshService {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Subscribe to mesh events.
|
||||
pub fn subscribe(&self) -> broadcast::Receiver<MeshEvent> {
|
||||
self.state.event_tx.subscribe()
|
||||
}
|
||||
|
||||
/// Get a reference to shared state (for RPC handlers).
|
||||
pub fn shared_state(&self) -> Arc<MeshState> {
|
||||
Arc::clone(&self.state)
|
||||
@@ -574,11 +569,6 @@ impl MeshService {
|
||||
self.dead_man_switch.check_in().await;
|
||||
}
|
||||
|
||||
/// Get the node's signing key (for signed messages).
|
||||
pub fn signing_key(&self) -> &SigningKey {
|
||||
&self.signing_key
|
||||
}
|
||||
|
||||
/// Get our DID.
|
||||
pub fn our_did(&self) -> &str {
|
||||
&self.our_did
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Store-and-forward message queue for mesh networking.
|
||||
//!
|
||||
//! When a destination peer is offline or unreachable, messages are queued
|
||||
@@ -9,7 +11,7 @@ use serde::{Deserialize, Serialize};
|
||||
use std::collections::VecDeque;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tokio::sync::RwLock;
|
||||
use tracing::{debug, info, warn};
|
||||
use tracing::{debug, info};
|
||||
|
||||
/// Default time-to-live for queued messages (24 hours).
|
||||
const DEFAULT_TTL_SECS: u64 = 86400;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Meshcore binary frame protocol: constants, encoding, decoding, command builders.
|
||||
//!
|
||||
//! Frame format (USB serial):
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Double Ratchet protocol for forward-secret mesh messaging.
|
||||
//!
|
||||
//! Implements the Signal protocol's Double Ratchet algorithm:
|
||||
@@ -13,10 +15,10 @@
|
||||
//! Reference: Signal Technical Documentation — Double Ratchet Algorithm
|
||||
|
||||
use super::crypto;
|
||||
use anyhow::{Context, Result};
|
||||
use anyhow::Result;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use zeroize::{Zeroize, ZeroizeOnDrop};
|
||||
use zeroize::Zeroize;
|
||||
|
||||
/// HKDF info string for root key + chain key derivation.
|
||||
const KDF_RK_INFO: &[u8] = b"ArchyRatchetRK";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Async serial driver for Meshcore devices.
|
||||
//!
|
||||
//! Handles opening the serial port, reading/writing frames,
|
||||
|
||||
@@ -10,7 +10,7 @@ use sha2::{Digest, Sha256};
|
||||
use std::collections::HashMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tokio::sync::RwLock;
|
||||
use tracing::{debug, info, warn};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
const RATCHET_DIR: &str = "ratchet";
|
||||
|
||||
@@ -87,14 +87,6 @@ impl SessionManager {
|
||||
self.session_path(did).exists()
|
||||
}
|
||||
|
||||
/// Store a new session (after X3DH completes).
|
||||
pub async fn store_session(&self, did: &str, state: RatchetState) -> Result<()> {
|
||||
self.save_session_to_disk(did, &state).await?;
|
||||
self.sessions.write().await.insert(did.to_string(), state);
|
||||
info!(did = %did, "Ratchet session established");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Encrypt a message for a peer using their ratchet session.
|
||||
/// Loads the session from disk if not in memory.
|
||||
pub async fn encrypt_for_peer(
|
||||
@@ -166,19 +158,6 @@ impl SessionManager {
|
||||
Ok(plaintext)
|
||||
}
|
||||
|
||||
/// Remove a session (e.g., on reset or peer removal).
|
||||
pub async fn remove_session(&self, did: &str) -> Result<()> {
|
||||
self.sessions.write().await.remove(did);
|
||||
let path = self.session_path(did);
|
||||
if path.exists() {
|
||||
tokio::fs::remove_file(&path)
|
||||
.await
|
||||
.context("Failed to remove ratchet session file")?;
|
||||
}
|
||||
info!(did = %did, "Ratchet session removed");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get session info for a peer (for RPC status endpoint).
|
||||
pub async fn session_info(&self, did: &str) -> Option<SessionInfo> {
|
||||
let sessions = self.sessions.read().await;
|
||||
@@ -203,10 +182,6 @@ impl SessionManager {
|
||||
}
|
||||
}
|
||||
|
||||
/// List all peers with active sessions.
|
||||
pub async fn list_sessions(&self) -> Vec<String> {
|
||||
self.sessions.read().await.keys().cloned().collect()
|
||||
}
|
||||
}
|
||||
|
||||
/// Summary info about a ratchet session (returned via RPC).
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Steganographic encoding for mesh messages.
|
||||
//!
|
||||
//! Transforms typed message envelopes into formats that resemble innocuous
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! Shared types for mesh networking subsystem.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// WIP mesh/transport protocol — suppress dead code warnings
|
||||
#![allow(dead_code)]
|
||||
//! X3DH (Extended Triple Diffie-Hellman) key agreement for mesh sessions.
|
||||
//!
|
||||
//! Implements the Signal protocol's X3DH using existing Ed25519/X25519 identity
|
||||
|
||||
Reference in New Issue
Block a user