Skip to content

[r2r] Lightning docs #31

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

Merged
merged 76 commits into from
May 29, 2023
Merged

[r2r] Lightning docs #31

merged 76 commits into from
May 29, 2023

Conversation

smk762
Copy link
Contributor

@smk762 smk762 commented May 10, 2023

Closes #17

  • Activation
  • Payments
  • Nodes
  • Channels

@smk762 smk762 marked this pull request as draft May 10, 2023 13:15
Copy link

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments for the more info needed for DevComment

@smk762 smk762 requested a review from shamardy May 25, 2023 09:03
Copy link

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for bearing with me in this very long review :)

I guess these are the last review comments since I checked all the remaining methods (rest of channels, nodes and payments) and objects. I will probably do a last check of everything after the below comments are resolved.
If I missed any placeholders that you wanted me to provide info about, please point me to them and I will check them.

Comment on lines +321 to +338
"status": "Open",
"details": {
"uuid": "2b50e274-c173-4fa1-95f3-97f9f82ace92",
"channel_id": "4a869115dfd260d0925a1266f544a6ab36666448d4bbc0e2a028d8426b2b6d4e",
"counterparty_node_id": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9",
"funding_tx": "4e6d2b6b42d828a0e2c0bbd448646636aba644f566125a92d060d2df1591864a",
"funding_tx_output_index": 0,
"funding_tx_value_sats": 959722,
"is_outbound": true,
"balance_msat": 959722000,
"outbound_capacity_msat": 950125000,
"inbound_capacity_msat": 0,
"current_confirmations": 0,
"required_confirmations": 3,
"is_ready": false,
"is_usable": false,
"is_public": false
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if "status": "Closed" the details fields will differ, you can add a closed channel details response example too if you think it's a good idea. The fields inside details will be

{
  "uuid": "<Uuid>",
  "channel_id": "<String>",
  "counterparty_node_id": "<String>",
  "funding_tx": "<String or null>",
  "funding_value": "<Number or null>",
  "closing_tx": "<String or null>",
  "closure_reason": "<String or null>",
  "claiming_tx": "<String or null>",
  "claimed_balance": "<Number or null>",
  "funding_generated_in_block": "<Number or null>",
  "is_outbound": <true or false>,
  "is_public": <true or false>,
  "is_closed": <true or false>,
  "created_at": <Number>,
  "closed_at": "<Number or null>"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original response has funding_tx_value_sats but your comment has funding_value. Has this key been updated or does it vary depending on the status?

Copy link

@shamardy shamardy May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For open channels the funding value is shown in sats since it's can be used on layer 2 only after the transaction is broadcasted and the channel is usable, sats is a good denomination for the funding value in this context, that's why decided to use funding_tx_value_sats.

For closed channels, the unspent funds is back on chain and it's good to show this in BTC along other balances such as claimed_balance to compare it and to know how much of the funds was used in layer 2, that's why I used funding_value, please note that I used value keyword not balance since this is the value that the channel was opened with and not what the user gets back on chain which is claimed_balance.

I missed this conversion in the code btw, both funding_value and claimed_balance are currently shown in sats, so I should fix this bug too, this documentation review turned out to be a good lightning bug hunting sprint :)

@smk762 smk762 requested a review from shamardy May 26, 2023 09:01
@smk762
Copy link
Contributor Author

smk762 commented May 26, 2023

@shamardy I noticed that these docs lack tables for response param descriptions which ideally should be available.
Due to the size of this PR, I suggest that those tables are added in a subsequent PR.

Copy link

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for documenting this undocumentable feature 🚀

@gcharang gcharang merged commit c457c3b into dev May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new docs P1 Important task which needs to be completed soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToDo: Lightning Docs
3 participants