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
105 changes: 105 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ alloy = { version = "0.1.3", features = [
"rpc-types",
"rpc-types-eth",
"signers",
"signer-keystore",
"signer-local",
] }
alloy-sol-macro = "0.7.6"
Expand All @@ -38,6 +39,7 @@ nix = { version = "0.27", features = ["process", "signal", "term"] }
regex = "1"
reqwest = { version = "0.11", features = ["json"] }
rmp-serde = "1.1.2"
rpassword = "7"
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
5 changes: 1 addition & 4 deletions src/boot_fake_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,7 @@ pub async fn execute(
.join(if release { "release" } else { "debug" })
.join("kinode")
} else {
return Err(eyre!(
"--runtime-path {:?} must be a directory (the repo).",
runtime_path,
));
runtime_path
}
},
};
Expand Down
58 changes: 37 additions & 21 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,19 @@ async fn execute(
)
}
Some(("publish", publish_matches)) => {
let private_key = publish_matches.get_one::<String>("PRIVATE_KEY").cloned();
let app_name = publish_matches.get_one::<String>("APP_NAME").cloned();
let fakechain_port = *publish_matches.get_one::<u16>("FAKECHAIN_PORT").unwrap();
let manifest_path = publish_matches.get_one::<String>("MANIFEST").unwrap();
let package_dir =
PathBuf::from(publish_matches.get_one::<String>("DIR").unwrap());
let metadata_uri = publish_matches.get_one::<String>("URI").unwrap();
let keystore_path =
PathBuf::from(publish_matches.get_one::<String>("PATH").unwrap());
let fakechain_port = publish_matches.get_one::<u16>("FAKECHAIN_PORT").unwrap();

publish::execute(private_key, app_name, fakechain_port, manifest_path).await
publish::execute(
&package_dir,
metadata_uri,
&keystore_path,
fakechain_port,
).await
}
Some(("remove-package", remove_package_matches)) => {
let package_name = remove_package_matches
Expand Down Expand Up @@ -887,26 +894,35 @@ async fn make_app(current_dir: &std::ffi::OsString) -> Result<Command> {
)
)
.subcommand(Command::new("publish")
.about("Publish or update an app")
.about("Publish or update a package")
.visible_alias("p")
.arg(Arg::new("PRIVATE_KEY")
.arg(Arg::new("DIR")
.action(ArgAction::Set)
.help("The package directory to publish")
.default_value(current_dir)
)
.arg(Arg::new("URI")
.action(ArgAction::Set)
.short('u')
.long("metadata-uri")
.help("URI where metadata lives")
.required(true)
)
.arg(Arg::new("PATH")
.action(ArgAction::Set)
.short('k')
.long("private-key")
.help("Private key for transaction signing")
.required(false)
.long("keystore-path")
.help("Path to private key keystore") // TODO: add link to docs?
.required(true) // TODO: -> false when add hardware wallets
)
.arg(Arg::new("APP_NAME")
.short('n')
.long("app-name")
.help("Name of the app to publish")
.required(false)
.arg(Arg::new("FAKECHAIN_PORT")
.action(ArgAction::Set)
.short('c')
.long("fakechain-port")
.help("The port to connect to the fakechain on")
.default_value("8545")
.value_parser(value_parser!(u16))
)
.arg(Arg::new("MANIFEST")
.short('m')
.long("manifest")
.help("Path to the manifest file")
.default_value("manifest.json")
)
)
.subcommand(Command::new("remove-package")
.about("Remove a running package from a node")
Expand Down
Loading