2018-05-03 09:54:39 -05:00
LIGHTNING-FUNDCHANNEL(7)
========================
:doctype: manpage
NAME
----
lightning-fundchannel - Command for establishing a lightning channel.
SYNOPSIS
--------
2019-04-08 16:20:49 +02:00
*fundchannel* 'id' 'satoshi' ['feerate' 'announce'] ['minconf']
2018-05-03 09:54:39 -05:00
DESCRIPTION
-----------
2018-09-07 16:47:47 +02:00
The *fundchannel* RPC command opens a payment channel with a peer by committing
2018-05-03 09:54:39 -05:00
a funding transaction to the blockchain as defined in BOLT #2.
*fundchannel* by itself does not attempt to open a connection.
A connection must first be established using *connect*.
Once the transaction is confirmed, normal channel operations may begin.
Readiness is indicated by *listpeers* reporting a 'state' of CHANNELD_NORMAL
for the channel.
'id' is the peer id obtained from *connect*.
'satoshi' is the amount in satoshis taken from the internal wallet to fund the channel.
2018-07-29 15:21:38 +09:30
The string 'all' can be used to specify all available funds (or 16777215 satoshi if more is available).
2019-02-23 11:35:51 +10:30
Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in 'sat', a whole number ending in '000msat', or a number with 1 to 8 decimal places ending in 'btc'.
2018-07-29 15:21:38 +09:30
The value cannot be less than the dust limit, currently set to 546, nor more
than 16777215 satoshi.
2018-05-03 09:54:39 -05:00
2019-02-15 21:00:16 +02:00
'feerate' 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
2019-05-24 23:01:17 +03:00
'urgent' (aim for next block), 'normal' (next 4 blocks or so) or 'slow' (next
100 blocks or so) to use lightningd's internal estimates:
2018-08-29 06:16:34 +09:30
'normal' is the default.
2018-12-07 15:40:14 -08:00
'announce' is an optional flag that triggers whether to announce
this channel or not. Defaults to `true`. An unannounced channel
is considered private.
2018-08-29 06:16:34 +09:30
Otherwise, 'feerate' is a number, with an optional suffix:
2018-08-29 06:16:32 +09:30
'perkw' means the number is interpreted as satoshi-per-kilosipa
(weight), and 'perkb' means it is interpreted bitcoind-style as
satoshi-per-kilobyte. Omitting the suffix is equivalent to 'perkb'.
2018-08-27 14:43:57 +09:30
2019-04-08 16:20:49 +02:00
'minconf' specifies the minimum number of confirmations that used outputs should have. Default is 1.
2018-05-03 09:54:39 -05:00
RETURN VALUE
------------
On success, the 'tx' and 'txid' of the transaction is returned, as well as the
'channel_id' of the newly created channel.
On failure, an error is reported and the channel is not funded.
The following error codes may occur:
2018-06-15 11:45:06 -05:00
* -1. Catchall nonspecific error.
* 300. The maximum allowed funding amount is exceeded.
* 301. There are not enough funds in the internal wallet (including fees) to
create the transaction.
2018-06-17 14:18:12 +09:30
* 302. The output amount is too small, and would be considered dust.
2019-01-16 15:24:30 +02:00
* 303. Broadcasting of the funding transaction failed, the internal call to
bitcoin-cli returned with an error.
2018-05-03 09:54:39 -05:00
Failure may also occur if *lightningd* and the peer cannot agree on channel
parameters (funding limits, channel reserves, fees, etc.).
SEE ALSO
--------
lightning-connect(7), lightning-listfunds(), lightning-listpeers(7)
RESOURCES
---------
Main web site: https://github.com/ElementsProject/lightning