| Crates.io | fee_source |
| lib.rs | fee_source |
| version | 1.0.0 |
| created_at | 2025-01-21 09:15:52.281175+00 |
| updated_at | 2025-01-21 09:15:52.281175+00 |
| description | Get bitcoin network fees from mempool instance and convert to formats needed by other services |
| homepage | |
| repository | https://github.com/synonymdev/fee_source |
| max_upload_size | |
| id | 1524669 |
| size | 63,229 |
Bitcoind's fee estimation is not always reliable. This is a small libary that takes data from mempool.space with fallback to bitcoind and exposes it in formats of:
When run as a binary it will fetch data and store it in the given folder. The data is stored in the following formats:
<ENV.FEE_FOLDER_PATH>/esplora.json{
1: 100,
3: 50,
6: 20,
144: 1,
1008: 1,
}
<ENV.FEE_FOLDER_PATH>/lnd.json{
current_block_hash: "0000000000000000000XXXX",
fee_by_block_target: {
1: 102400,
3: 51200,
6: 20480,
144: 1024,
1008: 1024,
},
min_relay_feerate: 1024
}
<ENV.FEE_FOLDER_PATH>/mempool.json{
"fastestFee": 100,
"halfHourFee": 50,
"hourFee": 20,
"economyFee": 1,
"minimumFee": 1,
}
See .env.example for configuration options.
cp .env.example .env
You can expose the fee feeds via nginx by adding the following configuration:
<...>
location /fee/esplora {
alias <ENV.FEE_FOLDER_PATH>/esplora.json;
default_type application/json;
}
location /fee/lnd {
alias <ENV.FEE_FOLDER_PATH>/lnd.json;
default_type application/json;
}
location /fee/mempool {
alias <ENV.FEE_FOLDER_PATH>/mempool.json;
default_type application/json;
}
<...>
cargo run
OpenSSL uses OS dependencies. Older Ubuntu versions (i.e. 20.04) may have older versions of libc=v2.31 thus running standard ubuntu build may fail. To build for Ubuntu 20.04 use musl target:
cargo build --target=x86_64-unknown-linux-musl --release
Cargo.toml versioncargo build --target=x86_64-unknown-linux-musl --release (this will update Cargo.lock)CHANGELOG.md with the given format. Use the commit history on the master to determine the changes.chore: vx.x.x.vx.x.xvx.x.x