Skip to content

Commit 97079fc

Browse files
committed
Remove dotenv dependency
Code refactoring
1 parent 07f54fd commit 97079fc

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

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: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,20 @@ 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
34+
# Edit .env-sample and set MOSTRO_PUBKEY, RELAYS, and POW
3035
# For admin commands, also set ADMIN_NSEC
36+
source .env-sample
3137
cargo run
3238
```
3339

@@ -61,7 +67,7 @@ Commands:
6167
6268
Options:
6369
-v, --verbose
64-
-m, --mostropubkey <MOSTROPUBKEY>
70+
-m, --mostropubkey <MOSTRO_PUBKEY>
6571
-r, --relays <RELAYS>
6672
-p, --pow <POW>
6773
-h, --help Print help
@@ -71,11 +77,11 @@ Options:
7177
## Examples
7278

7379
```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
80+
$ mostro-cli -m npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0 -r 'wss://relay.mostro.network,wss://relay.damus.io' listorders
7581

7682
# 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'
83+
$ export MOSTRO_PUBKEY=npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0
84+
$ export RELAYS='wss://relay.mostro.network,wss://relay.damus.io'
7985
$ mostro-cli listorders
8086

8187
# Create a new buy order
@@ -105,5 +111,5 @@ $ mostro-cli neworder -p 10 -k sell -c ars -f 1000-10000 -m "face to face"
105111
- [x] Direct message with peers (use nip-17)
106112
- [x] Conversation key management
107113
- [x] Add a new dispute's solver (for admins)
108-
- [ ] Identity management (Nip-06 support)
109-
- [ ] List own orders
114+
- [x] Identity management (Nip-06 support)
115+
- [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,7 +1,7 @@
11
use anyhow::{Error, Result};
22
use base64::engine::general_purpose;
33
use base64::Engine;
4-
use dotenvy::var;
4+
use std::env::var;
55
use log::info;
66
use mostro_core::prelude::*;
77
use nip44::v2::{encrypt_to_bytes, ConversationKey};

src/util/net.rs

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

55
pub async fn connect_nostr() -> Result<Client> {

0 commit comments

Comments
 (0)