-
Notifications
You must be signed in to change notification settings - Fork 21
Add esplora config #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Thanks for assigning @benthecarman as a reviewer! |
e107189 to
693beec
Compare
ldk-server/src/util/config.rs
Outdated
| #[derive(Debug)] | ||
| pub enum ChainSource { | ||
| Rpc { rpc_address: SocketAddr, rpc_user: String, rpc_password: String }, | ||
| Esplora { server_url: SocketAddr }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think socketaddr works with urls which is what most people will be using with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right it does not, initially had String, went with SocketAddr for consistency with RPC, now switched back to String
ldk-server/src/util/config.rs
Outdated
| rpc_password = "bitcoind-testpassword" | ||
| [esplora] | ||
| server_url = "127.0.0.1:3000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be better to make this and all the other hard coded values to something like mempool space or blockstream, will make this easier for people to understand at a quick glance
ldk-server/src/main.rs
Outdated
| ); | ||
| }, | ||
| ChainSource::Esplora { server_url } => { | ||
| builder.set_chain_source_esplora(format!("http://{}", server_url), None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should make them include the http vs https
693beec to
77f2baa
Compare
benthecarman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise lgtm
ldk-server/src/util/config.rs
Outdated
| SocketAddr::from_str(&toml_config.bitcoind.rpc_address).map_err(|e| { | ||
| io::Error::new( | ||
| let chain_source = match (toml_config.esplora, toml_config.bitcoind) { | ||
| (Some(EsploraConfig { server_url }), _) => ChainSource::Esplora { server_url }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo it'd be better to throw an error if both are set. Setting both options is likely an error and could lead to them using a config they dont expect
ldk-server/ldk-server-config.toml
Outdated
| dir_path = "/tmp/ldk-server/" # Path for LDK and BDK data persistence | ||
|
|
||
|
|
||
| # Must set either the bitcoind or the esplora table; the esplora table is prioritized over the bitcoind table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would need to update this comment too
77f2baa to
d177d06
Compare
sorry pushed some more work and missed your review addressing now |
d177d06 to
cd0b6ea
Compare
No description provided.