Skip to content

Commit 8bc845d

Browse files
committed
lightningd: inline overview documentation (part 1 of 8).
Signed-off-by: Rusty Russell <[email protected]>
1 parent 168bec0 commit 8bc845d

File tree

2 files changed

+298
-58
lines changed

2 files changed

+298
-58
lines changed

doc/HACKING.md

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,10 @@ Getting Started
1414
It's in C, to encourage alternate implementations. Patches are welcome!
1515
You should read our [Style Guide](STYLE.md).
1616

17-
To read the code, you'll probably need to understand `ccan/tal`: it's a
18-
hierarchical memory allocator, where each allocation has a parent, and
19-
thus lifetimes are grouped. eg. a `struct bitcoin_tx` has a pointer
20-
to an array of `struct bitcoin_tx_input`; they are allocated off the
21-
`struct bitcoind_tx`, so freeing the `struct bitcoind_tx` frees them all.
22-
Tal also supports destructors, which are usually used to remove things
23-
from lists, etc.
24-
25-
Some routines use take(): take() marks a pointer as to be consumed
26-
(e.g. freed automatically before return) by a called function.
27-
It can safely accept NULL pointers.
28-
Functions whose prototype in headers has the macro TAKES can have the
29-
specific argument as a take() call.
30-
Use this sparingly, as it can be very confusing.
31-
32-
The more complex daemons use async io (ccan/io): you register callbacks
33-
and they happen once I/O is available, then you return what to do next.
34-
This does not use threads, so the code flow is generally fairly simple.
17+
To read the code, you should start from
18+
[lightningd.c](../lightningd/lightningd.c) and hop your way through
19+
the '~' comments at the head of each daemon in the suggested
20+
order.
3521

3622
The Components
3723
--------------
@@ -61,8 +47,13 @@ Here's a list of parts, with notes:
6147
- mockup.sh / update-mocks.sh: tools to generate mock functions for
6248
unit tests.
6349

50+
* tests/ - blackbox tests (mainly)
51+
- unit tests are in tests/ subdirectories in each other directory.
52+
53+
* doc/ - you are here
54+
6455
* devtools/ - tools for developers
65-
- Currently just bolt11-cli for decoding bolt11
56+
- Generally for decoding our formats.
6657

6758
* contrib/ - python support and other stuff which doesn't belong :)
6859

@@ -80,10 +71,12 @@ Here's a list of parts, with notes:
8071
* hsmd/ - daemon which looks after the cryptographic secret, and performs
8172
commitment signing.
8273

83-
* gossipd/ - daemon to chat to peers which don't have any channels,
84-
and maintains routing information and broadcasts gossip.
74+
* gossipd/ - daemon to maintain routing information and broadcast gossip.
75+
76+
* connectd/ - daemon to connect to other peers, and receive incoming.
8577

86-
* openingd/ - daemon to open a channel for a single peer.
78+
* openingd/ - daemon to open a channel for a single peer, and chat to
79+
a peer which doesn't have any channels/
8780

8881
* channeld/ - daemon to operate a single peer once channel is operating
8982
normally.

0 commit comments

Comments
 (0)