2017-01-10 06:08:33 +01:00
|
|
|
# Peers can give a bad message, we close their fd, but no harm done.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipstatus_peer_bad_msg,13000
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipstatus_peer_bad_msg,,unique_id,8
|
|
|
|
gossipstatus_peer_bad_msg,,len,2
|
|
|
|
gossipstatus_peer_bad_msg,,err,len*u8
|
2017-01-10 06:08:33 +01:00
|
|
|
|
2017-03-19 21:32:40 +01:00
|
|
|
# Misc problems like opening control fd.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipstatus_peer_failed,13001
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipstatus_peer_failed,,unique_id,8
|
|
|
|
gossipstatus_peer_failed,,len,2
|
|
|
|
gossipstatus_peer_failed,,err,len*u8
|
2017-03-19 21:32:40 +01:00
|
|
|
|
2017-08-28 18:05:01 +02:00
|
|
|
#include <common/cryptomsg.h>
|
2017-03-10 11:50:43 +01:00
|
|
|
|
2017-04-24 14:31:26 +02:00
|
|
|
# Initialize the gossip daemon
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_init,3000
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_init,,broadcast_interval,4
|
2017-08-22 07:06:37 +02:00
|
|
|
gossipctl_init,,chain_hash,struct sha256_double
|
2017-04-24 14:31:26 +02:00
|
|
|
|
2017-03-10 11:50:43 +01:00
|
|
|
# These take an fd, but have no response
|
|
|
|
# (if it is to move onto a channel, we get a status msg).
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_new_peer,3001
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_new_peer,,unique_id,8
|
|
|
|
gossipctl_new_peer,,crypto_state,struct crypto_state
|
2017-03-10 11:50:43 +01:00
|
|
|
|
|
|
|
# Tell it to release a peer which has initialized.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_release_peer,3002
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_release_peer,,unique_id,8
|
2017-03-10 11:50:43 +01:00
|
|
|
|
2017-03-19 21:32:40 +01:00
|
|
|
# This releases the peer and returns the cryptostate (followed two fds: peer and gossip)
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_release_peer_reply,3102
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_release_peer_reply,,crypto_state,struct crypto_state
|
2017-03-10 11:50:43 +01:00
|
|
|
|
2017-06-24 08:25:53 +02:00
|
|
|
# This is if we couldn't find the peer.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_release_peer_replyfail,3202
|
2017-06-24 08:25:53 +02:00
|
|
|
|
2017-01-10 06:08:33 +01:00
|
|
|
# This is where we save a peer's features.
|
2017-09-26 23:02:48 +02:00
|
|
|
#gossipstatus_peer_features,3001
|
2017-05-25 04:16:04 +02:00
|
|
|
#gossipstatus_peer_features,,unique_id,8
|
|
|
|
#gossipstatus_peer_features,,gflen,2
|
|
|
|
#gossipstatus_peer_features,,globalfeatures,gflen
|
|
|
|
#gossipstatus_peer_features,,lflen,2
|
|
|
|
#gossipstatus_peer_features,,localfeatures,lflen
|
2017-01-10 06:08:33 +01:00
|
|
|
|
2017-03-19 21:32:40 +01:00
|
|
|
# Peer can send non-gossip packet (usually an open_channel) (followed two fds: peer and gossip)
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipstatus_peer_nongossip,3004
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipstatus_peer_nongossip,,unique_id,8
|
|
|
|
gossipstatus_peer_nongossip,,crypto_state,struct crypto_state
|
|
|
|
gossipstatus_peer_nongossip,,len,2
|
|
|
|
gossipstatus_peer_nongossip,,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-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
|
|
|
|
|
|
|
# Ping/pong test.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_ping,3008
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_ping,,unique_id,u64
|
|
|
|
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
|
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
|
|
|
|
|
|
|
# The main daemon forward some gossip message to gossipd, allows injecting
|
|
|
|
# arbitrary gossip messages.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossip_forwarded_msg,3010
|
2017-05-25 04:16:04 +02:00
|
|
|
gossip_forwarded_msg,,msglen,2
|
|
|
|
gossip_forwarded_msg,,msg,msglen
|
2017-05-23 13:02:17 +02:00
|
|
|
|
|
|
|
# If peer is still connected, fail it (master does this for reconnect)
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_fail_peer,3011
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_fail_peer,,unique_id,8
|
2017-06-24 08:50:23 +02:00
|
|
|
|
|
|
|
# Get a gossip fd for this peer (it has reconnected)
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_get_peer_gossipfd,3012
|
2017-06-24 08:50:23 +02:00
|
|
|
gossipctl_get_peer_gossipfd,,unique_id,u64
|
|
|
|
# Does it want a full dump of gossip?
|
|
|
|
gossipctl_get_peer_gossipfd,,sync,bool
|
|
|
|
|
|
|
|
# + fd.
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_get_peer_gossipfd_reply,3112
|
2017-06-24 08:50:23 +02:00
|
|
|
|
|
|
|
# Failure (can't make new socket)
|
2017-09-26 23:02:48 +02:00
|
|
|
gossipctl_get_peer_gossipfd_replyfail,3212
|