Skip to content

Commit 2eea0f4

Browse files
committed
Merge #1128: feat: add bdk_sqlite crate implementing PersistBackend
475c502 feat(sqlite): add bdk_sqlite crate implementing PersistBackend backed by a SQLite database (Steve Myers) b8aa76c feat(wallet): use the new `CombinedChangeSet` of `bdk_persist` (志宇) 0958ff5 feat(persist): introduce `CombinedChangeSet` (志宇) 54942a9 ci: bump build_docs rust version to nightly-2024-05-12 (Steve Myers) d975a48 docs: update README MSRV pinning to match CI (Steve Myers) Pull request description: ### Description Add "bdk_sqlite_store" crate implementing `PersistBackend` backed by a SQLite database. ### Notes to the reviewers In addition to adding a SQLite based `PersistenceBackend` this PR also: * add `CombinedChangeSet` in `bdk_persist` and update `wallet` crate to use it. * updates the `wallet/tests` to also use this new sqlite store crate. * updates `example-crates/wallet_esplora_async` to use this new sqlite store crate. * fixes out of date README instructions for MSRV. * bumps the ci `build_docs` job to rust `nightly-2024-05-12`. ### Changelog notice Changed - Update Wallet to use CombinedChangeSet for persistence. Added - Add CombinedChangeSet in bdk_persist crate. - Add bdk_sqlite crate implementing SQLite based PersistenceBackend storage for CombinedChangeSet. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### New Features: * [x] I've added tests for the new feature * [x] I've added docs for the new feature ACKs for top commit: evanlinjin: ACK 475c502 Tree-SHA512: 72565127994fbfff34d7359e1d36d6f13e552995bb7ea61dd38ba5329b0d15e500fa106214a83fd870f1017dc659ff1bb8fc71bc6aad0a793730ec7f23179d8c
2 parents 2f059a1 + 475c502 commit 2eea0f4

File tree

24 files changed

+1627
-585
lines changed

24 files changed

+1627
-585
lines changed

.github/workflows/nightly_docs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ jobs:
1010
- name: Checkout sources
1111
uses: actions/checkout@v2
1212
- name: Set default toolchain
13-
run: rustup default nightly-2022-12-14
13+
run: rustup default nightly-2024-05-12
1414
- name: Set profile
1515
run: rustup set profile minimal
1616
- name: Update toolchain
1717
run: rustup update
1818
- name: Rust Cache
1919
uses: Swatinem/[email protected]
20-
- name: Pin dependencies for MSRV
21-
run: cargo update -p home --precise "0.5.5"
2220
- name: Build docs
2321
run: cargo doc --no-deps
2422
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Cargo.lock
77

88
# Example persisted files.
99
*.db
10+
*.sqlite*

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ members = [
44
"crates/wallet",
55
"crates/chain",
66
"crates/file_store",
7+
"crates/sqlite",
78
"crates/electrum",
89
"crates/esplora",
910
"crates/bitcoind_rpc",

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,9 @@ This library should compile with any combination of features with Rust 1.63.0.
6868
To build with the MSRV you will need to pin dependencies as follows:
6969

7070
```shell
71-
# zip 0.6.3 has MSRV 1.64.0
72-
cargo update -p zip --precise "0.6.2"
73-
# time 0.3.21 has MSRV 1.65.0
71+
cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
7472
cargo update -p time --precise "0.3.20"
75-
# jobserver 0.1.27 has MSRV 1.66.0
76-
cargo update -p jobserver --precise "0.1.26"
77-
# home 0.5.9 has MSRV 1.70.0
7873
cargo update -p home --precise "0.5.5"
79-
# proptest 1.4.0 has MSRV 1.65.0
8074
cargo update -p proptest --precise "1.2.0"
8175
```
8276

crates/bitcoind_rpc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bitcoincore-rpc = { version = "0.18" }
1919
bdk_chain = { path = "../chain", version = "0.14", default-features = false }
2020

2121
[dev-dependencies]
22-
bdk_testenv = { path = "../testenv", default_features = false }
22+
bdk_testenv = { path = "../testenv", default-features = false }
2323

2424
[features]
2525
default = ["std"]

crates/chain/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ extern crate alloc;
5858
#[cfg(feature = "serde")]
5959
pub extern crate serde_crate as serde;
6060

61-
#[cfg(feature = "bincode")]
62-
extern crate bincode;
63-
6461
#[cfg(feature = "std")]
6562
#[macro_use]
6663
extern crate std;

crates/esplora/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bitcoin = { version = "0.31.0", optional = true, default-features = false }
2222
miniscript = { version = "11.0.0", optional = true, default-features = false }
2323

2424
[dev-dependencies]
25-
bdk_testenv = { path = "../testenv", default_features = false }
25+
bdk_testenv = { path = "../testenv", default-features = false }
2626
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }
2727

2828
[features]

crates/file_store/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# BDK File Store
22

3-
This is a simple append-only flat file implementation of
4-
[`PersistBackend`](bdk_persist::PersistBackend).
3+
This is a simple append-only flat file implementation of [`PersistBackend`](bdk_persist::PersistBackend).
54

6-
The main structure is [`Store`](crate::Store), which can be used with [`bdk`]'s
7-
`Wallet` to persist wallet data into a flat file.
5+
The main structure is [`Store`] which works with any [`bdk_chain`] based changesets to persist data into a flat file.
86

9-
[`bdk`]: https://docs.rs/bdk/latest
10-
[`bdk_persist`]: https://docs.rs/bdk_persist/latest
7+
[`bdk_chain`]:https://docs.rs/bdk_chain/latest/bdk_chain/

crates/persist/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ anyhow = { version = "1", default-features = false }
1717
bdk_chain = { path = "../chain", version = "0.14.0", default-features = false }
1818

1919
[features]
20-
default = ["bdk_chain/std"]
21-
22-
20+
default = ["bdk_chain/std", "miniscript"]
21+
serde = ["bdk_chain/serde"]
22+
miniscript = ["bdk_chain/miniscript"]

crates/persist/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# BDK Persist
22

3-
This crate is home to the [`PersistBackend`](crate::PersistBackend) trait which defines the behavior of a database to perform the task of persisting changes made to BDK data structures. The [`Persist`](crate::Persist) type provides a convenient wrapper around a `PersistBackend` that allows staging changes before committing them.
3+
This crate is home to the [`PersistBackend`] trait which defines the behavior of a database to perform the task of persisting changes made to BDK data structures.
4+
5+
The [`Persist`] type provides a convenient wrapper around a [`PersistBackend`] that allows staging changes before committing them.

0 commit comments

Comments
 (0)