Merge pull request #6050 from arshbot/export-BitcoindBackendConfig-attributes

lntest: export attributes of type BitcoindBackendConfig
This commit is contained in:
Oliver Gugger 2021-12-07 11:36:24 +01:00 committed by GitHub
commit 17babfdd8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 18 deletions

View file

@ -6,10 +6,15 @@
install](https://github.com/lightningnetwork/lnd/pull/6035). install](https://github.com/lightningnetwork/lnd/pull/6035).
* [Make etcd max message size * [Make etcd max message size
configurable]((https://github.com/lightningnetwork/lnd/pull/6049). configurable](https://github.com/lightningnetwork/lnd/pull/6049).
* [Export bitcoind port and other values for itests, useful for
using itest harness outside of
lnd](https://github.com/lightningnetwork/lnd/pull/6050).
# Contributors (Alphabetical Order) # Contributors (Alphabetical Order)
* Andras Banki-Horvath * Andras Banki-Horvath
* Harsha Goli
* Naveen Srinivasan * Naveen Srinivasan
* Oliver Gugger * Oliver Gugger

View file

@ -22,12 +22,12 @@ const logDirPattern = "%s/.backendlogs"
// BitcoindBackendConfig is an implementation of the BackendConfig interface // BitcoindBackendConfig is an implementation of the BackendConfig interface
// backed by a Bitcoind node. // backed by a Bitcoind node.
type BitcoindBackendConfig struct { type BitcoindBackendConfig struct {
rpcHost string RpcHost string
rpcUser string RpcUser string
rpcPass string RpcPass string
zmqBlockPath string ZmqBlockPath string
zmqTxPath string ZmqTxPath string
p2pPort int P2pPort int
rpcClient *rpcclient.Client rpcClient *rpcclient.Client
// minerAddr is the p2p address of the miner to connect to. // minerAddr is the p2p address of the miner to connect to.
@ -43,13 +43,13 @@ var _ BackendConfig = (*BitcoindBackendConfig)(nil)
func (b BitcoindBackendConfig) GenArgs() []string { func (b BitcoindBackendConfig) GenArgs() []string {
var args []string var args []string
args = append(args, "--bitcoin.node=bitcoind") args = append(args, "--bitcoin.node=bitcoind")
args = append(args, fmt.Sprintf("--bitcoind.rpchost=%v", b.rpcHost)) args = append(args, fmt.Sprintf("--bitcoind.rpchost=%v", b.RpcHost))
args = append(args, fmt.Sprintf("--bitcoind.rpcuser=%v", b.rpcUser)) args = append(args, fmt.Sprintf("--bitcoind.rpcuser=%v", b.RpcUser))
args = append(args, fmt.Sprintf("--bitcoind.rpcpass=%v", b.rpcPass)) args = append(args, fmt.Sprintf("--bitcoind.rpcpass=%v", b.RpcPass))
args = append(args, fmt.Sprintf("--bitcoind.zmqpubrawblock=%v", args = append(args, fmt.Sprintf("--bitcoind.zmqpubrawblock=%v",
b.zmqBlockPath)) b.ZmqBlockPath))
args = append(args, fmt.Sprintf("--bitcoind.zmqpubrawtx=%v", args = append(args, fmt.Sprintf("--bitcoind.zmqpubrawtx=%v",
b.zmqTxPath)) b.ZmqTxPath))
return args return args
} }
@ -179,12 +179,12 @@ func newBackend(miner string, netParams *chaincfg.Params, extraArgs []string) (
} }
bd := BitcoindBackendConfig{ bd := BitcoindBackendConfig{
rpcHost: rpcHost, RpcHost: rpcHost,
rpcUser: rpcUser, RpcUser: rpcUser,
rpcPass: rpcPass, RpcPass: rpcPass,
zmqBlockPath: zmqBlockAddr, ZmqBlockPath: zmqBlockAddr,
zmqTxPath: zmqTxAddr, ZmqTxPath: zmqTxAddr,
p2pPort: p2pPort, P2pPort: p2pPort,
rpcClient: client, rpcClient: client,
minerAddr: miner, minerAddr: miner,
} }