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
8 changes: 0 additions & 8 deletions .env-sample

This file was deleted.

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
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -61,7 +65,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 +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
Expand All @@ -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
Expand All @@ -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
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,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;
Expand Down
2 changes: 1 addition & 1 deletion src/util/net.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use dotenvy::var;
use nostr_sdk::prelude::*;
use std::env::var;

pub async fn connect_nostr() -> Result<Client> {
let my_keys = Keys::generate();
Expand Down
Binary file modified static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.