mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
ef28b6112c
This change is really to allow us to have a --dev-fail-on-subdaemon-fail option so we can handle failures from subdaemons generically. It also neatens handling so we can have an explicit callback for "peer did something wrong" (which matters if we want to close the channel in that case). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
3.5 KiB
3.5 KiB
1 | # Peers can give a bad message, we close their fd, but no harm done. |
---|---|
2 | gossipstatus_peer_bad_msg,1000 |
3 | gossipstatus_peer_bad_msg,,unique_id,8 |
4 | gossipstatus_peer_bad_msg,,len,2 |
5 | gossipstatus_peer_bad_msg,,err,len*u8 |
6 | # Misc problems like opening control fd. |
7 | gossipstatus_peer_failed,1001 |
8 | gossipstatus_peer_failed,,unique_id,8 |
9 | gossipstatus_peer_failed,,len,2 |
10 | gossipstatus_peer_failed,,err,len*u8 |
11 | #include <common/cryptomsg.h> |
12 | # Initialize the gossip daemon |
13 | gossipctl_init,0 |
14 | gossipctl_init,,broadcast_interval,4 |
15 | gossipctl_init,,chain_hash,struct sha256_double |
16 | # These take an fd, but have no response |
17 | # (if it is to move onto a channel, we get a status msg). |
18 | gossipctl_new_peer,1 |
19 | gossipctl_new_peer,,unique_id,8 |
20 | gossipctl_new_peer,,crypto_state,struct crypto_state |
21 | # Tell it to release a peer which has initialized. |
22 | gossipctl_release_peer,2 |
23 | gossipctl_release_peer,,unique_id,8 |
24 | # This releases the peer and returns the cryptostate (followed two fds: peer and gossip) |
25 | gossipctl_release_peer_reply,102 |
26 | gossipctl_release_peer_reply,,crypto_state,struct crypto_state |
27 | # This is if we couldn't find the peer. |
28 | gossipctl_release_peer_replyfail,202 |
29 | # This is where we save a peer's features. |
30 | #gossipstatus_peer_features,1 |
31 | #gossipstatus_peer_features,,unique_id,8 |
32 | #gossipstatus_peer_features,,gflen,2 |
33 | #gossipstatus_peer_features,,globalfeatures,gflen |
34 | #gossipstatus_peer_features,,lflen,2 |
35 | #gossipstatus_peer_features,,localfeatures,lflen |
36 | # Peer can send non-gossip packet (usually an open_channel) (followed two fds: peer and gossip) |
37 | gossipstatus_peer_nongossip,4 |
38 | gossipstatus_peer_nongossip,,unique_id,8 |
39 | gossipstatus_peer_nongossip,,crypto_state,struct crypto_state |
40 | gossipstatus_peer_nongossip,,len,2 |
41 | gossipstatus_peer_nongossip,,msg,len*u8 |
42 | # Pass JSON-RPC getnodes call through |
43 | gossip_getnodes_request,5 |
44 | #include <lightningd/gossip_msg.h> |
45 | gossip_getnodes_reply,105 |
46 | gossip_getnodes_reply,,num_nodes,u16 |
47 | gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry |
48 | # Pass JSON-RPC getroute call through |
49 | gossip_getroute_request,6 |
50 | gossip_getroute_request,,source,struct pubkey |
51 | gossip_getroute_request,,destination,struct pubkey |
52 | gossip_getroute_request,,msatoshi,u32 |
53 | gossip_getroute_request,,riskfactor,u16 |
54 | gossip_getroute_reply,106 |
55 | gossip_getroute_reply,,num_hops,u16 |
56 | gossip_getroute_reply,,hops,num_hops*struct route_hop |
57 | gossip_getchannels_request,7 |
58 | gossip_getchannels_reply,107 |
59 | gossip_getchannels_reply,,num_channels,u16 |
60 | gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry |
61 | # Ping/pong test. |
62 | gossip_ping,8 |
63 | gossip_ping,,unique_id,u64 |
64 | gossip_ping,,num_pong_bytes,u16 |
65 | gossip_ping,,len,u16 |
66 | gossip_ping_reply,108 |
67 | gossip_ping_reply,,totlen,u16 |
68 | # Given a short_channel_id, return the endpoints |
69 | gossip_resolve_channel_request,9 |
70 | gossip_resolve_channel_request,,channel_id,struct short_channel_id |
71 | gossip_resolve_channel_reply,109 |
72 | gossip_resolve_channel_reply,,num_keys,u16 |
73 | gossip_resolve_channel_reply,,keys,num_keys*struct pubkey |
74 | # The main daemon forward some gossip message to gossipd, allows injecting |
75 | # arbitrary gossip messages. |
76 | gossip_forwarded_msg,10 |
77 | gossip_forwarded_msg,,msglen,2 |
78 | gossip_forwarded_msg,,msg,msglen |
79 | # If peer is still connected, fail it (master does this for reconnect) |
80 | gossipctl_fail_peer,11 |
81 | gossipctl_fail_peer,,unique_id,8 |
82 | # Get a gossip fd for this peer (it has reconnected) |
83 | gossipctl_get_peer_gossipfd,12 |
84 | gossipctl_get_peer_gossipfd,,unique_id,u64 |
85 | # Does it want a full dump of gossip? |
86 | gossipctl_get_peer_gossipfd,,sync,bool |
87 | # + fd. |
88 | gossipctl_get_peer_gossipfd_reply,112 |
89 | # Failure (can't make new socket) |
90 | gossipctl_get_peer_gossipfd_replyfail,212 |