Skip to content

Commit 2dec619

Browse files
authored
Merge pull request #150 from MostroP2P/remove-dotenv
Remove dotenv dependency
2 parents 07f54fd + a57ce64 commit 2dec619

File tree

8 files changed

+21
-26
lines changed

8 files changed

+21
-26
lines changed

.env-sample

Lines changed: 0 additions & 8 deletions
This file was deleted.

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ uuid = { version = "1.18.1", features = [
3636
"macro-diagnostics",
3737
"serde",
3838
] }
39-
dotenvy = "0.15.6"
4039
lightning-invoice = { version = "0.33.2", features = ["std"] }
4140
reqwest = { version = "0.12.23", default-features = false, features = [
4241
"json",

README.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@ sudo apt install -y cmake build-essential pkg-config
2020

2121
## Install
2222

23-
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.
23+
You can install directly from crates:
24+
25+
```bash
26+
cargo install mostro-cli
27+
```
28+
29+
Or downloading and compiling it by yourself:
2430

2531
```bash
2632
git clone https://github.com/MostroP2P/mostro-cli.git
2733
cd mostro-cli
28-
cp .env-sample .env
29-
# Edit .env and set MOSTRO_PUBKEY, RELAYS, and POW
30-
# For admin commands, also set ADMIN_NSEC
31-
cargo run
34+
cargo build --release
35+
# The binary will be created on target/release/mostro-cli
3236
```
3337

3438
## Usage
@@ -61,7 +65,7 @@ Commands:
6165
6266
Options:
6367
-v, --verbose
64-
-m, --mostropubkey <MOSTROPUBKEY>
68+
-m, --mostropubkey <MOSTRO_PUBKEY>
6569
-r, --relays <RELAYS>
6670
-p, --pow <POW>
6771
-h, --help Print help
@@ -71,11 +75,13 @@ Options:
7175
## Examples
7276

7377
```bash
74-
$ 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
78+
$ mostro-cli -m npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0 -r 'wss://relay.mostro.network,wss://relay.damus.io' listorders
7579

7680
# You can set the env vars to avoid the -m, -n and -r flags
77-
$ export MOSTROPUBKEY=npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0
78-
$ 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'
81+
$ export MOSTRO_PUBKEY=npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0
82+
$ export RELAYS='wss://relay.mostro.network,wss://relay.damus.io'
83+
# if the Mostro require proof of work of 10 for example
84+
$ export POW=10
7985
$ mostro-cli listorders
8086

8187
# Create a new buy order
@@ -86,6 +92,8 @@ $ mostro-cli cancel -o eb5740f6-e584-46c5-953a-29bc3eb818f0
8692

8793
# Create a new sell range order with Proof or work difficulty of 10
8894
$ mostro-cli neworder -p 10 -k sell -c ars -f 1000-10000 -m "face to face"
95+
96+
# For admin commands, also set ADMIN_NSEC (this private key is different from the mnemonic in database we use to trade)
8997
```
9098

9199
## Progress Overview
@@ -105,5 +113,5 @@ $ mostro-cli neworder -p 10 -k sell -c ars -f 1000-10000 -m "face to face"
105113
- [x] Direct message with peers (use nip-17)
106114
- [x] Conversation key management
107115
- [x] Add a new dispute's solver (for admins)
108-
- [ ] Identity management (Nip-06 support)
109-
- [ ] List own orders
116+
- [x] Identity management (Nip-06 support)
117+
- [x] List own orders

src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
use anyhow::Result;
2-
use dotenvy::dotenv;
32
use mostro_client::cli::run;
43
use std::process;
54

65
#[tokio::main]
76
async fn main() -> Result<()> {
8-
dotenv().ok();
9-
107
if let Err(e) = run().await {
118
eprintln!("{e}");
129
process::exit(1);

src/util/messaging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use anyhow::{Error, Result};
22
use base64::engine::general_purpose;
33
use base64::Engine;
4-
use dotenvy::var;
54
use log::info;
65
use mostro_core::prelude::*;
76
use nip44::v2::{encrypt_to_bytes, ConversationKey};
87
use nostr_sdk::prelude::*;
8+
use std::env::var;
99

1010
use crate::cli::Context;
1111
use crate::parser::dms::print_commands_results;

src/util/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::Result;
2-
use dotenvy::var;
32
use nostr_sdk::prelude::*;
3+
use std::env::var;
44

55
pub async fn connect_nostr() -> Result<Client> {
66
let my_keys = Keys::generate();

static/logo.png

-23.5 KB
Loading

0 commit comments

Comments
 (0)