2019-08-10 02:12:44 +02:00
|
|
|
|
.TH "LIGHTNING-CONNECT" "7" "" "" "lightning-connect"
|
|
|
|
|
.SH NAME
|
2019-08-31 14:30:56 +02:00
|
|
|
|
lightning-connect - Command for connecting to another lightning node
|
2019-08-10 02:12:44 +02:00
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
|
2019-02-08 17:53:45 +01:00
|
|
|
|
\fBconnect\fR \fIid\fR [\fIhost\fR \fIport\fR]
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
|
|
|
|
The \fBconnect\fR RPC command establishes a new connection with another
|
|
|
|
|
node in the Lightning Network\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\fIid\fR represents the target node’s public key\. As a convenience, \fIid\fR may
|
|
|
|
|
be of the form \fIid@host\fR or \fIid@host:port\fR\. In this case, the \fIhost\fR and
|
|
|
|
|
\fIport\fR parameters must be omitted\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\fIhost\fR is the peer’s hostname or IP address\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If not specified, the \fIport\fR defaults to 9735\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If \fIhost\fR is not specified, the connection will be attempted to an IP
|
|
|
|
|
belonging to \fIid\fR obtained through gossip with other already connected
|
|
|
|
|
peers\.
|
2020-01-29 04:25:43 +01:00
|
|
|
|
This can fail if your C-lightning node is a fresh install that has not
|
|
|
|
|
connected to any peers yet (your node has no gossip yet),
|
|
|
|
|
or if the target \fIid\fR is a fresh install that has no channels yet
|
|
|
|
|
(nobody will gossip about a node until it has one published channel)\.
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If \fIhost\fR begins with a \fI/\fR it is interpreted as a local path, and the
|
|
|
|
|
connection will be made to that local socket (see \fBbind-addr\fR in
|
|
|
|
|
\fBlightningd-config\fR(5))\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Connecting to a node is just the first step in opening a channel with
|
|
|
|
|
another node\. Once the peer is connected a channel can be opened with
|
|
|
|
|
\fBlightning-fundchannel\fR(7)\.
|
|
|
|
|
|
|
|
|
|
.SH RETURN VALUE
|
|
|
|
|
|
2020-04-02 06:07:47 +02:00
|
|
|
|
On success the peer \fIid\fR is returned, as well as a hexidecimal \fIfeatures\fR
|
|
|
|
|
bitmap\.
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
2020-01-05 18:17:25 +01:00
|
|
|
|
.SH ERRORS
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
2020-01-05 18:17:25 +01:00
|
|
|
|
On failure, one of the following errors will be returned:
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
2020-01-05 18:17:25 +01:00
|
|
|
|
.nf
|
|
|
|
|
.RS
|
|
|
|
|
{ "code" : 400, "message" : "Unable to connect, no address known for peer" }
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
2020-01-05 18:17:25 +01:00
|
|
|
|
|
|
|
|
|
.RE
|
|
|
|
|
|
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
If some addresses are known but connecting to all of them failed, the message
|
|
|
|
|
will contain details about the failures:
|
|
|
|
|
|
|
|
|
|
.nf
|
|
|
|
|
.RS
|
|
|
|
|
{ "code" : 401, "message" : "..." }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.RE
|
|
|
|
|
|
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
If the given parameters are wrong:
|
|
|
|
|
|
|
|
|
|
.nf
|
|
|
|
|
.RS
|
|
|
|
|
{ "code" : -32602, "message" : "..." }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.RE
|
|
|
|
|
|
|
|
|
|
.fi
|
2019-08-10 02:12:44 +02:00
|
|
|
|
.SH AUTHOR
|
|
|
|
|
|
2019-08-31 14:30:56 +02:00
|
|
|
|
Rusty Russell \fI<rusty@rustcorp.com.au\fR> is mainly responsible\.
|
|
|
|
|
Felix \fI<fixone@gmail.com\fR> is the original author of this manpage\.
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
|
|
|
|
|
\fBlightning-fundchannel\fR(7), \fBlightning-listpeers\fR(7),
|
|
|
|
|
\fBlightning-listchannels\fR(7), \fBlightning-disconnect\fR(7)
|
|
|
|
|
|
|
|
|
|
.SH RESOURCES
|
|
|
|
|
|
2019-08-31 14:30:56 +02:00
|
|
|
|
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|