修改直接 docker进入相关容器 修改 /root/.lightning/config,重启服务后就会丢失。
经过和 GTP 沟通,最终的解决方案如下:
关于在Docker环境中使用docker-compose.yml配置文件持久化c-lightning的experimental-dual-fund配置。您提到在重启容器后之前的修改会丢失。
我们最终的解决方案是直接在docker-compose.yml文件中的c-lightning服务定义里通过LIGHTNINGD_OPT环境变量添加experimental-dual-fund=true,确保这项配置在c-lightning启动时被正确应用并持久化。之后,您需要运行以下命令来重启Docker服务。
clightning_bitcoin: image: btcpayserver/lightning:v23.08 container_name: btcpayserver_clightning_bitcoin restart: unless-stopped environment: LIGHTNINGD_NETWORK: ${NBITCOIN_NETWORK:-regtest} LIGHTNINGD_CHAIN: btc LIGHTNINGD_ALIAS: ${LIGHTNING_ALIAS} LIGHTNINGD_ANNOUNCEADDR: ${BTCPAY_ANNOUNCEABLE_HOST} LIGHTNINGD_PORT: 9735 LIGHTNINGD_READY_FILE: /root/.nbxplorer/btc_fully_synched LIGHTNINGD_OPT: | bitcoin-datadir=/etc/bitcoin bitcoin-rpcconnect=bitcoind experimental-offers experimental-dual-fund=true # Add this line database-upgrade=true rpc-file-mode=0666 proxy=tor:9050 HIDDENSERVICE_NAME: c-lightning HIDDENSERVICE_PORT: 9735 LIGHTNINGD_HIDDENSERVICE_HOSTNAME_FILE: /var/lib/tor/hidden_services/c-lightning/hostname volumes: - "clightning_bitcoin_datadir:/root/.lightning" - "bitcoin_datadir:/etc/bitcoin" - "nbxplorer_datadir:/root/.nbxplorer" - "tor_servicesdir:/var/lib/tor/hidden_services" ports: - "9735:9735" links: - bitcoind - tor