https://github.com/bitcoindevkit/bdk-sqlx
BDK async storage implementation using postgres + sqlx
https://github.com/bitcoindevkit/bdk-sqlx
Last synced: 5 months ago
JSON representation
BDK async storage implementation using postgres + sqlx
- Host: GitHub
- URL: https://github.com/bitcoindevkit/bdk-sqlx
- Owner: bitcoindevkit
- License: mit
- Created: 2024-08-19T17:49:04.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-09-12T02:02:25.000Z (7 months ago)
- Last Synced: 2024-09-12T11:52:54.796Z (7 months ago)
- Language: Rust
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bdk-sqlx
## Status
This crate is still **EXPERIMENTAL** do not use with mainnet wallets.
## Testing
1. Install postgresql with `psql` tool. For example (macos):
```
brew update
brew install postgresql
```
2. Create empty test database:
```
psql postgres
postgres=# create database test_bdk_wallet;
```
3. Set DATABASE_URL to test database:
```
export DATABASE_TEST_URL=postgresql://localhost/test_bdk_wallet
```
4. Run tests, must use a single test thread since we reuse the postgres db:
```
cargo test -- --test-threads=1
```
## Example1. Create empty test database:
```
psql postgres
postgres=# create database example_bdk_wallet;
postgres=# \q
```
2. Set DATABASE_URL to test database:
```
export DATABASE_URL=postgresql://localhost/example_bdk_wallet
```
3. Run example:
```
cargo run --example bdk_sqlx_postgres
```