2018-05-03 16:54:39 +02:00
|
|
|
LIGHTNING-FUNDCHANNEL(7)
|
|
|
|
========================
|
|
|
|
:doctype: manpage
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
lightning-fundchannel - Command for establishing a lightning channel.
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2018-08-28 22:46:32 +02:00
|
|
|
*fundchannel* 'id' 'satoshi' ['feerate']
|
2018-05-03 16:54:39 +02: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 16:54:39 +02: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 07:51:38 +02:00
|
|
|
The string 'all' can be used to specify all available funds (or 16777215 satoshi if more is available).
|
|
|
|
The value cannot be less than the dust limit, currently set to 546, nor more
|
|
|
|
than 16777215 satoshi.
|
2018-05-03 16:54:39 +02:00
|
|
|
|
2018-08-28 22:46:34 +02:00
|
|
|
'feerate' is an optional feerate to use. It can be one of the strings
|
|
|
|
'urgent', 'normal' or 'slow' to use lightningd's internal estimates:
|
|
|
|
'normal' is the default.
|
|
|
|
|
|
|
|
Otherwise, 'feerate' is a number, with an optional suffix:
|
2018-08-28 22:46:32 +02:00
|
|
|
'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 07:13:57 +02:00
|
|
|
|
2018-05-03 16:54:39 +02: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 18:45:06 +02: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 06:48:12 +02:00
|
|
|
* 302. The output amount is too small, and would be considered dust.
|
2018-05-03 16:54:39 +02: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
|