Skip to content

Commit 7e4ffd1

Browse files
committed
docs: update README with new payjoin session commands
- Document resume and history commands - Add sqlite dependecy for payjoin
1 parent d76ac9b commit 7e4ffd1

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ esplora = ["bdk_esplora", "_payjoin-dependencies"]
5454
rpc = ["bdk_bitcoind_rpc", "_payjoin-dependencies"]
5555

5656
# Internal features
57-
_payjoin-dependencies = ["payjoin", "reqwest", "url"]
57+
_payjoin-dependencies = ["payjoin", "reqwest", "url", "sqlite"]
5858

5959
# Use this to consensus verify transactions at sync time
6060
verify = []

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ And yes, it can do Taproot!!
3535
This crate can be used for the following purposes:
3636
- Instantly create a miniscript based wallet and connect to your backend of choice (Electrum, Esplora, Core RPC, Kyoto etc) and quickly play around with your own complex bitcoin scripting workflow. With one or many wallets, connected with one or many backends.
3737
- The `tests/integration.rs` module is used to document high level complex workflows between BDK and different Bitcoin infrastructure systems, like Core, Electrum and Lightning(soon TM).
38-
- Receive and send Async Payjoins. Note that even though Async Payjoin as a protocol allows the receiver and sender to go offline during the payjoin, the BDK CLI implementation currently does not support persisting.
38+
- Receive and send Async Payjoins with session persistence. Sessions can be resumed if interrupted.
3939
- (Planned) Expose the basic command handler via `wasm` to integrate `bdk-cli` functionality natively into the web platform. See also the [playground](https://bitcoindevkit.org/bdk-cli/playground/) page.
4040

4141
If you are considering using BDK in your own wallet project bdk-cli is a nice playground to get started with. It allows easy testnet and regtest wallet operations, to try out what's possible with descriptors, miniscript, and BDK APIs. For more information on BDK refer to the [website](https://bitcoindevkit.org/) and the [rust docs](https://docs.rs/bdk_wallet/1.0.0/bdk_wallet/index.html)
@@ -140,6 +140,31 @@ cargo run --features rpc -- wallet --wallet payjoin_wallet2 balance
140140
cargo run --features rpc -- wallet --wallet payjoin_wallet2 send_payjoin --ohttp_relay "https://pj.bobspacebkk.com" --ohttp_relay "https://pj.benalleng.com" --fee_rate 1 --uri "<URI>"
141141
```
142142

143+
### Payjoin Session Persistence
144+
145+
Payjoin sessions are automatically persisted to a SQLite database (`payjoin.sqlite`) in the data directory. This allows sessions to be resumed if interrupted.
146+
147+
#### Resume Payjoin Sessions
148+
149+
Resume all pending sessions:
150+
```
151+
cargo run --features rpc -- wallet --wallet <wallet_name> resume_payjoin --directory "https://payjo.in" --ohttp_relay "https://pj.bobspacebkk.com"
152+
```
153+
154+
Resume a specific session by ID:
155+
```
156+
cargo run --features rpc -- wallet --wallet <wallet_name> resume_payjoin --directory "https://payjo.in" --ohttp_relay "https://pj.bobspacebkk.com" --session_id <id>
157+
```
158+
159+
Sessions are processed sequentially (not concurrently) due to BDK-CLI's architecture. Each session waits up to 30 seconds for updates before timing out. If no session ID is specified, the most recent active sessions are resumed first.
160+
161+
#### View Session History
162+
163+
View all payjoin sessions (active and completed) and also see their status:
164+
```
165+
cargo run -- wallet --wallet <wallet_name> payjoin_history
166+
```
167+
143168
## Justfile
144169

145170
We have added the `just` command runner to help you with common commands (during development) and running regtest `bitcoind` if you are using the `rpc` feature.

0 commit comments

Comments
 (0)