2019-08-10 02:12:44 +02:00
|
|
|
|
.TH "LIGHTNING-FUNDCHANNEL" "7" "" "" "lightning-fundchannel"
|
|
|
|
|
.SH NAME
|
2019-08-31 14:30:56 +02:00
|
|
|
|
lightning-fundchannel - Command for establishing a lightning channel
|
2019-08-10 02:12:44 +02:00
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
|
2019-09-19 09:43:26 +02:00
|
|
|
|
\fBfundchannel\fR \fIid\fR \fIamount\fR [\fIfeerate\fR \fIannounce\fR] [\fIminconf\fR]
|
2019-12-21 06:53:12 +01:00
|
|
|
|
[\fIutxos\fR] [\fIpush_msat\fR]
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
|
|
|
|
The \fBfundchannel\fR RPC command opens a payment channel with a peer by
|
|
|
|
|
committing a funding transaction to the blockchain as defined in BOLT
|
2020-01-29 04:25:43 +01:00
|
|
|
|
#2\.
|
|
|
|
|
If not already connected, \fBfundchannel\fR will automatically attempt
|
|
|
|
|
to connect if C-lightning knows a way to contact the node (either from
|
|
|
|
|
normal gossip, or from a previous \fBconnect\fR call)\.
|
|
|
|
|
This auto-connection can fail if C-lightning does not know how to contact
|
|
|
|
|
the target node; see \fBlightning-connect\fR(7)\.
|
|
|
|
|
Once the
|
2019-08-10 02:12:44 +02:00
|
|
|
|
transaction is confirmed, normal channel operations may begin\. Readiness
|
|
|
|
|
is indicated by \fBlistpeers\fR reporting a \fIstate\fR of CHANNELD_NORMAL
|
|
|
|
|
for the channel\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\fIid\fR is the peer id obtained from \fBconnect\fR\.
|
|
|
|
|
|
|
|
|
|
|
2019-09-19 09:43:26 +02:00
|
|
|
|
\fIamount\fR is the amount in satoshis taken from the internal wallet to
|
2019-08-10 02:12:44 +02:00
|
|
|
|
fund the channel\. The string \fIall\fR can be used to specify all available
|
|
|
|
|
funds (or 16777215 satoshi if more is available)\. Otherwise, it is in
|
|
|
|
|
satoshi precision; it can be a whole number, a whole number ending in
|
|
|
|
|
\fIsat\fR, a whole number ending in \fI000msat\fR, or a number with 1 to 8
|
|
|
|
|
decimal places ending in \fIbtc\fR\. The value cannot be less than the dust
|
|
|
|
|
limit, currently set to 546, nor more than 16777215 satoshi\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\fIfeerate\fR is an optional feerate used for the opening transaction and as
|
|
|
|
|
initial feerate for commitment and HTLC transactions\. It can be one of
|
|
|
|
|
the strings \fIurgent\fR (aim for next block), \fInormal\fR (next 4 blocks or
|
|
|
|
|
so) or \fIslow\fR (next 100 blocks or so) to use lightningd’s internal
|
|
|
|
|
estimates: \fInormal\fR is the default\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Otherwise, \fIfeerate\fR is a number, with an optional suffix: \fIperkw\fR means
|
|
|
|
|
the number is interpreted as satoshi-per-kilosipa (weight), and \fIperkb\fR
|
|
|
|
|
means it is interpreted bitcoind-style as satoshi-per-kilobyte\. Omitting
|
|
|
|
|
the suffix is equivalent to \fIperkb\fR\.
|
|
|
|
|
|
|
|
|
|
|
2019-10-19 00:36:52 +02:00
|
|
|
|
\fIannounce\fR is an optional flag that triggers whether to announce this
|
|
|
|
|
channel or not\. Defaults to \fBtrue\fR\. An unannounced channel is considered
|
|
|
|
|
private\.
|
|
|
|
|
|
|
|
|
|
|
2019-08-10 02:12:44 +02:00
|
|
|
|
\fIminconf\fR specifies the minimum number of confirmations that used
|
|
|
|
|
outputs should have\. Default is 1\.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\fIutxos\fR specifies the utxos to be used to fund the channel, as an array
|
|
|
|
|
of "txid:vout"\.
|
|
|
|
|
|
2019-12-21 06:53:12 +01:00
|
|
|
|
|
|
|
|
|
\fIpush_msat\fR is the amount of millisatoshis to push to the channel peer at
|
|
|
|
|
open\. Note that this is a gift to the peer -- these satoshis are
|
|
|
|
|
added to the initial balance of the peer at channel start and are largely
|
|
|
|
|
unrecoverable once pushed\.
|
|
|
|
|
|
2019-08-10 02:12:44 +02:00
|
|
|
|
.SH RETURN VALUE
|
|
|
|
|
|
|
|
|
|
On success, the \fItx\fR and \fItxid\fR of the transaction is returned, as well
|
|
|
|
|
as the \fIchannel_id\fR of the newly created channel\. On failure, an error
|
|
|
|
|
is reported and the channel is not funded\.
|
|
|
|
|
|
|
|
|
|
|
2018-05-03 16:54:39 +02:00
|
|
|
|
The following error codes may occur:
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
2019-10-19 00:36:52 +02:00
|
|
|
|
.RS
|
2019-08-10 02:12:44 +02:00
|
|
|
|
.IP \[bu]
|
|
|
|
|
-1: Catchall nonspecific error\.
|
|
|
|
|
.IP \[bu]
|
|
|
|
|
300: The maximum allowed funding amount is exceeded\.
|
|
|
|
|
.IP \[bu]
|
|
|
|
|
301: There are not enough funds in the internal wallet (including fees) to create the transaction\.
|
|
|
|
|
.IP \[bu]
|
|
|
|
|
302: The output amount is too small, and would be considered dust\.
|
|
|
|
|
.IP \[bu]
|
|
|
|
|
303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error\.
|
|
|
|
|
|
2019-10-19 00:36:52 +02:00
|
|
|
|
.RE
|
2019-08-10 02:12:44 +02:00
|
|
|
|
|
|
|
|
|
Failure may also occur if \fBlightningd\fR and the peer cannot agree on
|
|
|
|
|
channel parameters (funding limits, channel reserves, fees, etc\.)\.
|
|
|
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
|
|
|
|
|
\fBlightning-connect\fR(7), lightning-listfunds(), \fBlightning-listpeers\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
|
|
|
|
|