Btcpayserver
BTCPayServer 是一个开源的加密货币支付处理器,基于 MIT 许可证。虽然原生支持比特币,但其他加密货币通过扩展支持。该软件是用 C# 编写的,通过网页浏览器访问。该项目的核心理念是让商家完全掌控支付,而无需中间商。
安装
安装包 btcpayserverAUR。
配置
Bitcoin
BTCPayServer 通过 RPC 与比特币节点通信。为此,需要设置这些值。编辑 /etc/bitcoin/bitcoin.conf 并设置 rpcuser= 和 rpcpassword=。此外,必须使用 whitelist=127.0.0.1 定义一个白名单。
/etc/bitcoin/bitcoin.conf 中取消注释 prune=550 来完成。可选配置
闪电网络的使用是可选的。有关闪电网络连接字符串的信息可以在 这里找到。选择一种闪电网络实现。
LND
执行 lnd,因为需要生成私钥。然后,执行 lncli create 并创建您需要的钱包或恢复现有钱包。编辑 /etc/bitcoin/bitcoin.conf 并添加以下设置。
zmqpubrawblock=tcp://127.0.0.1:28332 zmqpubrawtx=tcp://127.0.0.1:28333
用法
启动/启用 bitcoind.service
闪电网络
Core Lightning
lightningd --bitcoin-rpcpassword "${bitcoin_rpc_password}" --bitcoin-rpcuser "${USER}" --log-level info --network bitcoin --rpc-file "${XDG_STATE_HOME}"/lightning/lightning-rpc
LND
lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node bitcoind --bitcoind.rpcpass "${bitcoin_rpc_password}" --bitcoind.rpcuser "${USER}" --bitcoind.zmqpubrawblock tcp://127.0.0.1:28332 --bitcoind.zmqpubrawtx tcp://127.0.0.1:28333 --externalip localhost lncli unlock
NBXplorer
nbxplorer --btcrpcpassword "${bitcoin_rpc_password}" --btcrpcuser "${USER}" -d "${XDG_DATA_HOME}"/nbxplorer/ --postgres "User ID=\"${USER}\";Password=\"${postgresql_password}\";Host=localhost;Port=5432;Database=nbxplorer;"
BTCPayServer
运行时,如果不使用闪电网络节点,只需跳过选项 --btclightning。
配合 Core Lightning
btcpayserver --btclightning type=clightning;unix://"${XDG_STATE_HOME}"/lightning/lightning-rpc -d "${XDG_DATA_HOME}"/btcpayserver/ --explorerpostgres "User ID=\"${USER}\";Password=\"${postgresql_password}\";Host=localhost;Port=5432;Database=nbxplorer;\" --sqlitefile btcpayserver.db
配合 LND
btcpayserver --btclightning type=lnd-rest;server=https://127.0.0.1:8080/;macaroonfilepath=/home/"${USER}"/.lnd/data/chain/bitcoin/mainnet/admin.macaroon;certthumbprint="$(openssl x509 -noout -fingerprint -sha256 -in ~/.lnd/tls.cert | sed -e "s/.*=//;s/://g")" -d "${XDG_DATA_HOME}\"/btcpayserver/ --explorerpostgres "UserID=\"${USER}\";Password=${postgresql_password};Host=localhost;Port=5432;Database=nbxplorer;\" --sqlitefile btcpayserver.db