#cdk #mint #ln #settings #back-end #node #phoenixd

cdk-phoenixd

CDK ln backend for phoenixd

2 unstable releases

0.4.0 Sep 8, 2024
0.3.0 Aug 31, 2024

#9 in #ln


Used in cdk-mintd

MIT license

460KB
10K 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 channal 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

~32–46MB
~689K SLoC