2017-08-28 18:05:01 +02:00
|
|
|
#include <common/cryptomsg.h>
|
2017-10-23 06:17:38 +02:00
|
|
|
#include <common/wireaddr.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-09-28 05:41:19 +02:00
|
|
|
gossipctl_init,,broadcast_interval,u32
|
2017-12-18 07:44:10 +01:00
|
|
|
gossipctl_init,,chain_hash,struct bitcoin_blkid
|
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,,id,struct pubkey
|
|
|
|
# If non-zero, port to listen on.
|
|
|
|
gossipctl_init,,port,u16
|
|
|
|
gossipctl_init,,gflen,u16
|
|
|
|
gossipctl_init,,gfeatures,gflen*u8
|
|
|
|
gossipctl_init,,lflen,u16
|
|
|
|
gossipctl_init,,lfeatures,lflen*u8
|
2017-11-24 15:03:22 +01:00
|
|
|
gossipctl_init,,num_wireaddrs,u16
|
|
|
|
gossipctl_init,,wireaddrs,num_wireaddrs*struct wireaddr
|
|
|
|
gossipctl_init,,rgb,3*u8
|
|
|
|
gossipctl_init,,alias,32*u8
|
2018-01-09 15:52:21 +01:00
|
|
|
gossipctl_init,,update_channel_interval,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
|
|
|
|
|
|
|
# Master -> gossipd: Optional hint for where to find peer.
|
|
|
|
gossipctl_peer_addrhint,3014
|
|
|
|
gossipctl_peer_addrhint,,id,struct pubkey
|
2017-10-23 06:17:38 +02:00
|
|
|
gossipctl_peer_addrhint,,addr,struct wireaddr
|
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
|
|
|
|
2018-01-10 06:30:54 +01:00
|
|
|
# Master -> gossipd: connect to a peer. We may get a peer_connected or
|
|
|
|
# peer_already_connected
|
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_reach_peer,3001
|
|
|
|
gossipctl_reach_peer,,id,struct pubkey
|
|
|
|
|
|
|
|
# Gossipd -> master: we got a peer. Two fds: peer and gossip
|
|
|
|
gossip_peer_connected,3002
|
|
|
|
gossip_peer_connected,,id,struct pubkey
|
2017-10-23 06:17:38 +02:00
|
|
|
gossip_peer_connected,,addr,struct wireaddr
|
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
|
|
|
gossip_peer_connected,,crypto_state,struct crypto_state
|
2017-12-11 04:33:16 +01:00
|
|
|
gossip_peer_connected,,gossip_index,u64
|
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
|
|
|
gossip_peer_connected,,gflen,u16
|
|
|
|
gossip_peer_connected,,gfeatures,gflen*u8
|
|
|
|
gossip_peer_connected,,lflen,u16
|
|
|
|
gossip_peer_connected,,lfeatures,lflen*u8
|
|
|
|
|
2018-01-10 06:30:54 +01:00
|
|
|
# Gossipd -> master: you asked to reach a peer, we already had.
|
|
|
|
gossip_peer_already_connected,3015
|
|
|
|
gossip_peer_already_connected,,id,struct pubkey
|
|
|
|
|
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
|
|
|
# Gossipd -> master: peer sent non-gossip packet. Two fds: peer and gossip
|
|
|
|
gossip_peer_nongossip,3003
|
|
|
|
gossip_peer_nongossip,,id,struct pubkey
|
2017-10-23 06:17:38 +02:00
|
|
|
gossip_peer_nongossip,,addr,struct wireaddr
|
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
|
|
|
gossip_peer_nongossip,,crypto_state,struct crypto_state
|
2017-12-11 04:33:16 +01:00
|
|
|
gossip_peer_nongossip,,gossip_index,u64
|
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
|
|
|
gossip_peer_nongossip,,gflen,u16
|
|
|
|
gossip_peer_nongossip,,gfeatures,gflen*u8
|
|
|
|
gossip_peer_nongossip,,lflen,u16
|
|
|
|
gossip_peer_nongossip,,lfeatures,lflen*u8
|
|
|
|
gossip_peer_nongossip,,len,u16
|
|
|
|
gossip_peer_nongossip,,msg,len*u8
|
|
|
|
|
|
|
|
# Master -> gossipd: release a peer (so we can open a channel)
|
|
|
|
gossipctl_release_peer,3004
|
|
|
|
gossipctl_release_peer,,id,struct pubkey
|
|
|
|
|
|
|
|
# Gossipd -> master: reply to gossip_release_peer. Two fds: peer and gossip.
|
|
|
|
gossipctl_release_peer_reply,3104
|
2017-10-23 06:17:38 +02:00
|
|
|
gossipctl_release_peer_reply,,addr,struct wireaddr
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_release_peer_reply,,crypto_state,struct crypto_state
|
2017-12-11 04:33:16 +01:00
|
|
|
gossipctl_release_peer_reply,,gossip_index,u64
|
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_release_peer_reply,,gflen,u16
|
|
|
|
gossipctl_release_peer_reply,,gfeatures,gflen*u8
|
|
|
|
gossipctl_release_peer_reply,,lflen,u16
|
|
|
|
gossipctl_release_peer_reply,,lfeatures,lflen*u8
|
|
|
|
|
|
|
|
# Gossipd -> master: reply to gossip_release_peer if we couldn't find the peer.
|
|
|
|
gossipctl_release_peer_replyfail,3204
|
|
|
|
|
2017-12-11 04:33:16 +01:00
|
|
|
# master -> gossipd: take back peer, with optional msg. (+peer fd, +gossip fd)
|
2017-12-11 04:16:50 +01:00
|
|
|
gossipctl_hand_back_peer,3013
|
|
|
|
gossipctl_hand_back_peer,,id,struct pubkey
|
|
|
|
gossipctl_hand_back_peer,,crypto_state,struct crypto_state
|
2017-12-11 04:33:16 +01:00
|
|
|
gossipctl_hand_back_peer,,gossip_index,u64
|
2017-12-11 04:16:50 +01:00
|
|
|
gossipctl_hand_back_peer,,len,u16
|
|
|
|
gossipctl_hand_back_peer,,msg,len*u8
|
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
|
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
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_getnodes_reply,,num_nodes,u16
|
|
|
|
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
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_getroute_request,,source,struct pubkey
|
|
|
|
gossip_getroute_request,,destination,struct pubkey
|
|
|
|
gossip_getroute_request,,msatoshi,u32
|
|
|
|
gossip_getroute_request,,riskfactor,u16
|
2017-10-23 06:16:57 +02:00
|
|
|
gossip_getroute_request,,final_cltv,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
|
2017-03-22 13:30:09 +01:00
|
|
|
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_getchannels_reply,3107
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_getchannels_reply,,num_channels,u16
|
|
|
|
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
|
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
|
|
|
gossip_ping,,id,struct pubkey
|
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
|
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
|
|
|
|
2017-04-30 23:49:15 +02:00
|
|
|
# Given a short_channel_id, return the endpoints
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_resolve_channel_request,3009
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_resolve_channel_request,,channel_id,struct short_channel_id
|
2017-04-30 23:49:15 +02:00
|
|
|
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_resolve_channel_reply,3109
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_resolve_channel_reply,,num_keys,u16
|
|
|
|
gossip_resolve_channel_reply,,keys,num_keys*struct pubkey
|
2017-05-07 01:59:48 +02:00
|
|
|
|
2017-10-23 06:19:38 +02:00
|
|
|
# The main daemon asks for peers
|
|
|
|
gossip_getpeers_request,3011
|
|
|
|
|
|
|
|
gossip_getpeers_reply,3111
|
|
|
|
gossip_getpeers_reply,,num,u16
|
|
|
|
gossip_getpeers_reply,,id,num*struct pubkey
|
|
|
|
gossip_getpeers_reply,,addr,num*struct wireaddr
|
2017-11-28 23:52:32 +01:00
|
|
|
|
|
|
|
# Channel daemon can ask for updates for a specific channel, for sending
|
|
|
|
# errors. Must be distinct from WIRE_CHANNEL_ANNOUNCEMENT etc. gossip msgs!
|
|
|
|
gossip_get_update,3012
|
|
|
|
gossip_get_update,,short_channel_id,struct short_channel_id
|
|
|
|
|
|
|
|
# If channel isn't known, update will be empty.
|
|
|
|
gossip_get_update_reply,3112
|
|
|
|
gossip_get_update_reply,,len,u16
|
|
|
|
gossip_get_update_reply,,update,len*u8
|
|
|
|
|
2017-12-11 04:33:16 +01:00
|
|
|
# Gossipd can tell channeld etc about gossip to fwd.
|
|
|
|
gossip_send_gossip,3016
|
|
|
|
gossip_send_gossip,,gossip_index,u64
|
|
|
|
gossip_send_gossip,,len,u16
|
|
|
|
gossip_send_gossip,,gossip,len*u8
|
2017-12-15 15:16:42 +01:00
|
|
|
|
|
|
|
# Both sides have seen the funding tx being locked, but we have not
|
|
|
|
# yet reached the announcement depth. So we add the channel locally so
|
|
|
|
# we can use it already.
|
|
|
|
gossip_local_add_channel,3017
|
|
|
|
gossip_local_add_channel,,short_channel_id,struct short_channel_id
|
2017-12-18 07:44:10 +01:00
|
|
|
gossip_local_add_channel,,chain_hash,struct bitcoin_blkid
|
2017-12-15 15:16:42 +01:00
|
|
|
gossip_local_add_channel,,remote_node_id,struct pubkey
|
|
|
|
gossip_local_add_channel,,flags,u16
|
|
|
|
gossip_local_add_channel,,cltv_expiry_delta,u16
|
|
|
|
gossip_local_add_channel,,htlc_minimum_msat,u64
|
|
|
|
gossip_local_add_channel,,fee_base_msat,u32
|
2017-12-18 07:44:10 +01:00
|
|
|
gossip_local_add_channel,,fee_proportional_millionths,u32
|
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
|
|
|
|
gossip_get_txout_reply,,len,u16
|
|
|
|
gossip_get_txout_reply,,outscript,len*u8
|
|
|
|
|