Skip to content

Commit ff0ee6d

Browse files
ShahanaFarooquirustyrussell
authored andcommitted
doc: Fix mdx format errors generated due to Readme v2 migrations
Changelog-None: Documentation fixes only.
1 parent edfb64c commit ff0ee6d

15 files changed

Lines changed: 392 additions & 513 deletions

File tree

‎doc/beginners-guide/backup-and-recovery/advanced-db-backup.md‎

Lines changed: 56 additions & 80 deletions
Large diffs are not rendered by default.

‎doc/beginners-guide/beginners-guide.md‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,24 @@ privacy:
1111
#### Regtest (local, fast-start) option
1212

1313
If you want to experiment with `lightningd`, there's a script to set up a `bitcoind` regtest test network of two local lightning nodes, which provides a convenient `start_ln` helper. See the notes at the top of the `startup_regtest.sh` file for details on how to use it.
14-
1514
```bash
1615
. contrib/startup_regtest.sh
1716
```
1817

1918
#### Mainnet Option
2019

21-
To test with real bitcoin, you will need to have a local `bitcoind` node running:
22-
20+
To test with real bitcoin, you will need to have a local `bitcoind` node running:
2321
```bash
2422
bitcoind -daemon
2523
```
2624

2725
Wait until `bitcoind` has synchronized with the network.
2826

29-
Make sure that you do not have `walletbroadcast=0` in your `~/.bitcoin/bitcoin.conf`, or you may run into trouble.
30-
Notice that running `lightningd` against a pruned node may cause some issues if not managed carefully, see [pruning](doc:bitcoin-core##using-a-pruned-bitcoin-core-node) for more information.
27+
Make sure that you do not have `walletbroadcast=0` in your `~/.bitcoin/bitcoin.conf`, or you may run into trouble.
3128

32-
You can start `lightningd` with the following command:
29+
Notice that running `lightningd` against a pruned node may cause some issues if not managed carefully, see [pruning](doc:bitcoin-core#using-a-pruned-bitcoin-core-node) for more information.
3330

31+
You can start `lightningd` with the following command:
3432
```bash
3533
lightningd --network=bitcoin --log-level=debug
3634
```
@@ -57,6 +55,6 @@ Useful commands:
5755

5856
Once you've started for the first time, there's a script called `contrib/bootstrap-node.sh` which will connect you to other nodes on the lightning network.
5957

60-
There are also numerous plugins available for Core Lightning which add capabilities: see the [Plugins](doc:plugins) guide, and check out the plugin collection at: <https://github.com/lightningd/plugins>.
58+
There are also numerous plugins available for Core Lightning which add capabilities: see the [Plugins](doc:plugins) guide, and check out the plugin collection at: https://github.com/lightningd/plugins.
6159

6260
For a less reckless experience, you can encrypt the HD wallet seed: see [HD wallet encryption](doc:backup-and-recovery#hsm-secret-backup).

‎doc/contribute-to-core-lightning/code-generation.md‎

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The CLN project has a multitude of interfaces, most of which are generated from
1212
1. addition of FD passing semantics to allow establishing a new connection between daemons (communication uses [socketpair](https://man7.org/linux/man-pages/man2/socketpair.2.html), so no `connect`)
1313
2. change the message length prefix from `u16` to `u32`, allowing for messages larger than 65Kb. The CSV files are with the respective sub-daemon and also use [generate-wire.py](https://github.com/ElementsProject/lightning/blob/master/tools/generate-wire.py) to generate encoding, decoding and printing functions
1414

15-
- We describe the JSON-RPC using [JSON Schema](https://json-schema.org/) in the [`doc/schemas`](https://github.com/ElementsProject/lightning/tree/master/doc/schemas) directory. Each method has a `lightning-*.json` for request and response. During tests the `pytest` target will verify responses, however the JSON-RPC methods are _not_ generated (yet?). We do generate various client stubs for languages, using the `msggen`[msggen] tool. More on the generated stubs and utilities below.
15+
- We describe the JSON-RPC using [JSON Schema](https://json-schema.org/) in the [`doc/schemas`](https://github.com/ElementsProject/lightning/tree/master/doc/schemas) directory. Each method has a `lightning-*.json` for request and response. During tests the `pytest` target will verify responses, however the JSON-RPC methods are _not_ generated (yet?). We do generate various client stubs for languages, using the `msggen` tool. More on the generated stubs and utilities below.
1616

1717
## Man pages
1818

@@ -26,21 +26,9 @@ The manpages are generated from the JSON schemas using the [`fromschema`](https:
2626

2727
`msggen` is used to generate JSON-RPC client stubs, and converters between in-memory formats and the JSON format. In addition, by chaining some of these we can expose a [grpc](https://grpc.io/) interface that matches the JSON-RPC interface. This conversion chain is implemented in the [grpc-plugin](https://github.com/ElementsProject/lightning/tree/master/plugins/grpc-plugin).
2828

29-
[block:image]
30-
{
31-
"images": [
32-
{
33-
"image": [
34-
"https://files.readme.io/8777cc4-image.png",
35-
null,
36-
null
37-
],
38-
"align": "center",
39-
"caption": "Artifacts generated from the JSON Schemas using `msggen`"
40-
}
41-
]
42-
}
43-
[/block]
29+
![Artifacts generated from the JSON Schemas using `msggen`](https://files.readme.io/8777cc4-image.png)
30+
31+
*Artifacts generated from the JSON Schemas using `msggen`*
4432

4533
### `cln-rpc`
4634

@@ -58,4 +46,4 @@ The `cln-grpc` crate is mostly used to provide the primitives to build the `grpc
5846
- Next it generates the `convert.rs` file which is used to convert the structs for in-memory representation from `cln-rpc` into the corresponding protobuf structs.
5947
- Finally `msggen` generates the `server.rs` file which can be bound to a grpc endpoint listening for incoming grpc requests, and it will convert the request and forward it to the JSON-RPC. Upon receiving the response it gets converted back into a grpc response and sent back.
6048

61-
![](https://files.readme.io/53b4645-image.png)
49+
![Conversion chain for grpc functionality](https://files.readme.io/53b4645-image.png)

‎doc/contribute-to-core-lightning/contribute-to-core-lightning.md‎

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ To read the code, you should start from [lightningd.c](https://github.com/Elemen
1414

1515
Here's a list of parts, with notes:
1616

17-
- ccan - useful routines from <http://ccodearchive.net>
17+
- ccan - useful routines from http://ccodearchive.net
1818
- Use make update-ccan to update it.
1919
- Use make update-ccan CCAN_NEW="mod1 mod2..." to add modules
20-
- Do not edit this! If you want a wrapper, add one to common/utils.h.
20+
- Do not edit this! If you want a wrapper, add one to common/utils.h.
2121

2222
- bitcoin/ - bitcoin script, signature and transaction routines.
2323
- Not a complete set, but enough for our purposes.
@@ -69,18 +69,15 @@ Here's a list of parts, with notes:
6969

7070
## Database
7171

72-
Core Lightning state is persisted in `lightning-dir`. It is a sqlite database stored in the `lightningd.sqlite3` file, typically under `~/.lightning/<network>/`.
73-
You can run queries against this file like so:
72+
Core Lightning state is persisted in `lightning-dir`. It is a sqlite database stored in the `lightningd.sqlite3` file, typically under `~/.lightning/<network>/`.
7473

74+
You can run queries against this file like so:
7575
```shell
7676
$ sqlite3 ~/.lightning/bitcoin/lightningd.sqlite3 \
7777
"SELECT HEX(prev_out_tx), prev_out_index, status FROM outputs"
7878
```
7979

80-
81-
8280
Or you can launch into the sqlite3 repl and check things out from there:
83-
8481
```shell
8582
$ sqlite3 ~/.lightning/bitcoin/lightningd.sqlite3
8683
SQLite version 3.21.0 2017-10-24 18:55:49
@@ -93,16 +90,13 @@ sqlite> .schema outputs
9390
...
9491
```
9592

96-
97-
9893
Some data is stored as raw bytes, use `HEX(column)` to pretty print these.
9994

10095
Make sure that clightning is not running when you query the database, as some queries may lock the database and cause crashes.
10196

10297
#### Common variables
10398

10499
Table `vars` contains global variables used by lightning node.
105-
106100
```shell
107101
$ sqlite3 ~/.lightning/bitcoin/lightningd.sqlite3
108102
SQLite version 3.21.0 2017-10-24 18:55:49
@@ -115,55 +109,43 @@ bip32_max_index|4
115109
...
116110
```
117111
118-
119-
120112
Variables:
121113
122114
- `next_pay_index` next resolved invoice counter that will get assigned.
123115
- `bip32_max_index` last wallet derivation counter.
124116
125-
Note: Each time `newaddr` command is called, `bip32_max_index` counter is increased to the last derivation index. Each address generated after `bip32_max_index` is not included as
126-
lightning funds.
117+
Note: Each time `newaddr` command is called, `bip32_max_index` counter is increased to the last derivation index. Each address generated after `bip32_max_index` is not included as lightning funds.
127118
128119
# gossip_store: Direct Access To Lightning Gossip
129120
130-
The `lightning_gossipd` daemon stores the gossip messages, along with some internal data, in a file called the "gossip_store". Various plugins and daemons access this (in a read-only manner), and the format is documented here.
121+
The `lightning_gossipd` daemon stores the gossip messages, along with some internal data, in a file called the "gossip_store". Various plugins and daemons access this (in a read-only manner), and the format is documented here.
131122
132123
## The File Header
133-
134124
```
135125
u8 version;
136126
```
137127
138-
139-
140-
The gossmap header consists of one byte. The top 3 bits are the major version: if these are not all zero, you need to re-read this (updated) document to see what changed. The lower 5 bits are the minor version, which won't worry you: currently they will be 11.
128+
The gossmap header consists of one byte. The top 3 bits are the major version: if these are not all zero, you need to re-read this (updated) document to see what changed. The lower 5 bits are the minor version, which won't worry you: currently they will be 11.
141129
142130
After the file header comes a number of records.
143131
144132
## The Record Header
145-
146133
```
147134
be16 flags;
148135
be16 len;
149136
be32 crc;
150137
be32 timestamp;
151138
```
152139
153-
154-
155-
Each record consists of a header and a message. The header is big-endian, containing flags, the length (of the following body), the crc32c (of the following message, starting with the timestamp field in the header) and a timestamp extracted from certain messages (zero where not relevant, but ignore it in those cases).
140+
Each record consists of a header and a message. The header is big-endian, containing flags, the length (of the following body), the crc32c (of the following message, starting with the timestamp field in the header) and a timestamp extracted from certain messages (zero where not relevant, but ignore it in those cases).
156141
157142
The flags currently defined are:
158-
159143
```
160144
#define DELETED 0x8000
161145
#define PUSH 0x4000
162146
#define DYING 0x0800
163147
```
164148
165-
166-
167149
Deleted fields should be ignored: on restart, they will be removed as the gossip_store is rewritten.
168150
169151
The push flag indicates gossip which is generated locally: this is important for gossip timestamp filtering, where peers request gossip and we always send our own gossip messages even if the timestamp wasn't within their request.
@@ -174,15 +156,15 @@ Other flags should be ignored.
174156
175157
## The Message
176158
177-
Each messages consists of a 16-bit big-endian "type" field (for efficiency, an implementation may read this along with the header), and optional data. Some messages are defined by the BOLT 7 gossip protocol, others are for internal use. Unknown message types should be skipped over.
159+
Each messages consists of a 16-bit big-endian "type" field (for efficiency, an implementation may read this along with the header), and optional data. Some messages are defined by the BOLT 7 gossip protocol, others are for internal use. Unknown message types should be skipped over.
178160
179161
### BOLT 7 Messages
180162
181163
These are the messages which gossipd has validated, and ensured are in order.
182164
183-
- `channel_announcement` (256): a complete, validated channel announcement. This will always come before any `channel_update` which refers to it, or `node_announcement` which refers to a node.
184-
- `channel_update` (258): a complete, validated channel update. Note that you can see multiple of these (old ones will be deleted as they are replaced though).
185-
- `node_announcement` (257): a complete, validated node announcement. Note that you can also see multiple of these (old ones will be deleted as they are replaced).
165+
- `channel_announcement` (256): a complete, validated channel announcement. This will always come before any `channel_update` which refers to it, or `node_announcement` which refers to a node.
166+
- `channel_update` (258): a complete, validated channel update. Note that you can see multiple of these (old ones will be deleted as they are replaced though).
167+
- `node_announcement` (257): a complete, validated node announcement. Note that you can also see multiple of these (old ones will be deleted as they are replaced).
186168
187169
### Internal Gossip Daemon Messages
188170
@@ -209,26 +191,26 @@ This contains a private `channel_update` (i.e. for a channel described by `gossi
209191
- `gossip_store_delete_chan` (4103)
210192
- `scid`: u64
211193
212-
This is added when a channel is deleted. You won't often see this if you're reading the file once (as the channel record header will have been marked `deleted` first), but useful if you are polling the file for updates.
194+
This is added when a channel is deleted. You won't often see this if you're reading the file once (as the channel record header will have been marked `deleted` first), but useful if you are polling the file for updates.
213195
214196
- `gossip_store_ended` (4105)
215197
- `equivalent_offset`: u64
216198
217-
This is only ever added as the final entry in the gossip_store. It means the file has been deleted (usually because lightningd has been restarted), and you should re-open it. As an optimization, the `equivalent_offset` in the new file reflects the point at which the new gossip_store is equivalent to this one (with deleted records removed). However, if lightningd has been restarted multiple times it is possible that this offset is not valid, so it's really only useful if you're actively monitoring the file.
199+
This is only ever added as the final entry in the gossip_store. It means the file has been deleted (usually because lightningd has been restarted), and you should re-open it. As an optimization, the `equivalent_offset` in the new file reflects the point at which the new gossip_store is equivalent to this one (with deleted records removed). However, if lightningd has been restarted multiple times it is possible that this offset is not valid, so it's really only useful if you're actively monitoring the file.
218200
219201
- `gossip_store_chan_dying` (4106)
220202
- `scid`: u64
221203
- `blockheight`: u32
222204
223-
This is placed in the gossip_store file when a funding transaction is spent. `blockheight` is set to 12 blocks beyond the block containing the spend: at this point, gossipd will delete the channel.
205+
This is placed in the gossip_store file when a funding transaction is spent. `blockheight` is set to 12 blocks beyond the block containing the spend: at this point, gossipd will delete the channel.
224206
225207
## Using the Gossip Store File
226208
227-
- Always check the major version number! We will increment it if the format changes in a way that breaks readers.
209+
- Always check the major version number! We will increment it if the format changes in a way that breaks readers.
228210
- Ignore unknown flags in the header.
229211
- Ignore message types you don't know.
230212
- You don't need to check the messages, as they have been validated.
231-
- It is possible to see a partially-written record at the end. Ignore it.
213+
- It is possible to see a partially-written record at the end. Ignore it.
232214
233215
If you are keeping the file open to watch for changes:
234216

0 commit comments

Comments
 (0)