Skip to content

Commit 5ebb293

Browse files
authored
Merge pull request #9977 from starius/itest-bitcoind-neutrino
lntest: enable neutrino testing with bitcoind
2 parents faa68a2 + 7b70ad7 commit 5ebb293

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-1
lines changed

docs/release-notes/release-notes-0.20.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ circuit. The indices are only available for forwarding events saved after v0.20.
131131

132132
## Tooling and Documentation
133133

134+
* lntest: [enable neutrino testing with bitcoind](https://github.com/lightningnetwork/lnd/pull/9977)
135+
134136
# Contributors (Alphabetical Order)
135137

136138
* Abdulkbk

lntest/bitcoind_common.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ func (b BitcoindBackendConfig) Name() string {
8585
return "bitcoind"
8686
}
8787

88+
// P2PAddr return bitcoin p2p ip:port.
89+
func (b BitcoindBackendConfig) P2PAddr() (string, error) {
90+
return fmt.Sprintf("127.0.0.1:%d", b.p2pPort), nil
91+
}
92+
8893
// newBackend starts a bitcoind node with the given extra parameters and returns
8994
// a BitcoindBackendConfig for that node.
9095
func newBackend(miner string, netParams *chaincfg.Params, extraArgs []string,
@@ -124,13 +129,15 @@ func newBackend(miner string, netParams *chaincfg.Params, extraArgs []string,
124129
"d$507c670e800a95284294edb5773b05544b" +
125130
"220110063096c221be9933c82d38e1",
126131
fmt.Sprintf("-rpcport=%d", rpcPort),
127-
fmt.Sprintf("-port=%d", p2pPort),
132+
fmt.Sprintf("-bind=127.0.0.1:%d", p2pPort),
128133
fmt.Sprintf("-bind=127.0.0.1:%d=onion", torBindPort),
129134
"-zmqpubrawblock=" + zmqBlockAddr,
130135
"-zmqpubrawtx=" + zmqTxAddr,
131136
"-debug",
132137
"-debugexclude=libevent",
133138
"-debuglogfile=" + logFile,
139+
"-blockfilterindex",
140+
"-peerblockfilters",
134141
}
135142
cmdArgs = append(cmdArgs, extraArgs...)
136143
bitcoind := exec.Command("bitcoind", cmdArgs...)

lntest/btcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ func (b BtcdBackendConfig) Name() string {
7474
return "btcd"
7575
}
7676

77+
// P2PAddr return bitcoin p2p ip:port.
78+
func (b BtcdBackendConfig) P2PAddr() (string, error) {
79+
return b.harness.P2PAddress(), nil
80+
}
81+
7782
// NewBackend starts a new rpctest.Harness and returns a BtcdBackendConfig for
7883
// that node. miner should be set to the P2P address of the miner to connect
7984
// to.

lntest/neutrino.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ func (b NeutrinoBackendConfig) Name() string {
5454
return NeutrinoBackendName
5555
}
5656

57+
// P2PAddr return bitcoin p2p ip:port.
58+
func (b NeutrinoBackendConfig) P2PAddr() (string, error) {
59+
return b.minerAddr, nil
60+
}
61+
5762
// NewBackend starts and returns a NeutrinoBackendConfig for the node.
5863
func NewBackend(miner string, _ *chaincfg.Params) (
5964
*NeutrinoBackendConfig, func() error, error) {

lntest/node/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ type BackendConfig interface {
114114
// Credentials returns the rpc username, password and host for the
115115
// backend.
116116
Credentials() (string, string, string, error)
117+
118+
// P2PAddr return bitcoin p2p ip:port.
119+
P2PAddr() (string, error)
117120
}
118121

119122
// BaseNodeConfig is the base node configuration.

0 commit comments

Comments
 (0)