Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ 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
# Edit .env-sample and set MOSTRO_PUBKEY, RELAYS, and POW
# For admin commands, also set ADMIN_NSEC
source .env-sample
cargo run
```

Expand Down Expand Up @@ -61,7 +67,7 @@ Commands:

Options:
-v, --verbose
-m, --mostropubkey <MOSTROPUBKEY>
-m, --mostropubkey <MOSTRO_PUBKEY>
-r, --relays <RELAYS>
-p, --pow <POW>
-h, --help Print help
Expand All @@ -71,11 +77,11 @@ 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'
$ mostro-cli listorders

# Create a new buy order
Expand Down Expand Up @@ -105,5 +111,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
3 changes: 0 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/util/messaging.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::{Error, Result};
use base64::engine::general_purpose;
use base64::Engine;
use dotenvy::var;
use std::env::var;
use log::info;
use mostro_core::prelude::*;
use nip44::v2::{encrypt_to_bytes, ConversationKey};
Expand Down
2 changes: 1 addition & 1 deletion src/util/net.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use dotenvy::var;
use std::env::var;
use nostr_sdk::prelude::*;

pub async fn connect_nostr() -> Result<Client> {
Expand Down
Loading