mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
3babbc5201
This adds the option to explicitly enable ip-discovery, which maybe helpful for example when a user wants TOR announced along with discovered IPs to improve connectivity and have TOR just as a fallback. Changelog-Added: Adds config switch 'announce-addr-discovered': on/off/auto
5.0 KiB
5.0 KiB
1 | #include <common/cryptomsg.h> |
---|---|
2 | #include <common/features.h> |
3 | #include <common/wireaddr.h> |
4 | #include <wire/peer_wire.h> |
5 | #include <wire/onion_wire.h> |
6 | # Initialize the gossip daemon. |
7 | msgtype,gossipd_init,3000 |
8 | msgdata,gossipd_init,chainparams,chainparams, |
9 | msgdata,gossipd_init,our_features,feature_set, |
10 | msgdata,gossipd_init,id,node_id, |
11 | msgdata,gossipd_init,rgb,u8,3 |
12 | msgdata,gossipd_init,alias,u8,32 |
13 | msgdata,gossipd_init,num_announceable,u16, |
14 | msgdata,gossipd_init,announceable,wireaddr,num_announceable |
15 | msgdata,gossipd_init,dev_gossip_time,?u32, |
16 | msgdata,gossipd_init,dev_fast_gossip,bool, |
17 | msgdata,gossipd_init,dev_fast_gossip_prune,bool, |
18 | msgdata,gossipd_init,ip_discovery,u32, |
19 | msgtype,gossipd_init_reply,3100 |
20 | # In developer mode, we can mess with time. |
21 | msgtype,gossipd_dev_set_time,3001 |
22 | msgdata,gossipd_dev_set_time,dev_gossip_time,u32, |
23 | # Set artificial maximum reply_channel_range size. Master->gossipd |
24 | msgtype,gossipd_dev_set_max_scids_encode_size,3030 |
25 | msgdata,gossipd_dev_set_max_scids_encode_size,max,u32, |
26 | # gossipd->master: we're closing this channel. |
27 | msgtype,gossipd_local_channel_close,3027 |
28 | msgdata,gossipd_local_channel_close,short_channel_id,short_channel_id, |
29 | # Gossipd->master get this tx output please. |
30 | msgtype,gossipd_get_txout,3018 |
31 | msgdata,gossipd_get_txout,short_channel_id,short_channel_id, |
32 | # master->gossipd here is the output, or empty if none. |
33 | msgtype,gossipd_get_txout_reply,3118 |
34 | msgdata,gossipd_get_txout_reply,short_channel_id,short_channel_id, |
35 | msgdata,gossipd_get_txout_reply,satoshis,amount_sat, |
36 | msgdata,gossipd_get_txout_reply,len,u16, |
37 | msgdata,gossipd_get_txout_reply,outscript,u8,len |
38 | # master -> gossipd: these potential funding outpoints were spent, please forget any channels |
39 | msgtype,gossipd_outpoints_spent,3024 |
40 | msgdata,gossipd_outpoints_spent,blockheight,u32, |
41 | msgdata,gossipd_outpoints_spent,len,u32, |
42 | msgdata,gossipd_outpoints_spent,short_channel_id,short_channel_id,len |
43 | # master -> gossipd: do you have a memleak? |
44 | msgtype,gossipd_dev_memleak,3033 |
45 | msgtype,gossipd_dev_memleak_reply,3133 |
46 | msgdata,gossipd_dev_memleak_reply,leak,bool, |
47 | # master -> gossipd: please rewrite the gossip_store |
48 | msgtype,gossipd_dev_compact_store,3034 |
49 | # gossipd -> master: ok |
50 | msgtype,gossipd_dev_compact_store_reply,3134 |
51 | msgdata,gossipd_dev_compact_store_reply,success,bool, |
52 | # master -> gossipd: blockheight increased. |
53 | msgtype,gossipd_new_blockheight,3026 |
54 | msgdata,gossipd_new_blockheight,blockheight,u32, |
55 | # gossipd: got it! |
56 | msgtype,gossipd_new_blockheight_reply,3126 |
57 | # Lightningd tells us to inject a gossip message (for addgossip RPC) |
58 | msgtype,gossipd_addgossip,3044 |
59 | msgdata,gossipd_addgossip,len,u16, |
60 | msgdata,gossipd_addgossip,msg,u8,len |
61 | # Empty string means no problem. |
62 | msgtype,gossipd_addgossip_reply,3144 |
63 | msgdata,gossipd_addgossip_reply,err,wirestring, |
64 | # Updated lease rates available |
65 | msgtype,gossipd_new_lease_rates,3046 |
66 | msgdata,gossipd_new_lease_rates,rates,lease_rates, |
67 | # Lightningd asks gossipd for any known addresses for that node. |
68 | msgtype,gossipd_get_addrs,3050 |
69 | msgdata,gossipd_get_addrs,id,node_id, |
70 | msgtype,gossipd_get_addrs_reply,3150 |
71 | msgdata,gossipd_get_addrs_reply,num,u16, |
72 | msgdata,gossipd_get_addrs_reply,addrs,wireaddr,num |
73 | # Tell master a local channel update (so it can serve errors). |
74 | msgtype,gossipd_got_local_channel_update,3151 |
75 | msgdata,gossipd_got_local_channel_update,scid,short_channel_id, |
76 | msgdata,gossipd_got_local_channel_update,len,u16, |
77 | msgdata,gossipd_got_local_channel_update,channel_update,u8,len |
78 | # Send this channel_update. |
79 | msgtype,gossipd_local_channel_update,3004 |
80 | msgdata,gossipd_local_channel_update,id,node_id, |
81 | msgdata,gossipd_local_channel_update,short_channel_id,short_channel_id, |
82 | msgdata,gossipd_local_channel_update,disable,bool, |
83 | msgdata,gossipd_local_channel_update,cltv_expiry_delta,u16, |
84 | msgdata,gossipd_local_channel_update,htlc_minimum_msat,amount_msat, |
85 | msgdata,gossipd_local_channel_update,fee_base_msat,u32, |
86 | msgdata,gossipd_local_channel_update,fee_proportional_millionths,u32, |
87 | msgdata,gossipd_local_channel_update,htlc_maximum_msat,amount_msat, |
88 | msgdata,gossipd_local_channel_update,public,bool, |
89 | # Send this channel_announcement |
90 | msgtype,gossipd_local_channel_announcement,3006 |
91 | msgdata,gossipd_local_channel_announcement,id,node_id, |
92 | msgdata,gossipd_local_channel_announcement,len,u16, |
93 | msgdata,gossipd_local_channel_announcement,cannounce,u8,len |
94 | # Tell gossipd about a private channel (to put it in the store) |
95 | # cannounce has same structure, dummy sigs. |
96 | msgtype,gossipd_local_private_channel,3008 |
97 | msgdata,gossipd_local_private_channel,id,node_id, |
98 | msgdata,gossipd_local_private_channel,capacity,amount_sat, |
99 | msgdata,gossipd_local_private_channel,scid,short_channel_id, |
100 | msgdata,gossipd_local_private_channel,len,u16, |
101 | msgdata,gossipd_local_private_channel,features,u8,len |
102 | # Tell gossipd we used the channel update (in case it was deferred) |
103 | msgtype,gossipd_used_local_channel_update,3052 |
104 | msgdata,gossipd_used_local_channel_update,scid,short_channel_id, |
105 | # Tell gossipd we have verified a new public IP by the remote_addr feature |
106 | msgtype,gossipd_discovered_ip,3009 |
107 | msgdata,gossipd_discovered_ip,discovered_ip,wireaddr, |