mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-26 18:34:39 +01:00
10 KiB
10 KiB
| 1 | #include <common/cryptomsg.h> |
|---|---|
| 2 | #include <common/wireaddr.h> |
| 3 | #include <wire/gen_onion_wire.h> |
| 4 | # Initialize the gossip daemon. |
| 5 | gossipctl_init,3000 |
| 6 | gossipctl_init,,broadcast_interval,u32 |
| 7 | gossipctl_init,,chain_hash,struct bitcoin_blkid |
| 8 | gossipctl_init,,id,struct pubkey |
| 9 | gossipctl_init,,gflen,u16 |
| 10 | gossipctl_init,,gfeatures,gflen*u8 |
| 11 | gossipctl_init,,lflen,u16 |
| 12 | gossipctl_init,,lfeatures,lflen*u8 |
| 13 | gossipctl_init,,num_wireaddrs,u16 |
| 14 | gossipctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal |
| 15 | gossipctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce |
| 16 | gossipctl_init,,rgb,3*u8 |
| 17 | gossipctl_init,,alias,32*u8 |
| 18 | gossipctl_init,,update_channel_interval,u32 |
| 19 | gossipctl_init,,reconnect,bool |
| 20 | # This is 0 or 1. |
| 21 | gossipctl_init,,num_tor_proxyaddrs,u16 |
| 22 | gossipctl_init,,tor_proxyaddr,num_tor_proxyaddrs*struct wireaddr |
| 23 | gossipctl_init,,use_tor_proxy_always,bool |
| 24 | gossipctl_init,,dev_allow_localhost,bool |
| 25 | gossipctl_init,,use_dns,bool |
| 26 | gossipctl_init,,tor_password,wirestring |
| 27 | # Activate the gossip daemon, so others can connect. |
| 28 | gossipctl_activate,3025 |
| 29 | # Do we listen? |
| 30 | gossipctl_activate,,listen,bool |
| 31 | # Gossipd->master, I am ready, here's the addresses I bound, can announce. |
| 32 | gossipctl_activate_reply,3125 |
| 33 | gossipctl_activate_reply,,num_bindings,u16 |
| 34 | gossipctl_activate_reply,,bindings,num_bindings*struct wireaddr_internal |
| 35 | gossipctl_activate_reply,,num_announcable,u16 |
| 36 | gossipctl_activate_reply,,announcable,num_announcable*struct wireaddr |
| 37 | # Master -> gossipd: Optional hint for where to find peer. |
| 38 | gossipctl_peer_addrhint,3014 |
| 39 | gossipctl_peer_addrhint,,id,struct pubkey |
| 40 | gossipctl_peer_addrhint,,addr,struct wireaddr_internal |
| 41 | # Master -> gossipd: connect to a peer. |
| 42 | gossipctl_connect_to_peer,3001 |
| 43 | gossipctl_connect_to_peer,,id,struct pubkey |
| 44 | # Gossipd->master: result (not a reply since it can be out-of-order, but |
| 45 | # you will get one reply for every request). |
| 46 | gossipctl_connect_to_peer_result,3020 |
| 47 | gossipctl_connect_to_peer_result,,id,struct pubkey |
| 48 | # True it connected. |
| 49 | gossipctl_connect_to_peer_result,,connected,bool |
| 50 | # Otherwise, why we can't reach them. |
| 51 | gossipctl_connect_to_peer_result,,failreason,wirestring |
| 52 | # Master -> gossipd: try to always maintain connection to this peer (or not) |
| 53 | gossipctl_peer_important,3010 |
| 54 | gossipctl_peer_important,,id,struct pubkey |
| 55 | gossipctl_peer_important,,important,bool |
| 56 | # Gossipd -> master: we got a peer. Two fds: peer and gossip |
| 57 | gossip_peer_connected,3002 |
| 58 | gossip_peer_connected,,id,struct pubkey |
| 59 | gossip_peer_connected,,addr,struct wireaddr_internal |
| 60 | gossip_peer_connected,,crypto_state,struct crypto_state |
| 61 | gossip_peer_connected,,gflen,u16 |
| 62 | gossip_peer_connected,,gfeatures,gflen*u8 |
| 63 | gossip_peer_connected,,lflen,u16 |
| 64 | gossip_peer_connected,,lfeatures,lflen*u8 |
| 65 | # Gossipd -> master: peer sent non-gossip packet. Two fds: peer and gossip |
| 66 | gossip_peer_nongossip,3003 |
| 67 | gossip_peer_nongossip,,id,struct pubkey |
| 68 | gossip_peer_nongossip,,addr,struct wireaddr_internal |
| 69 | gossip_peer_nongossip,,crypto_state,struct crypto_state |
| 70 | gossip_peer_nongossip,,gflen,u16 |
| 71 | gossip_peer_nongossip,,gfeatures,gflen*u8 |
| 72 | gossip_peer_nongossip,,lflen,u16 |
| 73 | gossip_peer_nongossip,,lfeatures,lflen*u8 |
| 74 | gossip_peer_nongossip,,len,u16 |
| 75 | gossip_peer_nongossip,,msg,len*u8 |
| 76 | # Master -> gossipd: release a peer (so we can open a channel) |
| 77 | gossipctl_release_peer,3004 |
| 78 | gossipctl_release_peer,,id,struct pubkey |
| 79 | # Gossipd -> master: reply to gossip_release_peer. Two fds: peer and gossip. |
| 80 | gossipctl_release_peer_reply,3104 |
| 81 | gossipctl_release_peer_reply,,addr,struct wireaddr_internal |
| 82 | gossipctl_release_peer_reply,,crypto_state,struct crypto_state |
| 83 | gossipctl_release_peer_reply,,gflen,u16 |
| 84 | gossipctl_release_peer_reply,,gfeatures,gflen*u8 |
| 85 | gossipctl_release_peer_reply,,lflen,u16 |
| 86 | gossipctl_release_peer_reply,,lfeatures,lflen*u8 |
| 87 | # Gossipd -> master: reply to gossip_release_peer if we couldn't find the peer. |
| 88 | gossipctl_release_peer_replyfail,3204 |
| 89 | # master -> gossipd: take back peer, with optional msg. (+peer fd, +gossip fd) |
| 90 | gossipctl_hand_back_peer,3013 |
| 91 | gossipctl_hand_back_peer,,id,struct pubkey |
| 92 | gossipctl_hand_back_peer,,crypto_state,struct crypto_state |
| 93 | gossipctl_hand_back_peer,,len,u16 |
| 94 | gossipctl_hand_back_peer,,msg,len*u8 |
| 95 | # master -> gossipd: peer has disconnected. |
| 96 | gossipctl_peer_disconnected,3015 |
| 97 | gossipctl_peer_disconnected,,id,struct pubkey |
| 98 | # Pass JSON-RPC getnodes call through |
| 99 | gossip_getnodes_request,3005 |
| 100 | # Can be 0 or 1 currently |
| 101 | gossip_getnodes_request,,num,u16 |
| 102 | gossip_getnodes_request,,id,num*struct pubkey |
| 103 | #include <lightningd/gossip_msg.h> |
| 104 | gossip_getnodes_reply,3105 |
| 105 | gossip_getnodes_reply,,num_nodes,u16 |
| 106 | gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry |
| 107 | # Pass JSON-RPC getroute call through |
| 108 | gossip_getroute_request,3006 |
| 109 | gossip_getroute_request,,source,struct pubkey |
| 110 | gossip_getroute_request,,destination,struct pubkey |
| 111 | gossip_getroute_request,,msatoshi,u64 |
| 112 | gossip_getroute_request,,riskfactor,u16 |
| 113 | gossip_getroute_request,,final_cltv,u32 |
| 114 | gossip_getroute_request,,fuzz,double |
| 115 | gossip_getroute_request,,seed,struct siphash_seed |
| 116 | gossip_getroute_reply,3106 |
| 117 | gossip_getroute_reply,,num_hops,u16 |
| 118 | gossip_getroute_reply,,hops,num_hops*struct route_hop |
| 119 | gossip_getchannels_request,3007 |
| 120 | # In practice, 0 or 1. |
| 121 | gossip_getchannels_request,,num,u16 |
| 122 | gossip_getchannels_request,,short_channel_id,num*struct short_channel_id |
| 123 | gossip_getchannels_reply,3107 |
| 124 | gossip_getchannels_reply,,num_channels,u16 |
| 125 | gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry |
| 126 | # Ping/pong test. Waits for a reply if it expects one. |
| 127 | gossip_ping,3008 |
| 128 | gossip_ping,,id,struct pubkey |
| 129 | gossip_ping,,num_pong_bytes,u16 |
| 130 | gossip_ping,,len,u16 |
| 131 | gossip_ping_reply,3108 |
| 132 | # False if id in gossip_ping was unknown. |
| 133 | gossip_ping_reply,,sent,bool |
| 134 | # 0 == no pong expected |
| 135 | gossip_ping_reply,,totlen,u16 |
| 136 | # Test of query_short_channel_ids. Master->gossipd |
| 137 | gossip_query_scids,3031 |
| 138 | gossip_query_scids,,id,struct pubkey |
| 139 | gossip_query_scids,,num_ids,u16 |
| 140 | gossip_query_scids,,ids,num_ids*struct short_channel_id |
| 141 | # Gossipd -> master |
| 142 | gossip_scids_reply,3131 |
| 143 | gossip_scids_reply,,ok,bool |
| 144 | gossip_scids_reply,,complete,bool |
| 145 | # Test gossip timestamp filtering. |
| 146 | gossip_send_timestamp_filter,3028 |
| 147 | gossip_send_timestamp_filter,,id,struct pubkey |
| 148 | gossip_send_timestamp_filter,,first_timestamp,u32 |
| 149 | gossip_send_timestamp_filter,,timestamp_range,u32 |
| 150 | # Test of query_channel_range. Master->gossipd |
| 151 | gossip_query_channel_range,3029 |
| 152 | gossip_query_channel_range,,id,struct pubkey |
| 153 | gossip_query_channel_range,,first_blocknum,u32 |
| 154 | gossip_query_channel_range,,number_of_blocks,u32 |
| 155 | # Gossipd -> master |
| 156 | gossip_query_channel_range_reply,3129 |
| 157 | gossip_query_channel_range_reply,,final_first_block,u32 |
| 158 | gossip_query_channel_range_reply,,final_num_blocks,u32 |
| 159 | gossip_query_channel_range_reply,,final_complete,bool |
| 160 | gossip_query_channel_range_reply,,num,u16 |
| 161 | gossip_query_channel_range_reply,,scids,num*struct short_channel_id |
| 162 | # Set artificial maximum reply_channel_range size. Master->gossipd |
| 163 | gossip_dev_set_max_scids_encode_size,3030 |
| 164 | gossip_dev_set_max_scids_encode_size,,max,u32 |
| 165 | # Given a short_channel_id, return the endpoints |
| 166 | gossip_resolve_channel_request,3009 |
| 167 | gossip_resolve_channel_request,,channel_id,struct short_channel_id |
| 168 | gossip_resolve_channel_reply,3109 |
| 169 | gossip_resolve_channel_reply,,num_keys,u16 |
| 170 | gossip_resolve_channel_reply,,keys,num_keys*struct pubkey |
| 171 | # The main daemon asks for peers |
| 172 | gossip_getpeers_request,3011 |
| 173 | # 0 or 1 |
| 174 | gossip_getpeers_request,,num,u16 |
| 175 | gossip_getpeers_request,,id,num*struct pubkey |
| 176 | gossip_getpeers_reply,3111 |
| 177 | gossip_getpeers_reply,,num,u16 |
| 178 | gossip_getpeers_reply,,id,num*struct pubkey |
| 179 | gossip_getpeers_reply,,addr,num*struct wireaddr_internal |
| 180 | gossip_getpeers_reply,,numnodes,u16 |
| 181 | gossip_getpeers_reply,,nodes,numnodes*struct gossip_getnodes_entry |
| 182 | # Channel daemon can ask for updates for a specific channel, for sending |
| 183 | # errors. Must be distinct from WIRE_CHANNEL_ANNOUNCEMENT etc. gossip msgs! |
| 184 | gossip_get_update,3012 |
| 185 | gossip_get_update,,short_channel_id,struct short_channel_id |
| 186 | # If channel isn't known, update will be empty. |
| 187 | gossip_get_update_reply,3112 |
| 188 | gossip_get_update_reply,,len,u16 |
| 189 | gossip_get_update_reply,,update,len*u8 |
| 190 | # Gossipd can tell channeld etc about gossip to fwd. |
| 191 | gossip_send_gossip,3016 |
| 192 | gossip_send_gossip,,len,u16 |
| 193 | gossip_send_gossip,,gossip,len*u8 |
| 194 | # Both sides have seen the funding tx being locked, but we have not |
| 195 | # yet reached the announcement depth. So we add the channel locally so |
| 196 | # we (and peer) can update it already. |
| 197 | gossip_local_add_channel,3017 |
| 198 | gossip_local_add_channel,,short_channel_id,struct short_channel_id |
| 199 | gossip_local_add_channel,,remote_node_id,struct pubkey |
| 200 | gossip_local_channel_update,3026 |
| 201 | gossip_local_channel_update,,short_channel_id,struct short_channel_id |
| 202 | gossip_local_channel_update,,disable,bool |
| 203 | gossip_local_channel_update,,cltv_expiry_delta,u16 |
| 204 | gossip_local_channel_update,,htlc_minimum_msat,u64 |
| 205 | gossip_local_channel_update,,fee_base_msat,u32 |
| 206 | gossip_local_channel_update,,fee_proportional_millionths,u32 |
| 207 | gossip_local_channel_close,3027 |
| 208 | gossip_local_channel_close,,short_channel_id,struct short_channel_id |
| 209 | # Gossipd->master get this tx output please. |
| 210 | gossip_get_txout,3018 |
| 211 | gossip_get_txout,,short_channel_id,struct short_channel_id |
| 212 | # master->gossipd here is the output, or empty if none. |
| 213 | gossip_get_txout_reply,3118 |
| 214 | gossip_get_txout_reply,,short_channel_id,struct short_channel_id |
| 215 | gossip_get_txout_reply,,satoshis,u64 |
| 216 | gossip_get_txout_reply,,len,u16 |
| 217 | gossip_get_txout_reply,,outscript,len*u8 |
| 218 | # master->gossipd a routing failure occurred |
| 219 | gossip_routing_failure,3021 |
| 220 | gossip_routing_failure,,erring_node,struct pubkey |
| 221 | gossip_routing_failure,,erring_channel,struct short_channel_id |
| 222 | gossip_routing_failure,,failcode,u16 |
| 223 | gossip_routing_failure,,len,u16 |
| 224 | gossip_routing_failure,,channel_update,len*u8 |
| 225 | # master->gossipd temporarily mark a channel unroutable |
| 226 | # (used in case of unparseable onion reply) |
| 227 | gossip_mark_channel_unroutable,3022 |
| 228 | gossip_mark_channel_unroutable,,channel,struct short_channel_id |
| 229 | # master->gossipd: Request to disconnect from a peer. |
| 230 | gossipctl_peer_disconnect,3023 |
| 231 | gossipctl_peer_disconnect,,id,struct pubkey |
| 232 | # Gossipd -> master: reply to gossip_peer_disconnect with peer id. |
| 233 | gossipctl_peer_disconnect_reply,3123 |
| 234 | # Gossipd -> master: reply to gossip_peer_disconnect if we couldn't find the peer. |
| 235 | gossipctl_peer_disconnect_replyfail,3223 |
| 236 | gossipctl_peer_disconnect_replyfail,,isconnected,bool |
| 237 | # master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel |
| 238 | gossip_outpoint_spent,3024 |
| 239 | gossip_outpoint_spent,,short_channel_id,struct short_channel_id |