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
|
|
|
|
--------
|
|
|
|
|
2022-01-26 18:18:49 +01:00
|
|
|
**connect** *id* [*host*] [*port*]
|
2019-08-10 01:54:18 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2022-06-18 15:18:38 +02:00
|
|
|
If not specified, the *port* depends on the current network:
|
|
|
|
- bitcoin **mainnet**: 9735.
|
|
|
|
- bitcoin **testnet**: 19735.
|
|
|
|
- bitcoin **signet**: 39735.
|
|
|
|
- bitcoin **regtest**: 19846.
|
2019-08-10 01:54:18 +02:00
|
|
|
|
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).
|
|
|
|
|
2022-03-23 00:01:36 +01:00
|
|
|
If there are active channels with the peer, **connect** returns once
|
|
|
|
all the subdaemons are in place to handle the channels, not just once
|
|
|
|
it's connected.
|
|
|
|
|
2019-08-10 01:54:18 +02:00
|
|
|
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
|
2022-07-13 17:45:39 +02:00
|
|
|
- **features** (hex): BOLT 9 features bitmap offered by peer
|
2021-05-26 07:53:01 +02:00
|
|
|
- **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
|
|
|
|
2022-07-13 17:45:39 +02:00
|
|
|
[comment]: # ( SHA256STAMP:ad52e3b3042a8910c106e0730d9d54d09ebdd3cffdb6ba3fd776f8ec4be57e46)
|