2017-08-28 18:05:01 +02:00
|
|
|
#include <common/cryptomsg.h>
|
2017-10-23 06:17:38 +02:00
|
|
|
#include <common/wireaddr.h>
|
2018-01-18 00:32:36 +01:00
|
|
|
#include <wire/gen_onion_wire.h>
|
2017-03-10 11:50:43 +01:00
|
|
|
|
gossipd: rewrite to do the handshake internally.
Now the flow is much simpler from a lightningd POV:
1. If we want to connect to a peer, just send gossipd `gossipctl_reach_peer`.
2. Every new peer, gossipd hands up to lightningd, with global/local features
and the peer fd and a gossip fd using `gossip_peer_connected`
3. If lightningd doesn't want it, it just hands the peerfd and global/local
features back to gossipd using `gossipctl_handle_peer`
4. If a peer sends a non-gossip msg (eg `open_channel`) the gossipd sends
it up using `gossip_peer_nongossip`.
5. If lightningd wants to fund a channel, it simply calls `release_channel`.
Notes:
* There's no more "unique_id": we use the peer id.
* For the moment, we don't ask gossipd when we're told to list peers, so
connected peers without a channel don't appear in the JSON getpeers API.
* We add a `gossipctl_peer_addrhint` for the moment, so you can connect to
a specific ip/port, but using other sources is a TODO.
* We now (correctly) only give up on reaching a peer after we exchange init
messages, which changes the test_disconnect case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-11 12:09:49 +02:00
|
|
|
# Initialize the gossip daemon.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_init,3000
|
2017-12-18 07:44:10 +01:00
|
|
|
gossipctl_init,,chain_hash,struct bitcoin_blkid
|
2019-04-08 11:58:32 +02:00
|
|
|
gossipctl_init,,id,struct node_id
|
gossipd: rewrite to do the handshake internally.
Now the flow is much simpler from a lightningd POV:
1. If we want to connect to a peer, just send gossipd `gossipctl_reach_peer`.
2. Every new peer, gossipd hands up to lightningd, with global/local features
and the peer fd and a gossip fd using `gossip_peer_connected`
3. If lightningd doesn't want it, it just hands the peerfd and global/local
features back to gossipd using `gossipctl_handle_peer`
4. If a peer sends a non-gossip msg (eg `open_channel`) the gossipd sends
it up using `gossip_peer_nongossip`.
5. If lightningd wants to fund a channel, it simply calls `release_channel`.
Notes:
* There's no more "unique_id": we use the peer id.
* For the moment, we don't ask gossipd when we're told to list peers, so
connected peers without a channel don't appear in the JSON getpeers API.
* We add a `gossipctl_peer_addrhint` for the moment, so you can connect to
a specific ip/port, but using other sources is a TODO.
* We now (correctly) only give up on reaching a peer after we exchange init
messages, which changes the test_disconnect case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-11 12:09:49 +02:00
|
|
|
gossipctl_init,,gflen,u16
|
2018-09-29 02:57:01 +02:00
|
|
|
gossipctl_init,,globalfeatures,gflen*u8
|
2017-11-24 15:03:22 +01:00
|
|
|
gossipctl_init,,rgb,3*u8
|
|
|
|
gossipctl_init,,alias,32*u8
|
2018-01-09 15:52:21 +01:00
|
|
|
gossipctl_init,,update_channel_interval,u32
|
2018-07-24 08:18:58 +02:00
|
|
|
gossipctl_init,,num_announcable,u16
|
|
|
|
gossipctl_init,,announcable,num_announcable*struct wireaddr
|
2019-04-08 01:51:30 +02:00
|
|
|
gossipctl_init,,dev_gossip_time,?u32
|
gossipd: rewrite to do the handshake internally.
Now the flow is much simpler from a lightningd POV:
1. If we want to connect to a peer, just send gossipd `gossipctl_reach_peer`.
2. Every new peer, gossipd hands up to lightningd, with global/local features
and the peer fd and a gossip fd using `gossip_peer_connected`
3. If lightningd doesn't want it, it just hands the peerfd and global/local
features back to gossipd using `gossipctl_handle_peer`
4. If a peer sends a non-gossip msg (eg `open_channel`) the gossipd sends
it up using `gossip_peer_nongossip`.
5. If lightningd wants to fund a channel, it simply calls `release_channel`.
Notes:
* There's no more "unique_id": we use the peer id.
* For the moment, we don't ask gossipd when we're told to list peers, so
connected peers without a channel don't appear in the JSON getpeers API.
* We add a `gossipctl_peer_addrhint` for the moment, so you can connect to
a specific ip/port, but using other sources is a TODO.
* We now (correctly) only give up on reaching a peer after we exchange init
messages, which changes the test_disconnect case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-11 12:09:49 +02:00
|
|
|
|
2017-03-12 13:39:23 +01:00
|
|
|
# Pass JSON-RPC getnodes call through
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_getnodes_request,3005
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_getnodes_request,,id,?struct node_id
|
2017-03-12 13:39:23 +01:00
|
|
|
|
2017-03-16 05:05:26 +01:00
|
|
|
#include <lightningd/gossip_msg.h>
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_getnodes_reply,3105
|
2019-03-26 19:33:05 +01:00
|
|
|
gossip_getnodes_reply,,num_nodes,u32
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry
|
2017-03-15 11:36:52 +01:00
|
|
|
|
|
|
|
# Pass JSON-RPC getroute call through
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_getroute_request,3006
|
2019-05-31 09:30:33 +02:00
|
|
|
# Source defaults to "us", and means we don't consider first-hop channel fees
|
|
|
|
gossip_getroute_request,,source,?struct node_id
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_getroute_request,,destination,struct node_id
|
2019-02-21 04:45:55 +01:00
|
|
|
gossip_getroute_request,,msatoshi,struct amount_msat
|
2019-02-01 06:53:38 +01:00
|
|
|
# We don't pass doubles, so pass riskfactor * 1000000.
|
|
|
|
gossip_getroute_request,,riskfactor_by_million,u64
|
2017-10-23 06:16:57 +02:00
|
|
|
gossip_getroute_request,,final_cltv,u32
|
2018-02-15 14:37:04 +01:00
|
|
|
gossip_getroute_request,,fuzz,double
|
2019-01-15 05:04:27 +01:00
|
|
|
gossip_getroute_request,,num_excluded,u16
|
2019-01-15 05:11:27 +01:00
|
|
|
gossip_getroute_request,,excluded,num_excluded*struct short_channel_id_dir
|
2019-01-15 05:06:27 +01:00
|
|
|
gossip_getroute_request,,max_hops,u32
|
2017-03-15 11:36:52 +01:00
|
|
|
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_getroute_reply,3106
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_getroute_reply,,num_hops,u16
|
|
|
|
gossip_getroute_reply,,hops,num_hops*struct route_hop
|
2017-03-22 13:30:09 +01:00
|
|
|
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_getchannels_request,3007
|
2018-07-09 13:17:49 +02:00
|
|
|
gossip_getchannels_request,,short_channel_id,?struct short_channel_id
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_getchannels_request,,source,?struct node_id
|
2019-05-21 09:13:26 +02:00
|
|
|
gossip_getchannels_request,,prev,?struct short_channel_id
|
2017-03-22 13:30:09 +01:00
|
|
|
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_getchannels_reply,3107
|
2019-05-21 09:13:26 +02:00
|
|
|
gossip_getchannels_reply,,complete,bool
|
2019-03-26 19:29:49 +01:00
|
|
|
gossip_getchannels_reply,,num_channels,u32
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry
|
2017-04-12 20:20:48 +02:00
|
|
|
|
gossipd: rewrite to do the handshake internally.
Now the flow is much simpler from a lightningd POV:
1. If we want to connect to a peer, just send gossipd `gossipctl_reach_peer`.
2. Every new peer, gossipd hands up to lightningd, with global/local features
and the peer fd and a gossip fd using `gossip_peer_connected`
3. If lightningd doesn't want it, it just hands the peerfd and global/local
features back to gossipd using `gossipctl_handle_peer`
4. If a peer sends a non-gossip msg (eg `open_channel`) the gossipd sends
it up using `gossip_peer_nongossip`.
5. If lightningd wants to fund a channel, it simply calls `release_channel`.
Notes:
* There's no more "unique_id": we use the peer id.
* For the moment, we don't ask gossipd when we're told to list peers, so
connected peers without a channel don't appear in the JSON getpeers API.
* We add a `gossipctl_peer_addrhint` for the moment, so you can connect to
a specific ip/port, but using other sources is a TODO.
* We now (correctly) only give up on reaching a peer after we exchange init
messages, which changes the test_disconnect case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-11 12:09:49 +02:00
|
|
|
# Ping/pong test. Waits for a reply if it expects one.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_ping,3008
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_ping,,id,struct node_id
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_ping,,num_pong_bytes,u16
|
|
|
|
gossip_ping,,len,u16
|
2017-04-12 20:20:48 +02:00
|
|
|
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_ping_reply,3108
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_ping_reply,,id,struct node_id
|
gossipd: rewrite to do the handshake internally.
Now the flow is much simpler from a lightningd POV:
1. If we want to connect to a peer, just send gossipd `gossipctl_reach_peer`.
2. Every new peer, gossipd hands up to lightningd, with global/local features
and the peer fd and a gossip fd using `gossip_peer_connected`
3. If lightningd doesn't want it, it just hands the peerfd and global/local
features back to gossipd using `gossipctl_handle_peer`
4. If a peer sends a non-gossip msg (eg `open_channel`) the gossipd sends
it up using `gossip_peer_nongossip`.
5. If lightningd wants to fund a channel, it simply calls `release_channel`.
Notes:
* There's no more "unique_id": we use the peer id.
* For the moment, we don't ask gossipd when we're told to list peers, so
connected peers without a channel don't appear in the JSON getpeers API.
* We add a `gossipctl_peer_addrhint` for the moment, so you can connect to
a specific ip/port, but using other sources is a TODO.
* We now (correctly) only give up on reaching a peer after we exchange init
messages, which changes the test_disconnect case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-11 12:09:49 +02:00
|
|
|
# False if id in gossip_ping was unknown.
|
|
|
|
gossip_ping_reply,,sent,bool
|
|
|
|
# 0 == no pong expected
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_ping_reply,,totlen,u16
|
2017-04-12 20:20:48 +02:00
|
|
|
|
2018-06-04 06:22:25 +02:00
|
|
|
# Test of query_short_channel_ids. Master->gossipd
|
|
|
|
gossip_query_scids,3031
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_query_scids,,id,struct node_id
|
2018-06-04 06:22:25 +02:00
|
|
|
gossip_query_scids,,num_ids,u16
|
|
|
|
gossip_query_scids,,ids,num_ids*struct short_channel_id
|
|
|
|
|
|
|
|
# Gossipd -> master
|
|
|
|
gossip_scids_reply,3131
|
|
|
|
gossip_scids_reply,,ok,bool
|
|
|
|
gossip_scids_reply,,complete,bool
|
|
|
|
|
2018-06-04 06:28:02 +02:00
|
|
|
# Test gossip timestamp filtering.
|
|
|
|
gossip_send_timestamp_filter,3028
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_send_timestamp_filter,,id,struct node_id
|
2018-06-04 06:28:02 +02:00
|
|
|
gossip_send_timestamp_filter,,first_timestamp,u32
|
|
|
|
gossip_send_timestamp_filter,,timestamp_range,u32
|
|
|
|
|
2018-06-04 06:28:02 +02:00
|
|
|
# Test of query_channel_range. Master->gossipd
|
|
|
|
gossip_query_channel_range,3029
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_query_channel_range,,id,struct node_id
|
2018-06-04 06:28:02 +02:00
|
|
|
gossip_query_channel_range,,first_blocknum,u32
|
|
|
|
gossip_query_channel_range,,number_of_blocks,u32
|
|
|
|
|
|
|
|
# Gossipd -> master
|
|
|
|
gossip_query_channel_range_reply,3129
|
|
|
|
gossip_query_channel_range_reply,,final_first_block,u32
|
|
|
|
gossip_query_channel_range_reply,,final_num_blocks,u32
|
|
|
|
gossip_query_channel_range_reply,,final_complete,bool
|
|
|
|
gossip_query_channel_range_reply,,num,u16
|
|
|
|
gossip_query_channel_range_reply,,scids,num*struct short_channel_id
|
|
|
|
|
2018-06-04 06:28:02 +02:00
|
|
|
# Set artificial maximum reply_channel_range size. Master->gossipd
|
|
|
|
gossip_dev_set_max_scids_encode_size,3030
|
|
|
|
gossip_dev_set_max_scids_encode_size,,max,u32
|
|
|
|
|
2018-10-15 06:57:22 +02:00
|
|
|
# Given a short_channel_id, return the other endpoint (or none if DNE)
|
|
|
|
gossip_get_channel_peer,3009
|
|
|
|
gossip_get_channel_peer,,channel_id,struct short_channel_id
|
2017-04-30 23:49:15 +02:00
|
|
|
|
2018-10-15 06:57:22 +02:00
|
|
|
gossip_get_channel_peer_reply,3109
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_get_channel_peer_reply,,peer_id,?struct node_id
|
2017-05-07 01:59:48 +02:00
|
|
|
|
2018-11-13 05:03:51 +01:00
|
|
|
# gossipd->master: we're closing this channel.
|
2018-05-26 15:19:24 +02:00
|
|
|
gossip_local_channel_close,3027
|
|
|
|
gossip_local_channel_close,,short_channel_id,struct short_channel_id
|
|
|
|
|
2018-01-04 12:40:58 +01:00
|
|
|
# Gossipd->master get this tx output please.
|
|
|
|
gossip_get_txout,3018
|
|
|
|
gossip_get_txout,,short_channel_id,struct short_channel_id
|
|
|
|
|
|
|
|
# master->gossipd here is the output, or empty if none.
|
|
|
|
gossip_get_txout_reply,3118
|
|
|
|
gossip_get_txout_reply,,short_channel_id,struct short_channel_id
|
2019-02-21 04:45:55 +01:00
|
|
|
gossip_get_txout_reply,,satoshis,struct amount_sat
|
2018-01-04 12:40:58 +01:00
|
|
|
gossip_get_txout_reply,,len,u16
|
|
|
|
gossip_get_txout_reply,,outscript,len*u8
|
|
|
|
|
2019-01-17 16:24:32 +01:00
|
|
|
# master->gossipd an htlc failed with this onion error.
|
|
|
|
gossip_payment_failure,3021
|
2019-04-08 11:58:32 +02:00
|
|
|
gossip_payment_failure,,erring_node,struct node_id
|
2019-01-17 16:24:32 +01:00
|
|
|
gossip_payment_failure,,erring_channel,struct short_channel_id
|
|
|
|
gossip_payment_failure,,erring_channel_direction,u8
|
|
|
|
gossip_payment_failure,,len,u16
|
|
|
|
gossip_payment_failure,,error,len*u8
|
2018-02-06 16:32:06 +01:00
|
|
|
|
2018-03-26 20:10:03 +02:00
|
|
|
# master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel
|
|
|
|
gossip_outpoint_spent,3024
|
|
|
|
gossip_outpoint_spent,,short_channel_id,struct short_channel_id
|
2018-07-26 23:27:37 +02:00
|
|
|
|
|
|
|
# master -> gossipd: stop gossip timers.
|
|
|
|
gossip_dev_suppress,3032
|
2018-09-27 07:29:17 +02:00
|
|
|
|
2018-11-21 23:41:49 +01:00
|
|
|
# master -> gossipd: do you have a memleak?
|
|
|
|
gossip_dev_memleak,3033
|
|
|
|
|
|
|
|
gossip_dev_memleak_reply,3133
|
|
|
|
gossip_dev_memleak_reply,,leak,bool
|
|
|
|
|
2019-04-08 01:52:19 +02:00
|
|
|
# master -> gossipd: please rewrite the gossip_store
|
|
|
|
gossip_dev_compact_store,3034
|
|
|
|
|
|
|
|
# gossipd -> master: ok
|
|
|
|
gossip_dev_compact_store_reply,3134
|
|
|
|
gossip_dev_compact_store_reply,,success,bool
|
|
|
|
|
2018-09-27 07:29:17 +02:00
|
|
|
#include <common/bolt11.h>
|
|
|
|
|
|
|
|
# master -> gossipd: get route_info for our incoming channels
|
|
|
|
gossip_get_incoming_channels,3025
|
2019-01-15 04:58:27 +01:00
|
|
|
gossip_get_incoming_channels,,private_too,?bool
|
2018-09-27 07:29:17 +02:00
|
|
|
|
|
|
|
# gossipd -> master: here they are.
|
|
|
|
gossip_get_incoming_channels_reply,3125
|
|
|
|
gossip_get_incoming_channels_reply,,num,u16
|
|
|
|
gossip_get_incoming_channels_reply,,route_info,num*struct route_info
|