Skip to content
Snippets Groups Projects
Commit 6f98e125 authored by poka's avatar poka
Browse files

wip

parent 5dd41657
No related branches found
No related tags found
No related merge requests found
Pipeline #40078 failed
......@@ -1587,6 +1587,12 @@ dependencies = [
"parking_lot_core",
]
[[package]]
name = "data-encoding"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010"
[[package]]
name = "der"
version = "0.7.9"
......@@ -2361,12 +2367,16 @@ dependencies = [
"rstest",
"scrypt",
"sea-orm",
"secp256k1",
"serde",
"serde_json",
"sha2 0.10.8",
"sp-core",
"sp-runtime",
"subxt",
"tokio",
"tokio-tungstenite",
"url",
]
[[package]]
......@@ -5172,6 +5182,7 @@ version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10"
dependencies = [
"rand",
"secp256k1-sys",
]
......@@ -6742,6 +6753,22 @@ dependencies = [
"tokio",
]
[[package]]
name = "tokio-tungstenite"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38"
dependencies = [
"futures-util",
"log",
"rustls 0.22.4",
"rustls-pki-types",
"tokio",
"tokio-rustls 0.25.0",
"tungstenite",
"webpki-roots 0.26.6",
]
[[package]]
name = "tokio-util"
version = "0.7.12"
......@@ -6969,6 +6996,27 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "tungstenite"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1"
dependencies = [
"byteorder",
"bytes",
"data-encoding",
"http 1.1.0",
"httparse",
"log",
"rand",
"rustls 0.22.4",
"rustls-pki-types",
"sha1",
"thiserror",
"url",
"utf-8",
]
[[package]]
name = "twox-hash"
version = "1.6.3"
......@@ -7114,6 +7162,12 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "utf-8"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
[[package]]
name = "utf8parse"
version = "0.2.2"
......
......@@ -35,16 +35,21 @@ hex = "^0.4.3"
log = "^0.4.22"
reqwest = { version = "^0.11.27", default-features = false, features = [
"rustls-tls",
"json",
] }
inquire = "^0.7.5"
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0.128"
tokio = { version = "^1.40.0", features = ["macros"] }
tokio = { version = "^1.40.0", features = ["macros", "time"] }
tokio-tungstenite = { version = "0.21.0", features = ["rustls-tls-webpki-roots"] }
url = "2.5.0"
confy = "^0.5.1"
bs58 = "^0.5.1"
directories = "^5.0.1"
comfy-table = "^7.1.1"
sea-orm = { version = "1.1.0", features = [ "sqlx-sqlite", "runtime-tokio-native-tls", "macros" ] }
sha2 = "0.10.8"
secp256k1 = { version = "0.28.2", features = ["rand", "recovery"] }
# crypto
scrypt = { version = "^0.11", default-features = false } # for old-style key generation
......
......@@ -8,6 +8,7 @@ pub mod expire;
pub mod identity;
pub mod net_test;
pub mod oneshot;
pub mod profile;
pub mod publish;
pub mod revocation;
pub mod runtime;
......
This diff is collapsed.
use crate::*;
#[cfg(any(feature = "dev", feature = "gdev"))] // find how to get runtime calls
#[cfg(feature = "gdev")] // find how to get runtime calls
type Call = runtime::runtime_types::gdev_runtime::RuntimeCall;
type BalancesCall = runtime::runtime_types::pallet_balances::pallet::Call;
......
......@@ -148,7 +148,7 @@ pub fn decrypt(input: &[u8], passphrase: String) -> Result<Vec<u8>, age::Decrypt
pub async fn handle_command(data: Data, command: Subcommand) -> Result<(), GcliError> {
let db = data.connect_db();
// match subcommand
#[allow(deprecated)]
match command {
Subcommand::List(choice) => match choice {
ListChoice::All => {
......
......@@ -15,6 +15,8 @@ pub struct Config {
/// user address
/// to perform actions, user must provide secret
pub address: Option<AccountId>,
/// nostr relay endpoint
pub relay: Option<String>,
}
impl std::default::Default for Config {
......@@ -23,6 +25,7 @@ impl std::default::Default for Config {
duniter_endpoint: String::from(data::LOCAL_DUNITER_ENDPOINT),
indexer_endpoint: String::from(data::LOCAL_INDEXER_ENDPOINT),
address: None,
relay: Some(String::from("wss://relay.damus.io")),
}
}
}
......@@ -34,10 +37,16 @@ impl std::fmt::Display for Config {
} else {
"(no address)".to_string()
};
let relay = if let Some(relay) = &self.relay {
relay.clone()
} else {
"(no relay)".to_string()
};
writeln!(f, "Ğcli config")?;
writeln!(f, "duniter endpoint {}", self.duniter_endpoint)?;
writeln!(f, "indexer endpoint {}", self.indexer_endpoint)?;
write!(f, "address {address}")
writeln!(f, "address {address}")?;
write!(f, "nostr relay {relay}")
}
}
......
......@@ -149,6 +149,9 @@ pub enum Subcommand {
/// Key management (import, generate, list...)
#[clap(subcommand)]
Vault(commands::vault::Subcommand),
/// Nostr profile management (get, set...)
#[clap(subcommand)]
Profile(commands::profile::Subcommand),
/// Cesium
#[clap(subcommand, hide = true)]
Cesium(commands::cesium::Subcommand),
......@@ -190,6 +193,7 @@ async fn main() -> Result<(), GcliError> {
Subcommand::Indexer(subcommand) => indexer::handle_command(data, subcommand).await,
Subcommand::Config(subcommand) => conf::handle_command(data, subcommand).await,
Subcommand::Vault(subcommand) => commands::vault::handle_command(data, subcommand).await,
Subcommand::Profile(subcommand) => commands::profile::handle_command(data, subcommand).await,
Subcommand::Cesium(subcommand) => commands::cesium::handle_command(data, subcommand).await,
Subcommand::Publish => commands::publish::handle_command().await,
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment