38 个版本 (5 个重大更新)
0.10.1 | 2024年6月20日 |
---|---|
0.9.2 | 2024年4月1日 |
0.9.1 | 2024年3月28日 |
0.8.2 | 2023年12月20日 |
0.5.9 | 2023年3月29日 |
#1716 in 魔法豆
130KB
3K SLoC
Mostro CLI 🧌
一个非常简单的命令行界面,显示从 Mostro 中所有新的可替换事件
需求
- 您需要 Rust 版本 1.64 或更高版本来编译。
- 您需要一个闪电网络节点
安装依赖项
要在 Ubuntu/Pop!_OS 上编译,请安装 cargo,然后运行以下命令
$ sudo apt update
$ sudo apt install -y cmake build-essential pkg-config
安装
安装时,您需要填写 env vars (.env
) 并添加您的私钥和 Mostro 公钥。
$ git clone https://github.com/MostroP2P/mostro-cli.git
$ cd mostro-cli
$ cp .env-sample .env
$ cargo run
用法
Commands:
listorders Requests open orders from Mostro pubkey
neworder Create a new buy/sell order on Mostro
takesell Take a sell order from a Mostro pubkey
takebuy Take a buy order from a Mostro pubkey
addinvoice Buyer add a new invoice to receive the payment
getdm Get the latest direct messages from Mostro
fiatsent Send fiat sent message to confirm payment to other user
release Settle the hold invoice and pay to buyer
cancel Cancel a pending order
rate Rate counterpart after a successful trade
dispute Start a dispute
admcancel Cancel an order (only admin)
admsettle Settle a seller's hold invoice (only admin)
admlistdisputes Requests open disputes from Mostro pubkey
admaddsolver Add a new dispute's solver (only admin)
admtakedispute Admin or solver take a Pending dispute (only admin)
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose
-n, --nsec <NSEC>
-m, --mostropubkey <MOSTROPUBKEY>
-r, --relays <RELAYS>
-h, --help Print help
-V, --version Print version
示例
$ mostro-cli -m npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0 -n nsec1...5ssky7pw -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
# You can set the env vars to avoid the -m, -n and -r flags
$ export MOSTROPUBKEY=npub1ykvsmrmw2hk7jgxgy64zr8tfkx4nnjhq9eyfxdlg3caha3ph0skq6jr3z0
$ export NSEC=nsec1...5ssky7pw
$ 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'
$ mostro-cli listorders
# Create a new buy order
$ mostro-cli neworder -k buy -c ves -f 1000 -m "face to face"
# Cancel a pending order
$ mostro-cli cancel -o eb5740f6-e584-46c5-953a-29bc3eb818f0
依赖项
~83MB
~1.5M SLoC