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
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions kinode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ static_dir = "0.2.0"
thiserror = "1.0"
tokio = { version = "1.28", features = ["fs", "macros", "rt-multi-thread", "signal", "sync"] }
tokio-tungstenite = { version = "0.21.0", features = ["native-tls"] }
unicode-segmentation = "1.11"
unicode-width = "0.1.13"
url = "2.4.1"
warp = "0.3.5"
wasi-common = "19.0.1"
Expand Down
8 changes: 2 additions & 6 deletions kinode/packages/app_store/chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ use kinode_process_lib::{
await_message, call_init, eth, get_blob, get_state, http, kernel_types as kt, kimap,
print_to_terminal, println, timer, Address, Message, PackageId, Request, Response,
};
use serde::{Deserialize, Serialize};
use std::{
collections::{HashMap, HashSet},
str::FromStr,
};

use serde::{Deserialize, Serialize};

wit_bindgen::generate!({
path: "target/wit",
generate_unused_types: true,
Expand Down Expand Up @@ -256,10 +255,7 @@ fn handle_eth_log(our: &Address, state: &mut State, log: eth::Log) -> anyhow::Re
_ => Err(e),
},
}
.map_err(|e| {
println!("Couldn't find {hash_note}: {e:?}");
anyhow::anyhow!("metadata hash mismatch")
})?;
.map_err(|e| anyhow::anyhow!("Couldn't find {hash_note}: {e:?}"))?;

match data {
None => {
Expand Down
24 changes: 11 additions & 13 deletions kinode/packages/terminal/terminal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum TerminalAction {

#[derive(Debug, Serialize, Deserialize)]
enum ScriptError {
UnknownName,
UnknownName(String),
FailedToReadWasm,
NoScriptsManifest,
NoScriptInManifest,
Expand All @@ -30,18 +30,16 @@ enum ScriptError {

impl std::fmt::Display for ScriptError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
ScriptError::UnknownName => "script not found, either as an alias or process ID",
ScriptError::FailedToReadWasm => "failed to read script Wasm from VFS",
ScriptError::NoScriptsManifest => "no scripts manifest in package",
ScriptError::NoScriptInManifest => "script not in scripts.json file",
ScriptError::InvalidScriptsManifest => "could not parse scripts.json file",
ScriptError::KernelUnresponsive => "kernel unresponsive",
match self {
ScriptError::UnknownName(name) => {
write!(f, "'{name}' not found, either as an alias or process ID")
}
)
ScriptError::FailedToReadWasm => write!(f, "failed to read script Wasm from VFS"),
ScriptError::NoScriptsManifest => write!(f, "no scripts manifest in package"),
ScriptError::NoScriptInManifest => write!(f, "script not in scripts.json file"),
ScriptError::InvalidScriptsManifest => write!(f, "could not parse scripts.json file"),
ScriptError::KernelUnresponsive => write!(f, "kernel unresponsive"),
}
}
}

Expand Down Expand Up @@ -187,7 +185,7 @@ fn parse_command(state: &mut TerminalState, line: String) -> Result<(), ScriptEr
Some(process) => handle_run(&state.our, process, args.to_string()),
None => match head.parse::<ProcessId>() {
Ok(pid) => handle_run(&state.our, &pid, args.to_string()),
Err(_) => Err(ScriptError::UnknownName),
Err(_) => Err(ScriptError::UnknownName(head.to_string())),
},
}
}
Expand Down
14 changes: 11 additions & 3 deletions kinode/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ async fn main() {
let rpc = matches.get_one::<String>("rpc");
let password = matches.get_one::<String>("password");

// logging mode is toggled at runtime by CTRL+L
let is_logging = *matches.get_one::<bool>("logging").unwrap();

// detached determines whether terminal is interactive
let detached = *matches.get_one::<bool>("detached").unwrap();

Expand Down Expand Up @@ -423,6 +426,7 @@ async fn main() {
print_receiver,
detached,
verbose_mode,
is_logging,
) => {
match quit {
Ok(()) => {
Expand Down Expand Up @@ -630,7 +634,7 @@ fn build_command() -> Command {
.about("A General Purpose Sovereign Cloud Computing Platform")
.arg(arg!([home] "Path to home directory").required(true))
.arg(
arg!(--port <PORT> "Port to bind [default: first unbound at or above 8080]")
arg!(-p --port <PORT> "Port to bind [default: first unbound at or above 8080]")
.value_parser(value_parser!(u16)),
)
.arg(
Expand All @@ -644,17 +648,21 @@ fn build_command() -> Command {
.value_parser(value_parser!(u16)),
)
.arg(
arg!(--verbosity <VERBOSITY> "Verbosity level: higher is more verbose")
arg!(-v --verbosity <VERBOSITY> "Verbosity level: higher is more verbose")
.default_value("0")
.value_parser(value_parser!(u8)),
)
.arg(
arg!(-l --logging <IS_LOGGING> "Run in logging mode (toggled at runtime by CTRL+L): write all terminal output to .terminal_log file")
.action(clap::ArgAction::SetTrue),
)
.arg(
arg!(--"reveal-ip" "If set to false, as an indirect node, always use routers to connect to other nodes.")
.default_value("true")
.value_parser(value_parser!(bool)),
)
.arg(
arg!(--detached <IS_DETACHED> "Run in detached mode (don't accept input)")
arg!(-d --detached <IS_DETACHED> "Run in detached mode (don't accept input)")
.action(clap::ArgAction::SetTrue),
)
.arg(arg!(--rpc <RPC> "Add a WebSockets RPC URL at boot"))
Expand Down
Loading
Loading