Skip to content

Commit

Permalink
Merge pull request #94 from monadicus/refactor-rename
Browse files Browse the repository at this point in the history
refactor: rename to snops
  • Loading branch information
voximity authored Apr 3, 2024
2 parents a5d0fea + 5d6ad26 commit 4c54bbf
Show file tree
Hide file tree
Showing 62 changed files with 59 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/tests
/snot-control-data
/snot-data
/snops-control-data
/snops-data
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[workspace]
members = [
"crates/aot",
"crates/snot",
"crates/snot-agent",
"crates/snot-cli",
"crates/snot-common",
"crates/snops",
"crates/snops-agent",
"crates/snops-cli",
"crates/snops-common",
]
resolver = "2"

Expand Down Expand Up @@ -50,7 +50,7 @@ snarkos-account = { path = "../snarkos/account" }
snarkos-cli = { path = "../snarkos/cli" }
snarkos-node = { path = "../snarkos/node" }
snarkvm = { path = "../snarkvm", features = ["rocks"] }
snot-common = { path = "./crates/snot-common" }
snops-common = { path = "./crates/snops-common" }

[patch."https://github.com/AleoHQ/snarkVM.git"]
snarkvm = { path = "../snarkvm" }
2 changes: 1 addition & 1 deletion crates/aot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ serde_json.workspace = true
snarkos-account.workspace = true
snarkos-node = { workspace = true, optional = true }
snarkvm.workspace = true
snot-common.workspace = true
snops-common.workspace = true
tokio.workspace = true
tower-http.workspace = true
tracing-flame = "0.2.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/aot/src/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
use serde_clap_deserialize::serde_clap_default;
use snarkos_node::Node;
use snarkvm::{prelude::Block, utilities::FromBytes};
use snot_common::state::NodeType;
use snops_common::state::NodeType;

use crate::{ledger::Addrs, Account, PrivateKey};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "snot-agent"
name = "snops-agent"
version = "0.1.0"
edition = "2021"

Expand All @@ -17,7 +17,7 @@ httpdate = "1.0.3"
local-ip-address = "0.6.1"
nix = { workspace = true, features = ["signal"] }
reqwest = { workspace = true, features = ["stream", "json"] }
snot-common = { path = "../snot-common" }
snops-common = { path = "../snops-common" }
tarpc.workspace = true
tokio.workspace = true
tokio-tungstenite = "0.21.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{os::unix::fs::PermissionsExt, path::Path};
use futures::StreamExt;
use http::StatusCode;
use reqwest::IntoUrl;
use snot_common::api::StorageInfoResponse;
use snops_common::api::StorageInfoResponse;
use tokio::{fs::File, io::AsyncWriteExt};
use tracing::info;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use std::{

use clap::Parser;
use http::Uri;
use snot_common::state::{AgentId, AgentMode, PortConfig};
use snops_common::state::{AgentId, AgentMode, PortConfig};
use tracing::{info, warn};

pub const ENV_ENDPOINT: &str = "SNOT_ENDPOINT";
pub const ENV_ENDPOINT: &str = "SNOPS_ENDPOINT";
pub const ENV_ENDPOINT_DEFAULT: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 1234);

// TODO: allow agents to define preferred internal/external addrs
Expand All @@ -33,7 +33,7 @@ pub struct Cli {
pub labels: Option<Vec<String>>,

/// Path to the directory containing the stored data and configuration
#[arg(long, default_value = "./snot-data")]
#[arg(long, default_value = "./snops-data")]
pub path: PathBuf,

/// Enable the agent to fetch its external address. Necessary to determine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use cli::Cli;
use futures::{executor::block_on, SinkExt};
use futures_util::stream::{FuturesUnordered, StreamExt};
use http::HeaderValue;
use snot_common::rpc::{agent::AgentService, control::ControlServiceClient, RpcTransport};
use snops_common::rpc::{agent::AgentService, control::ControlServiceClient, RpcTransport};
use tarpc::server::Channel;
use tokio::{
select,
Expand Down Expand Up @@ -53,7 +53,7 @@ async fn main() {
tracing_subscriber::registry()
.with(
tracing_subscriber::EnvFilter::builder()
.with_env_var("SNOT_AGENT_LOG")
.with_env_var("SNOPS_AGENT_LOG")
.with_default_directive(LevelFilter::TRACE.into())
.from_env_lossy()
.add_directive("neli=off".parse().unwrap())
Expand Down Expand Up @@ -252,7 +252,7 @@ async fn main() {
}
}

info!("snot agent has shut down gracefully :)");
info!("snops agent has shut down gracefully :)");
}

struct Signals {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{
collections::HashSet, fs, net::IpAddr, ops::Deref, process::Stdio, sync::Arc, time::Duration,
};

use snot_common::{
use snops_common::{
rpc::{
agent::{AgentMetric, AgentService, AgentServiceRequest, AgentServiceResponse},
control::{ControlServiceRequest, ControlServiceResponse},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
sync::{Arc, Mutex},
};

use snot_common::{
use snops_common::{
api::StorageInfoResponse,
rpc::control::ControlServiceClient,
state::{AgentId, AgentPeer, AgentState},
Expand Down
2 changes: 1 addition & 1 deletion crates/snot-cli/Cargo.toml → crates/snops-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "snot-cli"
name = "snops-cli"
version = "0.1.0"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion crates/snot-cli/src/cli.rs → crates/snops-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use clap::Parser;

#[derive(Debug, Parser)]
#[clap(name = "snot-cli", author = "MONADIC.US")]
#[clap(name = "snops-cli", author = "MONADIC.US")]
pub struct Cli {
/// The subcommand to run.
#[clap(subcommand)]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "snot-common"
name = "snops-common"
version = "0.1.0"
edition = "2021"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions crates/snot/Cargo.toml → crates/snops/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "snot"
name = "snops"
version = "0.1.0"
edition = "2021"

Expand Down Expand Up @@ -29,7 +29,7 @@ serde_json.workspace = true
serde_yaml.workspace = true
serde_with = "3.7"
sha2 = "0.10.8"
snot-common = { path = "../snot-common" }
snops-common = { path = "../snops-common" }
strum_macros = "0.26"
surrealdb = { version = "1.3", default-features = false, features = [
"kv-rocksdb",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::path::PathBuf;

use axum::http::StatusCode;
use serde::{ser::SerializeStruct, Serialize, Serializer};
use snot_common::{
use snops_common::{
impl_into_status_code, impl_serialize_pretty_error, rpc::error::PrettyError, state::NodeKey,
};
use strum_macros::AsRefStr;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{
};

use futures_util::{stream::FuturesUnordered, StreamExt};
use snot_common::state::AgentPeer;
use snops_common::state::AgentPeer;
use tokio::{
process::Command,
sync::mpsc::{UnboundedReceiver, UnboundedSender},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashSet;

use serde::{Deserialize, Serialize};
use serde_json::json;
use snot_common::{lasso::Spur, state::NodeKey, INTERN};
use snops_common::{lasso::Spur, state::NodeKey, INTERN};

use super::{
authorized::Authorize,
Expand Down
2 changes: 1 addition & 1 deletion crates/snot/src/cli.rs → crates/snops/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct Cli {
/// Control plane server port
pub port: u16,

#[arg(long, default_value = "snot-control-data")]
#[arg(long, default_value = "snops-control-data")]
/// Path to the directory containing the stored data
pub path: PathBuf,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use axum::http::StatusCode;
use serde::{ser::SerializeStruct, Serialize, Serializer};
use snot_common::{
use snops_common::{
impl_into_status_code, impl_serialize_pretty_error,
rpc::error::PrettyError,
state::{AgentId, NodeKey},
Expand Down
2 changes: 1 addition & 1 deletion crates/snot/src/env/mod.rs → crates/snops/src/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use bimap::{BiHashMap, BiMap};
use futures_util::future::join_all;
use indexmap::{map::Entry, IndexMap};
use serde::Deserialize;
use snot_common::state::{AgentId, AgentPeer, AgentState, NodeKey};
use snops_common::state::{AgentId, AgentPeer, AgentState, NodeKey};
use tokio::{
sync::{Mutex, RwLock},
task::JoinHandle,
Expand Down
2 changes: 1 addition & 1 deletion crates/snot/src/env/set.rs → crates/snops/src/env/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
use fixedbitset::FixedBitSet;
use indexmap::IndexMap;
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use snot_common::{
use snops_common::{
lasso::Spur,
set::MASK_PREFIX_LEN,
state::{AgentId, NodeKey},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
};

use futures_util::future::join_all;
use snot_common::state::{AgentId, AgentState};
use snops_common::state::{AgentId, AgentState};
use tokio::{select, sync::RwLock, task::JoinHandle};
use tracing::{debug, error, info};

Expand Down
10 changes: 5 additions & 5 deletions crates/snot/src/error.rs → crates/snops/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::process::ExitStatus;

use serde::{ser::SerializeStruct, Serialize, Serializer};
use snot_common::rpc::error::PrettyError;
use snot_common::state::AgentId;
use snot_common::{impl_into_status_code, impl_serialize_pretty_error};
use snops_common::rpc::error::PrettyError;
use snops_common::state::AgentId;
use snops_common::{impl_into_status_code, impl_serialize_pretty_error};
use strum_macros::AsRefStr;
use thiserror::Error;

Expand Down Expand Up @@ -54,11 +54,11 @@ impl_into_status_code!(DeserializeError);
#[derive(Debug, Error, AsRefStr)]
pub enum StateError {
#[error("common agent error: {0}")]
Agent(#[from] snot_common::prelude::error::AgentError),
Agent(#[from] snops_common::prelude::error::AgentError),
#[error("source agent has no addr id: `{0}`")]
NoAddress(AgentId),
#[error("common reconcile error: {0}")]
Reconcile(#[from] snot_common::prelude::error::ReconcileError),
Reconcile(#[from] snops_common::prelude::error::ReconcileError),
#[error("rpc error: {0}")]
Rpc(#[from] tarpc::client::RpcError),
#[error("source agent not found id: `{0}`")]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::path::PathBuf;

use axum::http::StatusCode;
use serde::{ser::SerializeStruct, Serialize, Serializer};
use snot_common::{impl_into_status_code, impl_serialize_pretty_error, rpc::error::PrettyError};
use snops_common::{impl_into_status_code, impl_serialize_pretty_error, rpc::error::PrettyError};
use strum_macros::AsRefStr;
use thiserror::Error;
use url::Url;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde::{
ser::SerializeSeq,
Deserialize, Serialize,
};
use snot_common::state::{NodeKey, NodeType};
use snops_common::state::{NodeKey, NodeType};
use wildmatch::WildMatch;

use self::error::{NodeTargetError, SchemaError};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use fixedbitset::FixedBitSet;
use indexmap::IndexMap;
use lazy_static::lazy_static;
use serde::{de::Visitor, Deserialize, Deserializer, Serialize};
use snot_common::{
use snops_common::{
lasso::Spur,
set::{MaskBit, MASK_PREFIX_LEN},
state::{AgentId, DocHeightRequest, KeyState, NodeState, NodeType},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use serde::{
de::{DeserializeOwned, Visitor},
Deserialize, Deserializer, Serialize,
};
use snot_common::state::KeyState;
use snops_common::state::KeyState;
use tokio::process::Command;
use tracing::{error, warn};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{
de::{Error, Visitor},
Deserialize, Deserializer,
};
use snot_common::state::NodeKey;
use snops_common::state::NodeKey;

use super::NodeTargets;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use axum::{
};
use serde::Deserialize;
use serde_json::json;
use snot_common::{
use snops_common::{
api::StorageInfoResponse,
rpc::agent::AgentMetric,
state::{AgentId, EnvId},
Expand Down
File renamed without changes.
Loading

0 comments on commit 4c54bbf

Please sign in to comment.