mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-09 23:27:17 +01:00
daf8866eb5
Rather a big commit, but I couldn't figure out how to split it nicely. It introduces a new message from the channel to the master signaling that the channel has been announced, so that the master can take care of announcing the node itself. A provisorial announcement is created and passed to the HSM, which signs it and passes it back to the master. Finally the master injects it into gossipd which will take care of broadcasting it.
3.4 KiB
3.4 KiB
1 | # These are fatal. |
---|---|
2 | gossipstatus_init_failed,0x8000 |
3 | gossipstatus_bad_new_peer_request,0x8001 |
4 | gossipstatus_bad_release_request,0x8002 |
5 | gossipstatus_bad_request,0x8003 |
6 | gossipstatus_fdpass_failed,0x8004 |
7 | # Peers can give a bad message, we close their fd, but no harm done. |
8 | gossipstatus_peer_bad_msg,1000 |
9 | gossipstatus_peer_bad_msg,0,unique_id,8 |
10 | gossipstatus_peer_bad_msg,8,len,2 |
11 | gossipstatus_peer_bad_msg,10,err,len*u8 |
12 | # Misc problems like opening control fd. |
13 | gossipstatus_peer_failed,1001 |
14 | gossipstatus_peer_failed,0,unique_id,8 |
15 | gossipstatus_peer_failed,8,len,2 |
16 | gossipstatus_peer_failed,10,err,len*u8 |
17 | #include <lightningd/cryptomsg.h> |
18 | # Initialize the gossip daemon |
19 | gossipctl_init,0 |
20 | gossipctl_init,0,broadcast_interval,4 |
21 | # These take an fd, but have no response |
22 | # (if it is to move onto a channel, we get a status msg). |
23 | gossipctl_new_peer,1 |
24 | gossipctl_new_peer,0,unique_id,8 |
25 | gossipctl_new_peer,8,crypto_state,struct crypto_state |
26 | # Tell it to release a peer which has initialized. |
27 | gossipctl_release_peer,2 |
28 | gossipctl_release_peer,0,unique_id,8 |
29 | # This releases the peer and returns the cryptostate (followed two fds: peer and gossip) |
30 | gossipctl_release_peer_reply,102 |
31 | gossipctl_release_peer_reply,0,unique_id,8 |
32 | gossipctl_release_peer_reply,8,crypto_state,struct crypto_state |
33 | # This is where we save a peer's features. |
34 | #gossipstatus_peer_features,1 |
35 | #gossipstatus_peer_features,0,unique_id,8 |
36 | #gossipstatus_peer_features,8,gflen,2 |
37 | #gossipstatus_peer_features,10,globalfeatures,gflen |
38 | #gossipstatus_peer_features,10+gflen,lflen,2 |
39 | #gossipstatus_peer_features,12+gflen,localfeatures,lflen |
40 | # Peer init handshake complete (now you can release_peer if you want) |
41 | gossipstatus_peer_ready,3 |
42 | gossipstatus_peer_ready,0,unique_id,8 |
43 | # Peer can send non-gossip packet (usually an open_channel) (followed two fds: peer and gossip) |
44 | gossipstatus_peer_nongossip,4 |
45 | gossipstatus_peer_nongossip,0,unique_id,8 |
46 | gossipstatus_peer_nongossip,10,crypto_state,struct crypto_state |
47 | gossipstatus_peer_nongossip,154,len,2 |
48 | gossipstatus_peer_nongossip,156,msg,len*u8 |
49 | # Pass JSON-RPC getnodes call through |
50 | gossip_getnodes_request,5 |
51 | #include <lightningd/gossip_msg.h> |
52 | gossip_getnodes_reply,105 |
53 | gossip_getnodes_reply,0,num_nodes,u16 |
54 | gossip_getnodes_reply,2,nodes,num_nodes*struct gossip_getnodes_entry |
55 | # Pass JSON-RPC getroute call through |
56 | gossip_getroute_request,6 |
57 | gossip_getroute_request,0,source,struct pubkey |
58 | gossip_getroute_request,33,destination,struct pubkey |
59 | gossip_getroute_request,66,msatoshi,u32 |
60 | gossip_getroute_request,70,riskfactor,u16 |
61 | gossip_getroute_reply,106 |
62 | gossip_getroute_reply,0,num_hops,u16 |
63 | gossip_getroute_reply,2,hops,num_hops*struct route_hop |
64 | gossip_getchannels_request,7 |
65 | gossip_getchannels_reply,107 |
66 | gossip_getchannels_reply,0,num_channels,u16 |
67 | gossip_getchannels_reply,2,nodes,num_channels*struct gossip_getchannels_entry |
68 | # Ping/pong test. |
69 | gossip_ping,8 |
70 | gossip_ping,0,unique_id,u64 |
71 | gossip_ping,0,num_pong_bytes,u16 |
72 | gossip_ping,0,len,u16 |
73 | gossip_ping_reply,108 |
74 | gossip_ping_reply,0,totlen,u16 |
75 | # Given a short_channel_id, return the endpoints |
76 | gossip_resolve_channel_request,9 |
77 | gossip_resolve_channel_request,0,channel_id,struct short_channel_id |
78 | gossip_resolve_channel_reply,109 |
79 | gossip_resolve_channel_reply,0,num_keys,u16 |
80 | gossip_resolve_channel_reply,0,keys,num_keys*struct pubkey |
81 | # The main daemon forward some gossip message to gossipd, allows injecting |
82 | # arbitrary gossip messages. |
83 | gossip_forwarded_msg,10 |
84 | gossip_forwarded_msg,0,msglen,2 |
85 | gossip_forwarded_msg,2,msg,msglen |