#cdk #ln #back-end #node #channel #run #phoenixd

cdk-phoenixd

CDK ln backend for phoenixd

4 releases (breaking)

new 0.6.0 Dec 17, 2024
0.5.0 Nov 19, 2024
0.4.0 Sep 8, 2024
0.3.0 Aug 31, 2024

#9 in #ln

Download history 182/week @ 2024-08-26 87/week @ 2024-09-02 137/week @ 2024-09-09 13/week @ 2024-09-16 7/week @ 2024-09-23 2/week @ 2024-09-30 10/week @ 2024-10-14 13/week @ 2024-11-04 157/week @ 2024-11-18 12/week @ 2024-11-25 4/week @ 2024-12-09

173 downloads per month
Used in cdk-mintd

MIT license

605KB
13K SLoC

cdk-phoenixd

Run phoenixd

The phoenixd node is included in the cdk and needs to be run separately. Get started here: Phoenixd Server Documentation

Start Phoenixd

By default, phoenixd will run with auto-liquidity enabled. While this simplifies channel management, it makes fees non-deterministic, which is not recommended for most scenarios. However, it is necessary to start with auto-liquidity enabled in order to open a channel and get started.

Start the node with auto-liquidity enabled as documented by Phoenixd:

./phoenixd

Note: By default the auto-liquidity will open a channel of 2m sats depending on the size of mint you plan to run you may want to increase this by setting the --auto-liquidity flag to 5m or 10m.

Open Channel

Once the node is running, create an invoice using the phoenixd-cli to fund your node. A portion of this deposit will go to ACINQ as a fee for the provided liquidity, and a portion will cover the mining fee. These two fees cannot be refunded or withdrawn from the node. More on fees can be found here. The remainder will stay as the node balance and can be withdrawn later.

./phoenix-cli createinvoice \
    --description "Fund Node" \
    --amountSat xxxxx

Note: The amount above should be set depending on the size of the mint you would like to run as it will determine the size of the channel and amount of liquidity.

Check Channel state

After paying the invoice view that a channel has been opened.

./phoenix-cli listchannels

Restart Phoenixd without auto-liquidity

Now that the node has a channel, it is recommended to stop the node and restart it without auto-liquidity. This will prevent phoenixd from opening new channels and incurring additional fees.

./phoenixd --auto-liquidity off

Start cashu-mintd

Once the node is running following the cashu-mintd to start the mint. by default the api_url will be http://127.0.0.1:9740 and the api_password can be found in ~/.phoenix/phoenix.conf these will need to be set in the cdk-mintd config file.

Dependencies

~26–40MB
~626K SLoC