2019-08-31 14:30:56 +02:00
|
|
|
lightning-connect -- Command for connecting to another lightning node
|
|
|
|
=====================================================================
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
|
|
|
**connect** *id* \[*host* *port*\]
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
|
|
|
The **connect** RPC command establishes a new connection with another
|
|
|
|
node in the Lightning Network.
|
|
|
|
|
2021-10-24 11:44:56 +02:00
|
|
|
*id* represents the target node's public key. As a convenience, *id* may
|
2019-08-10 01:54:18 +02:00
|
|
|
be of the form *id@host* or *id@host:port*. In this case, the *host* and
|
|
|
|
*port* parameters must be omitted.
|
|
|
|
|
2021-10-24 11:44:56 +02:00
|
|
|
*host* is the peer's hostname or IP address.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
If not specified, the *port* defaults to 9735.
|
|
|
|
|
2021-03-16 04:44:36 +01:00
|
|
|
If *host* is not specified (or doesn't work), the connection will be attempted to an IP
|
2019-08-10 01:54:18 +02:00
|
|
|
belonging to *id* 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 *id* is a fresh install that has no channels yet
|
|
|
|
(nobody will gossip about a node until it has one published channel).
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
If *host* begins with a */* it is interpreted as a local path, and the
|
|
|
|
connection will be made to that local socket (see **bind-addr** in
|
|
|
|
lightningd-config(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
|
|
|
|
lightning-fundchannel(7).
|
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
------------
|
|
|
|
|
2021-05-26 07:53:01 +02:00
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-START)
|
|
|
|
On success, an object is returned, containing:
|
|
|
|
- **id** (pubkey): the peer we connected to
|
|
|
|
- **features** (hex): BOLT 9 features bitmap offered by peer
|
|
|
|
- **direction** (string): Whether they initiated connection or we did (one of "in", "out")
|
|
|
|
- **address** (object): Address information (mainly useful if **direction** is *out*):
|
|
|
|
- **type** (string): Type of connection (*torv2*/*torv3* only if **direction** is *out*) (one of "local socket", "ipv4", "ipv6", "torv2", "torv3")
|
|
|
|
|
|
|
|
If **type** is "local socket":
|
|
|
|
- **socket** (string): socket filename
|
|
|
|
|
|
|
|
If **type** is "ipv4", "ipv6", "torv2" or "torv3":
|
|
|
|
- **address** (string): address in expected format for **type**
|
|
|
|
- **port** (u16): port number
|
2021-09-03 12:07:59 +02:00
|
|
|
|
2021-05-26 07:53:01 +02:00
|
|
|
[comment]: # (GENERATE-FROM-SCHEMA-END)
|
2019-08-10 01:54:18 +02:00
|
|
|
|
2020-01-05 18:17:25 +01:00
|
|
|
ERRORS
|
|
|
|
------
|
|
|
|
|
|
|
|
On failure, one of the following errors will be returned:
|
|
|
|
|
|
|
|
{ "code" : 400, "message" : "Unable to connect, no address known for peer" }
|
|
|
|
|
|
|
|
If some addresses are known but connecting to all of them failed, the message
|
|
|
|
will contain details about the failures:
|
|
|
|
|
|
|
|
{ "code" : 401, "message" : "..." }
|
|
|
|
|
|
|
|
If the given parameters are wrong:
|
|
|
|
|
|
|
|
{ "code" : -32602, "message" : "..." }
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
AUTHOR
|
|
|
|
------
|
|
|
|
|
|
|
|
Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible.
|
|
|
|
Felix <<fixone@gmail.com>> is the original author of this manpage.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
|
|
|
|
lightning-fundchannel(7), lightning-listpeers(7),
|
|
|
|
lightning-listchannels(7), lightning-disconnect(7)
|
|
|
|
|
|
|
|
RESOURCES
|
|
|
|
---------
|
|
|
|
|
|
|
|
Main web site: <https://github.com/ElementsProject/lightning>
|
2020-08-25 03:33:16 +02:00
|
|
|
|
2021-09-03 12:07:59 +02:00
|
|
|
[comment]: # ( SHA256STAMP:306d0966721f20c9a8688f33a030114a5ac095c6218eeb7fafd88fca97b9ee52)
|