diff --git a/.env-sample b/.env-sample deleted file mode 100644 index 0180c30..0000000 --- a/.env-sample +++ /dev/null @@ -1,8 +0,0 @@ -# Mostro pubkey in npub format -MOSTRO_PUBKEY='npub1...' -# Comma-separated list of relays -RELAYS='wss://relay.nostr.vision,wss://nostr.zebedee.cloud,wss://nostr.slothy.win,wss://nostr.rewardsbunny.com,wss://nostr.supremestack.xyz,wss://nostr.shawnyeager.net,wss://relay.nostrmoto.xyz,wss://nostr.roundrockbitcoiners.com' -POW='0' - -# Admin private key in nsec format (only required for admin commands) -# ADMIN_NSEC='nsec1...' \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 5d3e623..87789b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1666,7 +1666,6 @@ dependencies = [ "clap", "comfy-table", "dirs", - "dotenvy", "futures", "lightning-invoice", "lnurl-rs", diff --git a/Cargo.toml b/Cargo.toml index 64fc195..e16eeb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,6 @@ uuid = { version = "1.18.1", features = [ "macro-diagnostics", "serde", ] } -dotenvy = "0.15.6" lightning-invoice = { version = "0.33.2", features = ["std"] } reqwest = { version = "0.12.23", default-features = false, features = [ "json", diff --git a/README.md b/README.md index f31aa75..4454b35 100644 --- a/README.md +++ b/README.md @@ -20,15 +20,19 @@ sudo apt install -y cmake build-essential pkg-config ## Install -To install you need to fill the env vars (`.env`) with the Mostro pubkey and relays. For admin commands, you'll also need to set your admin private key. +You can install directly from crates: + +```bash +cargo install mostro-cli +``` + +Or downloading and compiling it by yourself: ```bash git clone https://github.com/MostroP2P/mostro-cli.git cd mostro-cli -cp .env-sample .env -# Edit .env and set MOSTRO_PUBKEY, RELAYS, and POW -# For admin commands, also set ADMIN_NSEC -cargo run +cargo build --release +# The binary will be created on target/release/mostro-cli ``` ## Usage @@ -61,7 +65,7 @@ Commands: Options: -v, --verbose - -m, --mostropubkey + -m, --mostropubkey -r, --relays -p, --pow -h, --help Print help @@ -71,11 +75,13 @@ Options: ## Examples ```bash -$ mostro-cli -m npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0 -r 'wss://nos.lol,wss://relay.damus.io,wss://nostr-pub.wellorder.net,wss://nostr.mutinywallet.com,wss://relay.nostr.band,wss://nostr.cizmar.net,wss://140.f7z.io,wss://nostrrelay.com,wss://relay.nostrr.de' listorders +$ mostro-cli -m npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0 -r 'wss://relay.mostro.network,wss://relay.damus.io' listorders # You can set the env vars to avoid the -m, -n and -r flags -$ export MOSTROPUBKEY=npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0 -$ export RELAYS='wss://nos.lol,wss://relay.damus.io,wss://nostr-pub.wellorder.net,wss://nostr.mutinywallet.com,wss://relay.nostr.band,wss://nostr.cizmar.net,wss://140.f7z.io,wss://nostrrelay.com,wss://relay.nostrr.de' +$ export MOSTRO_PUBKEY=npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0 +$ export RELAYS='wss://relay.mostro.network,wss://relay.damus.io' +# if the Mostro require proof of work of 10 for example +$ export POW=10 $ mostro-cli listorders # Create a new buy order @@ -86,6 +92,8 @@ $ mostro-cli cancel -o eb5740f6-e584-46c5-953a-29bc3eb818f0 # Create a new sell range order with Proof or work difficulty of 10 $ mostro-cli neworder -p 10 -k sell -c ars -f 1000-10000 -m "face to face" + +# For admin commands, also set ADMIN_NSEC (this private key is different from the mnemonic in database we use to trade) ``` ## Progress Overview @@ -105,5 +113,5 @@ $ mostro-cli neworder -p 10 -k sell -c ars -f 1000-10000 -m "face to face" - [x] Direct message with peers (use nip-17) - [x] Conversation key management - [x] Add a new dispute's solver (for admins) -- [ ] Identity management (Nip-06 support) -- [ ] List own orders +- [x] Identity management (Nip-06 support) +- [x] List own orders diff --git a/src/main.rs b/src/main.rs index d6f20d9..a3feac9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,9 @@ use anyhow::Result; -use dotenvy::dotenv; use mostro_client::cli::run; use std::process; #[tokio::main] async fn main() -> Result<()> { - dotenv().ok(); - if let Err(e) = run().await { eprintln!("{e}"); process::exit(1); diff --git a/src/util/messaging.rs b/src/util/messaging.rs index 141348c..f8aaca1 100644 --- a/src/util/messaging.rs +++ b/src/util/messaging.rs @@ -1,11 +1,11 @@ use anyhow::{Error, Result}; use base64::engine::general_purpose; use base64::Engine; -use dotenvy::var; use log::info; use mostro_core::prelude::*; use nip44::v2::{encrypt_to_bytes, ConversationKey}; use nostr_sdk::prelude::*; +use std::env::var; use crate::cli::Context; use crate::parser::dms::print_commands_results; diff --git a/src/util/net.rs b/src/util/net.rs index c2bcc1f..0bf2409 100644 --- a/src/util/net.rs +++ b/src/util/net.rs @@ -1,6 +1,6 @@ use anyhow::Result; -use dotenvy::var; use nostr_sdk::prelude::*; +use std::env::var; pub async fn connect_nostr() -> Result { let my_keys = Keys::generate(); diff --git a/static/logo.png b/static/logo.png index a69132d..efde288 100644 Binary files a/static/logo.png and b/static/logo.png differ