2017-01-10 06:08:33 +01:00
|
|
|
# These are fatal.
|
|
|
|
gossipstatus_init_failed,0x8000
|
|
|
|
gossipstatus_bad_new_peer_request,0x8001
|
|
|
|
gossipstatus_bad_release_request,0x8002
|
2017-05-23 13:02:17 +02:00
|
|
|
gossipstatus_bad_fail_request,0x8003
|
|
|
|
gossipstatus_bad_request,0x8004
|
|
|
|
gossipstatus_fdpass_failed,0x8005
|
2017-01-10 06:08:33 +01:00
|
|
|
|
|
|
|
# Peers can give a bad message, we close their fd, but no harm done.
|
2017-03-10 11:50:43 +01:00
|
|
|
gossipstatus_peer_bad_msg,1000
|
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.
|
|
|
|
gossipstatus_peer_failed,1001
|
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-03-10 11:50:43 +01:00
|
|
|
#include <lightningd/cryptomsg.h>
|
|
|
|
|
2017-04-24 14:31:26 +02:00
|
|
|
# Initialize the gossip daemon
|
|
|
|
gossipctl_init,0
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_init,,broadcast_interval,4
|
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).
|
|
|
|
gossipctl_new_peer,1
|
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.
|
|
|
|
gossipctl_release_peer,2
|
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-03-10 11:50:43 +01:00
|
|
|
gossipctl_release_peer_reply,102
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_release_peer_reply,,unique_id,8
|
|
|
|
gossipctl_release_peer_reply,,crypto_state,struct crypto_state
|
2017-03-10 11:50:43 +01:00
|
|
|
|
2017-01-10 06:08:33 +01:00
|
|
|
# This is where we save a peer's features.
|
|
|
|
#gossipstatus_peer_features,1
|
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-03-10 11:50:43 +01:00
|
|
|
gossipstatus_peer_nongossip,4
|
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
|
|
|
|
gossip_getnodes_request,5
|
|
|
|
|
2017-03-16 05:05:26 +01:00
|
|
|
#include <lightningd/gossip_msg.h>
|
2017-03-12 13:39:23 +01:00
|
|
|
gossip_getnodes_reply,105
|
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
|
|
|
|
gossip_getroute_request,6
|
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
|
|
|
|
|
|
|
gossip_getroute_reply,106
|
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
|
|
|
|
|
|
|
gossip_getchannels_request,7
|
|
|
|
|
|
|
|
gossip_getchannels_reply,107
|
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.
|
|
|
|
gossip_ping,8
|
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
|
|
|
|
|
|
|
gossip_ping_reply,108
|
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
|
|
|
|
gossip_resolve_channel_request,9
|
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
|
|
|
|
|
|
|
gossip_resolve_channel_reply,109
|
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.
|
|
|
|
gossip_forwarded_msg,10
|
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)
|
|
|
|
gossipctl_fail_peer,11
|
2017-05-25 04:16:04 +02:00
|
|
|
gossipctl_fail_peer,,unique_id,8
|