Btcpayserver
BTCPayServer 是一个开源的加密货币支付处理器,根据 MIT 许可证获得许可。虽然原生支持 Bitcoin,但其他加密货币通过扩展支持。该软件使用 C# 编写,并通过 Web 浏览器访问。该项目的核心思想是让商家完全控制付款,而无需中间人。
安装
安装 软件包 btcpayserverAUR。
配置
Bitcoin
BTCPayServer 通过 RPC 与 Bitcoin 节点通信。为此,需要设置这些值。编辑 /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
Lightning
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