Skip to content

Commit bb4f017

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

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

Cargo.toml

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

5757
# Internal features
58-
_payjoin-dependencies = ["payjoin", "reqwest", "url"]
58+
_payjoin-dependencies = ["payjoin", "reqwest", "url", "sqlite"]
5959

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

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ And yes, it can do Taproot!!
3636
This crate can be used for the following purposes:
3737
- 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.
3838
- 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).
39-
- 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.
39+
- Receive and send Async Payjoins with session persistence. Sessions can be resumed if interrupted.
4040
- (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.
4141

4242
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)
@@ -150,6 +150,31 @@ cargo run --features rpc -- wallet --wallet payjoin_wallet2 balance
150150
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>"
151151
```
152152

153+
### Payjoin Session Persistence
154+
155+
Payjoin sessions are automatically persisted to a SQLite database (`payjoin.sqlite`) in the data directory. This allows sessions to be resumed if interrupted.
156+
157+
#### Resume Payjoin Sessions
158+
159+
Resume all pending sessions:
160+
```
161+
cargo run --features rpc -- wallet --wallet <wallet_name> resume_payjoin --directory "https://payjo.in" --ohttp_relay "https://pj.bobspacebkk.com"
162+
```
163+
164+
Resume a specific session by ID:
165+
```
166+
cargo run --features rpc -- wallet --wallet <wallet_name> resume_payjoin --directory "https://payjo.in" --ohttp_relay "https://pj.bobspacebkk.com" --session_id <id>
167+
```
168+
169+
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.
170+
171+
#### View Session History
172+
173+
View all payjoin sessions (active and completed) and also see their status:
174+
```
175+
cargo run -- wallet --wallet <wallet_name> payjoin_history
176+
```
177+
153178
## Justfile
154179

155180
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)