Closed Ashleyhen closed 1 year ago
In general, we've avoided taking a serde (or any, really) dependency unless we have a good reason to. We could feature-gate it like rust-bitcoin, but first I'm curious what your use case is here - if you're trying to get something that is human-readable, you can use the Debug
impl, if you're trying to access some fields after sending the object over the wire somewhere, why not access those fields natively in Rust and then pass them somewhere?
The OpenChannel
message is kinda a strange one to want to access fields in, though, you should generally just use the LDK creation/sending of that message, I think. Not sure what lnrpcChannelCloseSummary
is, we don't have that struct anywhere.
https://api.lightning.community/#v1-channels Yeah so my use case is I'd like to use that struct to make a rpc call to lnd to make a openChannel request
LDK is not related to LND, and the struct in question in LDK is a network-level message that lightning peers send each other, not a struct to make RPC calls to LND.
But LDK should be able to communicate with a LND node right. I'd assume that's done through some RPC call, right? @TheBlueMatt
LDK is a full lightning node. It does not remote-control some other lightning node (like LND/CLN/etc). It speaks to other lightning nodes using the standard lightning P2P protocol, opening channels directly with the other node.
How is that done? how does it interact with the endpoints?
https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message If LDK doesn't use RPC then how does it send a openchannel message to another node
@TheBlueMatt
It's a different protocol from the LND RPC. See the BOLT doc on the P2P protocol.
I captured some packets between LND and eclair I think they do use RPC @TheBlueMatt
That's your local RPC client. They do not.
It would be nice to easily be able to serialize and deserialize structs to json such as OpenChannel or lnrpcChannelCloseSummary
https://serde.rs/