mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 09:34:24 +01:00
7.5 KiB
7.5 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 | # If non-zero, port to listen on. |
| 10 | gossipctl_init,,port,u16 |
| 11 | gossipctl_init,,gflen,u16 |
| 12 | gossipctl_init,,gfeatures,gflen*u8 |
| 13 | gossipctl_init,,lflen,u16 |
| 14 | gossipctl_init,,lfeatures,lflen*u8 |
| 15 | gossipctl_init,,num_wireaddrs,u16 |
| 16 | gossipctl_init,,wireaddrs,num_wireaddrs*struct wireaddr |
| 17 | gossipctl_init,,rgb,3*u8 |
| 18 | gossipctl_init,,alias,32*u8 |
| 19 | gossipctl_init,,update_channel_interval,u32 |
| 20 | # Master -> gossipd: Optional hint for where to find peer. |
| 21 | gossipctl_peer_addrhint,3014 |
| 22 | gossipctl_peer_addrhint,,id,struct pubkey |
| 23 | gossipctl_peer_addrhint,,addr,struct wireaddr |
| 24 | # Master -> gossipd: connect to a peer. We may get a peer_connected or |
| 25 | # peer_already_connected |
| 26 | gossipctl_reach_peer,3001 |
| 27 | gossipctl_reach_peer,,id,struct pubkey |
| 28 | # Gossipd -> master: we got a peer. Two fds: peer and gossip |
| 29 | gossip_peer_connected,3002 |
| 30 | gossip_peer_connected,,id,struct pubkey |
| 31 | gossip_peer_connected,,addr,struct wireaddr |
| 32 | gossip_peer_connected,,crypto_state,struct crypto_state |
| 33 | gossip_peer_connected,,gossip_index,u64 |
| 34 | gossip_peer_connected,,gflen,u16 |
| 35 | gossip_peer_connected,,gfeatures,gflen*u8 |
| 36 | gossip_peer_connected,,lflen,u16 |
| 37 | gossip_peer_connected,,lfeatures,lflen*u8 |
| 38 | # Gossipd -> master: you asked to reach a peer, we already had. |
| 39 | gossip_peer_already_connected,3015 |
| 40 | gossip_peer_already_connected,,id,struct pubkey |
| 41 | # gossipd -> master: attempted to connect, unsuccessful, gave up |
| 42 | gossip_peer_connection_failed,3020 |
| 43 | gossip_peer_connection_failed,,id,struct pubkey |
| 44 | gossip_peer_connection_failed,,timeout,u32 |
| 45 | gossip_peer_connection_failed,,attempts,u32 |
| 46 | gossip_peer_connection_failed,,addr_unknown,bool |
| 47 | # Gossipd -> master: peer sent non-gossip packet. Two fds: peer and gossip |
| 48 | gossip_peer_nongossip,3003 |
| 49 | gossip_peer_nongossip,,id,struct pubkey |
| 50 | gossip_peer_nongossip,,addr,struct wireaddr |
| 51 | gossip_peer_nongossip,,crypto_state,struct crypto_state |
| 52 | gossip_peer_nongossip,,gossip_index,u64 |
| 53 | gossip_peer_nongossip,,gflen,u16 |
| 54 | gossip_peer_nongossip,,gfeatures,gflen*u8 |
| 55 | gossip_peer_nongossip,,lflen,u16 |
| 56 | gossip_peer_nongossip,,lfeatures,lflen*u8 |
| 57 | gossip_peer_nongossip,,len,u16 |
| 58 | gossip_peer_nongossip,,msg,len*u8 |
| 59 | # Master -> gossipd: release a peer (so we can open a channel) |
| 60 | gossipctl_release_peer,3004 |
| 61 | gossipctl_release_peer,,id,struct pubkey |
| 62 | # Gossipd -> master: reply to gossip_release_peer. Two fds: peer and gossip. |
| 63 | gossipctl_release_peer_reply,3104 |
| 64 | gossipctl_release_peer_reply,,addr,struct wireaddr |
| 65 | gossipctl_release_peer_reply,,crypto_state,struct crypto_state |
| 66 | gossipctl_release_peer_reply,,gossip_index,u64 |
| 67 | gossipctl_release_peer_reply,,gflen,u16 |
| 68 | gossipctl_release_peer_reply,,gfeatures,gflen*u8 |
| 69 | gossipctl_release_peer_reply,,lflen,u16 |
| 70 | gossipctl_release_peer_reply,,lfeatures,lflen*u8 |
| 71 | # Gossipd -> master: reply to gossip_release_peer if we couldn't find the peer. |
| 72 | gossipctl_release_peer_replyfail,3204 |
| 73 | # master -> gossipd: take back peer, with optional msg. (+peer fd, +gossip fd) |
| 74 | gossipctl_hand_back_peer,3013 |
| 75 | gossipctl_hand_back_peer,,id,struct pubkey |
| 76 | gossipctl_hand_back_peer,,crypto_state,struct crypto_state |
| 77 | gossipctl_hand_back_peer,,gossip_index,u64 |
| 78 | gossipctl_hand_back_peer,,len,u16 |
| 79 | gossipctl_hand_back_peer,,msg,len*u8 |
| 80 | # Pass JSON-RPC getnodes call through |
| 81 | gossip_getnodes_request,3005 |
| 82 | # Can be 0 or 1 currently |
| 83 | gossip_getnodes_request,,num,u16 |
| 84 | gossip_getnodes_request,,id,num*struct pubkey |
| 85 | #include <lightningd/gossip_msg.h> |
| 86 | gossip_getnodes_reply,3105 |
| 87 | gossip_getnodes_reply,,num_nodes,u16 |
| 88 | gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry |
| 89 | # Pass JSON-RPC getroute call through |
| 90 | gossip_getroute_request,3006 |
| 91 | gossip_getroute_request,,source,struct pubkey |
| 92 | gossip_getroute_request,,destination,struct pubkey |
| 93 | gossip_getroute_request,,msatoshi,u32 |
| 94 | gossip_getroute_request,,riskfactor,u16 |
| 95 | gossip_getroute_request,,final_cltv,u32 |
| 96 | gossip_getroute_request,,fuzz,double |
| 97 | gossip_getroute_request,,seed,struct siphash_seed |
| 98 | gossip_getroute_reply,3106 |
| 99 | gossip_getroute_reply,,num_hops,u16 |
| 100 | gossip_getroute_reply,,hops,num_hops*struct route_hop |
| 101 | gossip_getchannels_request,3007 |
| 102 | # In practice, 0 or 1. |
| 103 | gossip_getchannels_request,,num,u16 |
| 104 | gossip_getchannels_request,,short_channel_id,num*struct short_channel_id |
| 105 | gossip_getchannels_reply,3107 |
| 106 | gossip_getchannels_reply,,num_channels,u16 |
| 107 | gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry |
| 108 | # Ping/pong test. Waits for a reply if it expects one. |
| 109 | gossip_ping,3008 |
| 110 | gossip_ping,,id,struct pubkey |
| 111 | gossip_ping,,num_pong_bytes,u16 |
| 112 | gossip_ping,,len,u16 |
| 113 | gossip_ping_reply,3108 |
| 114 | # False if id in gossip_ping was unknown. |
| 115 | gossip_ping_reply,,sent,bool |
| 116 | # 0 == no pong expected |
| 117 | gossip_ping_reply,,totlen,u16 |
| 118 | # Given a short_channel_id, return the endpoints |
| 119 | gossip_resolve_channel_request,3009 |
| 120 | gossip_resolve_channel_request,,channel_id,struct short_channel_id |
| 121 | gossip_resolve_channel_reply,3109 |
| 122 | gossip_resolve_channel_reply,,num_keys,u16 |
| 123 | gossip_resolve_channel_reply,,keys,num_keys*struct pubkey |
| 124 | # The main daemon asks for peers |
| 125 | gossip_getpeers_request,3011 |
| 126 | # 0 or 1 |
| 127 | gossip_getpeers_request,,num,u16 |
| 128 | gossip_getpeers_request,,id,num*struct pubkey |
| 129 | gossip_getpeers_reply,3111 |
| 130 | gossip_getpeers_reply,,num,u16 |
| 131 | gossip_getpeers_reply,,id,num*struct pubkey |
| 132 | gossip_getpeers_reply,,addr,num*struct wireaddr |
| 133 | gossip_getpeers_reply,,numnodes,u16 |
| 134 | gossip_getpeers_reply,,nodes,numnodes*struct gossip_getnodes_entry |
| 135 | # Channel daemon can ask for updates for a specific channel, for sending |
| 136 | # errors. Must be distinct from WIRE_CHANNEL_ANNOUNCEMENT etc. gossip msgs! |
| 137 | gossip_get_update,3012 |
| 138 | gossip_get_update,,short_channel_id,struct short_channel_id |
| 139 | # If channel isn't known, update will be empty. |
| 140 | gossip_get_update_reply,3112 |
| 141 | gossip_get_update_reply,,len,u16 |
| 142 | gossip_get_update_reply,,update,len*u8 |
| 143 | # Gossipd can tell channeld etc about gossip to fwd. |
| 144 | gossip_send_gossip,3016 |
| 145 | gossip_send_gossip,,gossip_index,u64 |
| 146 | gossip_send_gossip,,len,u16 |
| 147 | gossip_send_gossip,,gossip,len*u8 |
| 148 | # Both sides have seen the funding tx being locked, but we have not |
| 149 | # yet reached the announcement depth. So we add the channel locally so |
| 150 | # we can use it already. |
| 151 | gossip_local_add_channel,3017 |
| 152 | gossip_local_add_channel,,short_channel_id,struct short_channel_id |
| 153 | gossip_local_add_channel,,chain_hash,struct bitcoin_blkid |
| 154 | gossip_local_add_channel,,remote_node_id,struct pubkey |
| 155 | gossip_local_add_channel,,cltv_expiry_delta,u16 |
| 156 | gossip_local_add_channel,,htlc_minimum_msat,u64 |
| 157 | gossip_local_add_channel,,fee_base_msat,u32 |
| 158 | gossip_local_add_channel,,fee_proportional_millionths,u32 |
| 159 | # Gossipd->master get this tx output please. |
| 160 | gossip_get_txout,3018 |
| 161 | gossip_get_txout,,short_channel_id,struct short_channel_id |
| 162 | # master->gossipd here is the output, or empty if none. |
| 163 | gossip_get_txout_reply,3118 |
| 164 | gossip_get_txout_reply,,short_channel_id,struct short_channel_id |
| 165 | gossip_get_txout_reply,,len,u16 |
| 166 | gossip_get_txout_reply,,outscript,len*u8 |
| 167 | # client->gossipd: Disable the channel matching the short_channel_id |
| 168 | gossip_disable_channel,3019 |
| 169 | gossip_disable_channel,,short_channel_id,struct short_channel_id |
| 170 | gossip_disable_channel,,direction,u8 |
| 171 | gossip_disable_channel,,active,bool |
| 172 | # master->gossipd a routing failure occurred |
| 173 | gossip_routing_failure,3021 |
| 174 | gossip_routing_failure,,erring_node,struct pubkey |
| 175 | gossip_routing_failure,,erring_channel,struct short_channel_id |
| 176 | gossip_routing_failure,,failcode,u16 |
| 177 | gossip_routing_failure,,len,u16 |
| 178 | gossip_routing_failure,,channel_update,len*u8 |
| 179 | # master->gossipd temporarily mark a channel unroutable |
| 180 | # (used in case of unparseable onion reply) |
| 181 | gossip_mark_channel_unroutable,3022 |
| 182 | gossip_mark_channel_unroutable,,channel,struct short_channel_id |